filename
stringlengths
5
142
content
stringlengths
2
26M
label
int64
0
1
1316.ps1
function Install-CJunction { [CmdletBinding(SupportsShouldProcess=$true)] [OutputType([IO.DirectoryInfo])] param( [Parameter(Mandatory=$true)] [Alias("Junction")] [string] $Link, [Parameter(Mandatory=$true)] [string] $T...
0
AutoArchive.ps1
# AutoArchive PowerShell Script # http://powershell.codeplex.com param ( [ValidateNotNullOrEmpty()] [Parameter( Mandatory = $true) ] [string] $Source, [int] $RetentionDays, [array] $Include, [array] $Exclude, [switch] $Recurse ) # Load Zip Module Import-Module PowerZip # Che...
0
3424.ps1
function Test-ResourceLockCRUD { $rgname = Get-ResourceGroupName $rname = Get-ResourceName $rglocation = Get-ProviderLocation ResourceManagement $apiversion = "2014-04-01" $rg = New-AzureRMResourceGroup -Name $rgname -Location $rglocation $actual = New-AzureRMResourceLock -LockName $rname -LockL...
0
788.ps1
 function Register-EditorCommand { [CmdletBinding()] param( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string]$Name, [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string]$DisplayName, [Parameter( Mandatory=$tr...
0
sample_5_74.ps1
ConvertFrom-StringData @' id_ctsDFSserver=DFS Server id_ctsDFSserverDescription=Collects information about DFS Server. '@ # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAI...
0
Format-TablePlus_1.ps1
#requires -version 2.0 ## Format-Table with wrapping and string trimming. function Format-TablePlus() { [CmdletBinding()] param( [Switch] ${AutoSize}, [Switch] ${HideTableHeaders}, [Switch] ${Wrap}, [Parameter(Position=0)] [System.Object[]] ${Property}, [System.Object...
0
1719.ps1
Function Get-ServiceNowAttachment { [System.Diagnostics.CodeAnalysis.SuppressMessage('PSAvoidUsingConvertToSecureStringWithPlainText','')] [System.Diagnostics.CodeAnalysis.SuppressMessage('PSAvoidGlobalVars','')] [CmdletBinding(DefaultParameterSetName,SupportsShouldProcess=$true)] Param( ...
0
Remove-XmlNamespace.ps1
function Remove-XmlNamespace { #.Synopsis # Removes namespace definitions and prefixes from xml documents #.Description # Runs an xml document through an XSL Transformation to remove namespaces from it if they exist. # Entities are also naturally expanded #.Parameter Content # Specifies a string that contain...
0
sample_0_79.ps1
##---------------------------------------------------------------------------- ## Copyright (c) Axis Communications AB, SWEDEN. All rights reserved. ##---------------------------------------------------------------------------- # Import string constants . ./StringConstants.ps1 Stop-Service -Name $ServiceConsta...
0
2974.ps1
param ( [Parameter(Mandatory)] [String] $CertificateThumbprint, [Parameter(Mandatory)] [String] $NugetApiKey, [String] $ChocolateyApiKey, [Parameter(Mandatory)] [String] $PsGalleryApiKey ) .\updateGherkinLanguageFile.ps1 $ErrorActionPreference = 'Stop' $process = Start-Process powersh...
0
2495.ps1
param( $SQLServer = 'STGSQLDOC710', $ScriptDir = '\\messano338\e$\dexma\logs\', $FilePrefix = 'Log', [switch]$Log ) $IndicesUnused = Get-ChildItem -Path $ScriptDir -Filter *IndexesUnused*.xlsx | sort-object -desc $IndicesMissing = Get-ChildItem -Path $ScriptDir -Filter *IndexesMissing*.xlsx | sort-object -des...
0
1899.ps1
Describe "Read-Host Test" -tag "CI" { BeforeAll { $th = New-TestHost $rs = [runspacefactory]::Createrunspace($th) $rs.open() $ps = [powershell]::Create() $ps.Runspace = $rs $ps.Commands.Clear() } AfterEach { $ps.Commands.Clear() } AfterAll ...
0
sample_24_60.ps1
# # Script module for module 'PackageManagement' # Set-StrictMode -Version Latest Microsoft.PowerShell.Utility\Import-LocalizedData LocalizedData -filename PackageManagement.Resources.psd1 # Summary: PackageManagement is supported on Windows PowerShell 3.0 or later, Nano Server and PowerShellCore $isCore = ($P...
0
2283.ps1
[CmdletBinding(SupportsShouldProcess=$true)] param( [parameter(Mandatory=$false, HelpMessage="Site server where the SMS Provider is installed")] [string]$SiteServer = "CAS01", [parameter(Mandatory=$false, HelpMessage="ResourceID of the device")] [string]$ResourceID = "16777224" ) Begin { try { ...
0
3824.ps1
function Test-VirtualMachineBootDiagnostics { $rgname = Get-ComputeTestResourceName try { $loc = Get-ComputeVMLocation; New-AzResourceGroup -Name $rgname -Location $loc -Force; $vmsize = 'Standard_A4'; $vmname = 'vm' + $rgname; ...
0
sample_3_73.ps1
#************************************************ # TS_IPv6Check.ps1 # Version 1.0 # Date: 5-1-2012 # Author: davidcop # Description: Checks for nics with IPv6 unchecked and the disabledcomponents registry value does not exist #************************************************ #_# update for Win10 if ((($OSVe...
0
sample_32_74.ps1
# # Module manifest for module 'OCI.PSModules.Vbsinst' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Vbsinst.dll' # Version number of this module. ModuleVersion = '83.2.0' # Supported PSEditions Compat...
0
Set-IPAddress_6.ps1
function Set-IPAddress { param( [string]$networkinterface =$(read-host "Enter the name of the NIC (ie Local Area Connection)"), [string]$ip = $(read-host "Enter an IP Address (ie 10.10.10.10)"), @@[string]$mask = $(read-host "Enter the subnet mask (ie 255.255.255.0)"), [string]$gateway = $(read-host "Ent...
0
3970.ps1
function Check-CmdletReturnType { param($cmdletName, $cmdletReturn) $cmdletData = Get-Command $cmdletName Assert-NotNull $cmdletData [array]$cmdletReturnTypes = $cmdletData.OutputType.Name | Foreach-Object { return ($_ -replace "Microsoft.Azure.Commands.Network.Models.","") } [array]$...
0
2940.ps1
properties { $testMessage = 'Executed Test!' $compileMessage = 'Executed Compile!' $cleanMessage = 'Executed Clean!' } task default -depends Test task Test -depends Compile, Clean { $testMessage } task Compile -depends Clean { $compileMessage } task Clean { $cleanMessage }
0
Get-PerformanceHistory _1.ps1
#requires -version 2.0 ## Get-PerformanceHistory.ps1 ############################################################################################################## ## Lets you see the amount of time recent commands in your history have taken ## History: ## v2.5 - added "average" calculation if the first thing in y...
0
sample_41_68.ps1
function trySetDesignerProp(tname, ttype, val) { var trait = document.designerProps.getOrCreateTrait(tname, ttype, 0); trait.value = val; } if (command.getTrait("state").value == 0) { command.getTrait("state").value = 2; trySetDesignerProp("manipulationWorldMode", "bool", true); } else { ...
0
sample_23_0.ps1
# # Module manifest for module 'OCI.PSModules.Analytics' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Analytics.dll' # Version number of this module. ModuleVersion = '80.0.0' # Supported PSEditions Co...
0
3030.ps1
Set-StrictMode -Version Latest InModuleScope Pester { Describe "Should -Throw" { Context "Basic functionality" { It "given scriptblock that throws an exception it passes" { { throw } | Should -Throw } It "given scriptblock that throws an exception is pas...
0
2479.ps1
function Remove-AzrVirtualMachine { [CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'High')] param ( [Parameter(Mandatory, ValueFromPipelineByPropertyName)] [ValidateNotNullOrEmpty()] [Alias('Name')] [string]$VMName, [Parameter(Mandatory, ValueFromPipelineByPropertyName)] [ValidateNotNullOrEmp...
0
sample_50_45.ps1
# # Module manifest for module 'OCI.PSModules.Ocicontrolcenter' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Ocicontrolcenter.dll' # Version number of this module. ModuleVersion = '77.0.0' # Supported...
0
1808.ps1
Import-Module HelpersCommon function Clean-State { if (Test-Path $FullyQualifiedLink) { Remove-Item $FullyQualifiedLink -Force } if (Test-Path $FullyQualifiedFile) { Remove-Item $FullyQualifiedFile -Force } if ($FullyQualifiedFileInFolder -and (Test-Path $FullyQualified...
0
MoveExch2010SP1Archives.ps1
#================================================================================= # MoveArchives.ps1 # # THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY # KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A # PART...
0
sample_24_3.ps1
# # Module manifest for module 'OCI.PSModules.Managementagent' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Managementagent.dll' # Version number of this module. ModuleVersion = '80.0.0' # Supported P...
0
1108.ps1
$siteName = 'UnlockIisConfigSection' $windowsAuthWasLocked = $false $windowsAuthConfigPath = 'system.webServer/security/authentication/windowsAuthentication' $cgiConfigPath = 'system.webServer/cgi' function Start-TestFixture { & (Join-Path -Path $PSScriptRoot '..\Initialize-CarbonTest.ps1' -Resolve) } ...
0
sample_4_51.ps1
#************************************************ #Last Updated Date: 05-24-2012 #Updated By: Alec Yao v-alyao@microsoft.com #Description: Add two arguments for the script, called $Prefix and $Suffix. It will allow to custermize the filename #************************************************ PARAM ($NFO = $true...
0
sample_59_8.ps1
# # Module manifest for module 'OCI.PSModules.Marketplace' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Marketplace.dll' # Version number of this module. ModuleVersion = '83.3.0' # Supported PSEdition...
0