full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/PowerShellGallery/Storefront/0.9.4/DSCResources/VE_SFStoreFarm/VE_SFStoreFarm.ps1
VE_SFStoreFarm.ps1
Import-LocalizedData -BindingVariable localizedData -FileName Resources.psd1; $immutableProperties = @( # Properties that cannot be changed after creation ); $mutableProperties = @( # Properties that can be successfully updated 'FarmType', 'BypassDuration', 'MaxFailedServersPerRequest', 'SSLR...
PowerShellCorpus/PowerShellGallery/Storefront/0.9.4/DSCResources/VE_SFStoreWebReceiver/VE_SFStoreWebReceiver.ps1
VE_SFStoreWebReceiver.ps1
Import-LocalizedData -BindingVariable localizedData -FileName Resources.psd1; function Get-TargetResource { [CmdletBinding()] [OutputType([System.Collections.Hashtable])] param ( ## Store virtual path, e.g. /Citrix/Store [Parameter(Mandatory)] [System.String] $StoreVirtualPa...
PowerShellCorpus/PowerShellGallery/Storefront/0.9.4/DSCResources/VE_SFAuthenticationService/VE_SFAuthenticationService.ps1
VE_SFAuthenticationService.ps1
Import-LocalizedData -BindingVariable localizedData -FileName Resources.psd1; function Get-TargetResource { [CmdletBinding()] [OutputType([System.Collections.Hashtable])] param ( ## Citrix Storefront Authentication Service IIS Virtual Path [Parameter(Mandatory)] [System.Stri...
PowerShellCorpus/PowerShellGallery/Storefront/0.9.4/DSCResources/VE_SFGateway/VE_SFGateway.ps1
VE_SFGateway.ps1
Import-LocalizedData -BindingVariable localizedData -FileName Resources.psd1; $immutableProperties = @( # Properties that cannot be changed after creation ); $mutableProperties = @( # Properties that can be successfully updated 'LogonType', 'SmartCardFallbackLogonType', 'CallbackUrl', 'Sessio...
PowerShellCorpus/PowerShellGallery/WakeOnLan/1.0/PublishPsGalleryModule.ps1
PublishPsGalleryModule.ps1
#requires -Modules PowerShellGet $ReleaseNotes =@' Invoke-WakeOnLan Chris Warwick, @cjwarwickps, January 2012. This version, November 2015. Cmdlet to send a Wake-on-Lan packet to a specified target MAC addresses. Wake on Lan (WOL) uses a “Magic Packet” that consists of six bytes of 0xFF (the physical l...
PowerShellCorpus/PowerShellGallery/WinCloudInit/1.3.1/plugins/11-cert.ps1
11-cert.ps1
[CmdletBinding()] param( $Config ) # pfx/p12 and cer/crt are supported @($Config.Certificates) -ne $null | % { $CertificatePath = if (($Uri = [uri]$_.Url).Scheme) { $tmp = Join-Path ([System.IO.Path]::GetTempPath()) $Uri.Segments[-1] Invoke-WebRequest -Uri $Uri -OutFile $tmp $tmp...
PowerShellCorpus/PowerShellGallery/WinCloudInit/1.3.1/plugins/28-disk.ps1
28-disk.ps1
[CmdletBinding()] param( $Config ) Write-Verbose 'Extending existing volumes' 'rescan' | diskpart (Get-CimInstance -Class Win32_Volume -Property Name -Verbose:$false).Name -match ':' | % { "select volume $_",'extend' | diskpart } # config source here! check plugin execution order Write-Verbose 'Changing...
PowerShellCorpus/PowerShellGallery/WinCloudInit/1.3.1/plugins/04-network.ps1
04-network.ps1
[CmdletBinding()] param( $Config ) function ConvertTo-SubnetMask ([int]$SubnetMaskLength) { $SubnetMask = -1 -shl (32 - $SubnetMaskLength) $Bytes = [BitConverter]::GetBytes($SubnetMask) if ([BitConverter]::IsLittleEndian) { [array]::Reverse($Bytes) } [ipaddress]$Bytes } Writ...
PowerShellCorpus/PowerShellGallery/WinCloudInit/1.3.1/plugins/16-rdp.ps1
16-rdp.ps1
[CmdletBinding()] param( $Config ) if ($Config.RDP) { Write-Verbose 'Allow RDP' Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -Name fDenyTSConnections -Value 0 Write-Verbose 'Enable Network Level Authentication' Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Cont...
PowerShellCorpus/PowerShellGallery/WinCloudInit/1.3.1/plugins/01-reboot.ps1
01-reboot.ps1
[CmdletBinding()] param( $Config ) Sleep 60 'reboot' Restart-Computer
PowerShellCorpus/PowerShellGallery/WinCloudInit/1.3.1/plugins/12-winrm.ps1
12-winrm.ps1
[CmdletBinding()] param( $Config ) if ($Config.WinRM) { #Write-Verbose 'Enabling WinRM' #Enable-PSRemoting -Force | Out-Null #winrm quickconfig -transport:https #winrm enumerate winrm/config/listener Write-Verbose 'Configuring firewall WinRM exception' #Enable-NetFirewallRule -DisplayGroup 'Window...
PowerShellCorpus/PowerShellGallery/WinCloudInit/1.3.1/plugins/08-hostname.ps1
08-hostname.ps1
[CmdletBinding()] param( $Config ) # cannot rename domain machine if ($Config.HostName -and $env:COMPUTERNAME -ne $Config.HostName -and -not [System.Net.DNS]::GetHostByName('').HostName.Contains('.')) { Write-Verbose "Renaming computer to $($Config.HostName)" 'reboot' # system will be rebooted Rename...
PowerShellCorpus/PowerShellGallery/WinCloudInit/1.3.1/plugins/20-firewall.ps1
20-firewall.ps1
[CmdletBinding()] param( $Config ) if ($Config.Firewall.Disabled) { Write-Verbose 'Disabling firewall' #Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False netsh advfirewall set allprofiles state off }
PowerShellCorpus/PowerShellGallery/WinCloudInit/1.3.1/plugins/02-sysprep.ps1
02-sysprep.ps1
[CmdletBinding()] param( $Config ) if ($Config.Sysprep) { $Unattend = switch -Wildcard ((Get-CimInstance -Class Win32_OperatingSystem -Verbose:$false).Caption) { '*2012 R2*' { 'unattend_2K12R2.xml' } '*2008 R2*' { 'unattend_2K8R2.xml' } default { throw 'OS unsupported' } } [xml]$UnattendXml = Get-...
PowerShellCorpus/PowerShellGallery/WinCloudInit/1.3.1/plugins/10-posh.ps1
10-posh.ps1
[CmdletBinding()] param( $Config ) if ($Config.ExecutionPolicy) { Write-Verbose "Setting ExecutionPolicy to $($Config.ExecutionPolicy)" Set-ExecutionPolicy $Config.ExecutionPolicy -Scope LocalMachine -Force }
PowerShellCorpus/PowerShellGallery/WinCloudInit/1.3.1/plugins/09-user.ps1
09-user.ps1
[CmdletBinding()] param( $Config ) $Computer = [ADSI]"WinNT://$env:COMPUTERNAME,computer" @($Config.Groups) -ne $null | % { $Group = $Computer.Create('Group', $_) $Group.SetInfo() } @($Config.Users) -ne $null | % { if ($_.OldName) { $User = [ADSI]"WinNT://$env:COMPUTERNAME/$($_.OldName),...
PowerShellCorpus/PowerShellGallery/WinCloudInit/1.3.1/plugins/24-activation.ps1
24-activation.ps1
[CmdletBinding()] param( $Config ) if ($Config.ProductKey) { Write-Verbose 'Setting product key' slmgr /ipk $Config.ProductKey Write-Verbose 'Activating Windows' slmgr /ato }
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/publish.ps1
publish.ps1
[cmdletbinding()] Param( [Parameter(Mandatory)] [string] $APIkey ) $tags = @( "Azure" , "Template" , "ARM" , "JSON" , "Resource" , "Manager" , "Convert" , "Import" ) Publish-Module -NuGetApiKey $APIkey -Name .\posha...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Functions/New-DynamicParam.ps1
New-DynamicParam.ps1
function New-DynamicParam { [cmdletbinding()] <# .SYNOPSIS Helper function to simplify creating dynamic parameters .DESCRIPTION Helper function to simplify creating dynamic parameters Example use cases: Include parameters only if your environment dictates it...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Functions/Get-ARMtemplate.ps1
Get-ARMtemplate.ps1
#Requires -Version 5.0 function Get-ARMtemplate { <# .SYNOPSIS Get the ARM template defined at the module level .DESCRIPTION Get the ARM template defined at the module level .PARAMETER AsJSON Returns the ARM template as a JSON string .PARAMETER AsHashTableString Returns the ARM template...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Functions/New-ARMTemplate.ps1
New-ARMTemplate.ps1
function New-ARMTemplate { [cmdletbinding()] Param( $schema = "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#" , [switch]$Passthru ) $templateObject = [pscustomobject][ordered]@{ '$schema' = $schema contentVersion = "1.0.0.0" parameters = [pscustomobjec...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Functions/New-ARMvariable.ps1
New-ARMvariable.ps1
#Requires -Version 5.0 function New-ARMvariable { <# .SYNOPSIS Create a new ARM template variable .DESCRIPTION Create a new ARM template variable .PARAMETER Name The name of the variable. This is Mandatory .PARAMETER Value The variable value. This is Mandatory .EXAMPLE N...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Functions/Set-ARMvariable.ps1
Set-ARMvariable.ps1
#Requires -Version 5.0 function Set-ARMvariable { <# .SYNOPSIS Update an existing variable in the ARM template .DESCRIPTION Update an existing variable in the ARM template .PARAMETER Name The variable Name. This is a Mandatory parameter and is an dynamic parameter .PARAMETER Value The n...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Functions/Add-ARMvariable.ps1
Add-ARMvariable.ps1
#Requires -Version 5.0 function Add-ARMvariable { <# .SYNOPSIS Add an ARM variable to an ARM template. .DESCRIPTION Add an ARM variable to an ARM template .PARAMETER InputObject The PSCustomObject of type 'ARMvariable' to be added to the ARM template. .PARAMETER Template The ARM templa...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Functions/Set-ARMparameter.ps1
Set-ARMparameter.ps1
#Requires -Version 5.0 function Set-ARMparameter { <# .SYNOPSIS Update an existing parameter in the ARM template .DESCRIPTION Update an existing parameter in the ARM template .PARAMETER Name The variable Name. This is a Mandatory parameter and is an dynamic parameter .PARAMETER Value Th...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Functions/Get-ARMparameter.ps1
Get-ARMparameter.ps1
#Requires -Version 5.0 function Get-ARMparameter { <# .SYNOPSIS Get all parameters or a specific one by name. .DESCRIPTION Get all parameters or a specific one by name. .PARAMETER Name Name of the parameter to get. This is a dynamic parameter. .EXAMPLE Get-ARMparameter This ...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Functions/New-ARMfunction.ps1
New-ARMfunction.ps1
function New-ARMfunction { [cmdletbinding()] Param( #[Parameter(ParameterSetName='concat')] [switch]$ConCat , #[Parameter(ParameterSetName='concat')] [string[]]$Values ) DynamicParam { $Dictionary = New-Object System.Management.Automation.RuntimeDefinedParameterDictionary...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Functions/Get-ARMtemplateScript.ps1
Get-ARMtemplateScript.ps1
#Requires -Version 5.0 function Get-ARMtemplateScript { <# .SYNOPSIS Get the Powershell script that will recreate the ARM template .DESCRIPTION Get the Powershell script that will recreate the ARM template .PARAMETER Template An PScustomObject that is an ARM template .EXAMPLE Get-ARMtem...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Functions/ConvertTo-Hash.ps1
ConvertTo-Hash.ps1
#Requires -Version 5.0 function ConvertTo-Hash { <# .SYNOPSIS Converts a PScustomobject to a hashtable .DESCRIPTION Converts a PScustomobject to a hashtable .PARAMETER InputObject The PSCustomObject you want to convert to a hashtable .EXAMPLE $obj = [PSCustomobject]@{ Name = "T...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Functions/Update-ARMresourceList.ps1
Update-ARMresourceList.ps1
#Requires -Version 5.0 function Update-ARMresourceList { <# .SYNOPSIS This will update the allResources.json file that is used as input when creating a New-ARMresource .DESCRIPTION This will update the allResources.json file that is used as input when creating a New-ARMresource. This cmdlet supports ...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Functions/Get-ARMvariable.ps1
Get-ARMvariable.ps1
#Requires -Version 5.0 function Get-ARMvariable { <# .SYNOPSIS Get all variable or a specific one by name. .DESCRIPTION Get all variable or a specific one by name. .PARAMETER Name Name of the variable to get. This is a dynamic parameter. .EXAMPLE Get-ARMvariable This will re...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Functions/New-ARMparameter.ps1
New-ARMparameter.ps1
#Requires -Version 5.0 function New-ARMparameter { <# .SYNOPSIS Create a new ARM template parameter .DESCRIPTION Create a new ARM template parameter .PARAMETER Name The name of the parameter. This is Mandatory .PARAMETER Type The parameter type. Allowed values are "string","secu...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Functions/Get-ARMresourceScript.ps1
Get-ARMresourceScript.ps1
#Requires -Version 5.0 function Get-ARMresourceScript { <# .SYNOPSIS Get the Powershell script that will recreate the resources in the ARM template .DESCRIPTION Get the Powershell script that will recreate the resources in the ARM template. This cmdlet is invoked by the Get-ARMtemplateScript cmdlet. ...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Functions/Out-HashString.ps1
Out-HashString.ps1
function Out-HashString { <# .SYNOPSIS Convert an hashtable or and OrderedDictionary to a string .DESCRIPTION Convert an hashtable or and OrderedDictionary to a string .PARAMETER InputObject The object that is to be converted .PARAMETER PreSpacing Number of spaces used for indentation ...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Functions/Import-ARMtemplate.ps1
Import-ARMtemplate.ps1
#Requires -Version 5.0 function Import-ARMtemplate { <# .SYNOPSIS Import an ARM template. .DESCRIPTION This Cmdlet imports an ARM template from a file or from a JSON-string. .PARAMETER JsonString A JSON string that is an ARM template .PARAMETER FileName A file that contains a JSON ARM ...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Functions/Get-ARMparameterScript.ps1
Get-ARMparameterScript.ps1
#Requires -Version 5.0 function Get-ARMparameterScript { <# .SYNOPSIS Get the Powershell script that will recreate the parameteres in the ARM template .DESCRIPTION Get the Powershell script that will recreate the parameteres in the ARM template. This cmdlet is invoked by the Get-ARMtemplateScript cmdlet. .PAR...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Functions/Add-ARMparameter.ps1
Add-ARMparameter.ps1
#Requires -Version 5.0 function Add-ARMparameter { <# .SYNOPSIS Add an ARM parameter to an ARM template. .DESCRIPTION Add an ARM parameter to an ARM template .PARAMETER InputObject The PSCustomObject of type 'ARMparameter' to be added to the ARM template. .PARAMETER Template The ARM template of type...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Functions/Get-ARMvariableScript.ps1
Get-ARMvariableScript.ps1
#Requires -Version 5.0 function Get-ARMvariableScript { <# .SYNOPSIS Get the Powershell script that will recreate the variables in the ARM template .DESCRIPTION Get the Powershell script that will recreate the variables in the ARM template. This cmdlet is invoked by the Get-ARMtemplateScript cmdlet. ...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Functions/New-ARMresource.ps1
New-ARMresource.ps1
#Requires -Version 5.0 function New-ARMresource { <# .SYNOPSIS Create a new ARM template resource .DESCRIPTION Create a new ARM template resource .PARAMETER Name The name of the parameter. This is Mandatory .PARAMETER Type The parameter type. These are the types returned by Get-...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Functions/Get-ARMresourceList.ps1
Get-ARMresourceList.ps1
#Requires -Version 5.0 function Get-ARMresourceList { <# .SYNOPSIS Get a list of resource providers in Azure .DESCRIPTION Get a list of resource providers in Azure. The list is read from an cached file in the module (.\Data\allResources.json) See also Update-ARMresourceList cmdlet. .PARAMETER...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Functions/Add-ARMresource.ps1
Add-ARMresource.ps1
#Requires -Version 5.0 function Add-ARMresource { <# .SYNOPSIS Add an ARM resource to an ARM template. .DESCRIPTION Add an ARM resource to an ARM template .PARAMETER InputObject The PSCustomObject of type 'ARMresource' to be added to the ARM template. This parameter is mandatory. .PARAMETER ...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Functions/Set-ARMmetadata.ps1
Set-ARMmetadata.ps1
function Set-ARMmetadata { <# .SYNOPSIS Creates a metadata.json file for your ARM template .DESCRIPTION Creates a metadata.json file for your ARM template .EXAMPLE $meta = @{ ItemDisplayName = "Blank Template" Description = "A blank template and empty parameters file" ...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Tests/Get-ARMresourceList.Tests.ps1
Get-ARMresourceList.Tests.ps1
#$here = Split-Path -Parent $MyInvocation.MyCommand.Path #$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.' #. "$here\$sut" $modulePath = Split-Path $PSScriptRoot -Parent $modulepath = Join-Path -Path $modulePath -ChildPath posharm.psd1 Import-Module $modulePath Describe "Get-AR...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Tests/ConvertTo-Hash.Tests.ps1
ConvertTo-Hash.Tests.ps1
#$here = Split-Path -Parent $MyInvocation.MyCommand.Path #$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.' #. "$here\$sut" #$path = "C:\Users\tore\Dropbox\SourceTreeRepros\PoshARM\PoshARM.psd1" #Import-Module $path $modulePath = Split-Path $PSScriptRoot -Parent $modulepath = Jo...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Tests/Get-ARMvariableScript.Tests.ps1
Get-ARMvariableScript.Tests.ps1
#$here = Split-Path -Parent $MyInvocation.MyCommand.Path #$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.' #. "$here\$sut" #Import-Module "C:\Users\tore\Dropbox\SourceTreeRepros\PoshARM\PoshARM.psd1" $modulePath = Split-Path $PSScriptRoot -Parent $modulepath = Join-Path -Path $mod...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Tests/New-ARMvariable.Tests.ps1
New-ARMvariable.Tests.ps1
#$here = Split-Path -Parent $MyInvocation.MyCommand.Path #$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.' #. "$here\$sut" #$path = "C:\Users\tore\Dropbox\SourceTreeRepros\PoshARM\PoshARM.psd1" #Import-Module $path $modulePath = Split-Path $PSScriptRoot -Parent $modulepath = Join...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Tests/Get-ARMtemplateScript.Tests.ps1
Get-ARMtemplateScript.Tests.ps1
#$here = Split-Path -Parent $MyInvocation.MyCommand.Path #$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.' #. "$here\$sut" $modulePath = Split-Path $PSScriptRoot -Parent $modulepath = Join-Path -Path $modulePath -ChildPath posharm.psd1 Import-Module $modulePath Describe "Get-AR...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Tests/New-ARMparameter.Tests.ps1
New-ARMparameter.Tests.ps1
#$here = Split-Path -Parent $MyInvocation.MyCommand.Path #$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.' #. "$here\$sut" $modulePath = Split-Path $PSScriptRoot -Parent $modulepath = Join-Path -Path $modulePath -ChildPath posharm.psd1 Import-Module $modulePath Describe "New-AR...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Tests/Add-ARMparameter.Tests.ps1
Add-ARMparameter.Tests.ps1
#$here = Split-Path -Parent $MyInvocation.MyCommand.Path #$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.' #. "$here\$sut" #Import-Module C:\Users\tore\Dropbox\SourceTreeRepros\PoshARM $modulePath = Split-Path $PSScriptRoot -Parent $modulepath = Join-Path -Path $modulePath -ChildP...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Tests/Get-ARMparameterScript.Tests.ps1
Get-ARMparameterScript.Tests.ps1
#$here = Split-Path -Parent $MyInvocation.MyCommand.Path #$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.' #. "$here\$sut" $modulePath = Split-Path $PSScriptRoot -Parent $modulepath = Join-Path -Path $modulePath -ChildPath posharm.psd1 Import-Module $modulePath Describe "Get-AR...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Tests/Set-ARMvariable.Tests.ps1
Set-ARMvariable.Tests.ps1
#$here = Split-Path -Parent $MyInvocation.MyCommand.Path #$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.' #. "$here\$sut" $modulePath = Split-Path $PSScriptRoot -Parent $modulepath = Join-Path -Path $modulePath -ChildPath posharm.psd1 Import-Module $modulePath New-ArmTemplate ...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Tests/Add-ARMresource.Tests.ps1
Add-ARMresource.Tests.ps1
#$here = Split-Path -Parent $MyInvocation.MyCommand.Path #$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.' #. "$here\$sut" $modulePath = Split-Path $PSScriptRoot -Parent $modulepath = Join-Path -Path $modulePath -ChildPath posharm.psd1 Import-Module $modulePath Describe "Add-AR...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Tests/New-ARMresource.Tests.ps1
New-ARMresource.Tests.ps1
#$here = Split-Path -Parent $MyInvocation.MyCommand.Path #$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.' #. "$here\$sut" #Import-Module C:\Users\tore\Dropbox\SourceTreeRepros\PoshARM $modulePath = Split-Path $PSScriptRoot -Parent $modulepath = Join-Path -Path $modulePath -ChildPat...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Tests/Set-ARMmetadata.Tests.ps1
Set-ARMmetadata.Tests.ps1
#$here = Split-Path -Parent $MyInvocation.MyCommand.Path #$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.' #. "$here\$sut" $modulePath = Split-Path $PSScriptRoot -Parent $modulepath = Join-Path -Path $modulePath -ChildPath posharm.psd1 Import-Module $modulePath Describe "Set-AR...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Tests/Import-ARMtemplate.Tests.ps1
Import-ARMtemplate.Tests.ps1
#$here = Split-Path -Parent $MyInvocation.MyCommand.Path #$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.' #. "$here\$sut" $modulePath = Split-Path $PSScriptRoot -Parent $modulepath = Join-Path -Path $modulePath -ChildPath posharm.psd1 Import-Module $modulePath Describe "Import...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Tests/Get-ARMresourceScript.Tests.ps1
Get-ARMresourceScript.Tests.ps1
#$here = Split-Path -Parent $MyInvocation.MyCommand.Path #$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.' #. "$here\$sut" $modulePath = Split-Path $PSScriptRoot -Parent $modulepath = Join-Path -Path $modulePath -ChildPath posharm.psd1 Import-Module $modulePath Describe "Get-AR...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Tests/New-ARMTemplate.Tests.ps1
New-ARMTemplate.Tests.ps1
#$here = Split-Path -Parent $MyInvocation.MyCommand.Path #$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.' #. "$here\$sut" $modulePath = Split-Path $PSScriptRoot -Parent $modulepath = Join-Path -Path $modulePath -ChildPath poshARM.psd1 Import-Module $modulePath Describe "New-AR...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Tests/Get-ARMvariable.Tests.ps1
Get-ARMvariable.Tests.ps1
#$here = Split-Path -Parent $MyInvocation.MyCommand.Path #$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.' #. "$here\$sut" #Import-Module "C:\Users\tore\Dropbox\SourceTreeRepros\PoshARM\PoshARM.psd1" $modulePath = Split-Path $PSScriptRoot -Parent $modulepath = Join-Path -Path $mod...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Tests/New-DynamicParam.Tests.ps1
New-DynamicParam.Tests.ps1
#$here = Split-Path -Parent $MyInvocation.MyCommand.Path #$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.' #. "$here\$sut" $modulePath = Split-Path $PSScriptRoot -Parent $modulepath = Join-Path -Path $modulePath -ChildPath posharm.psd1 Import-Module $modulePath Describe "New-Dy...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Tests/Add-ARMvariable.Tests.ps1
Add-ARMvariable.Tests.ps1
#$here = Split-Path -Parent $MyInvocation.MyCommand.Path #$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.' #. "$here\$sut" $modulePath = Split-Path $PSScriptRoot -Parent $modulepath = Join-Path -Path $modulePath -ChildPath posharm.psd1 Import-Module $modulePath Describe "Add-AR...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Tests/Syntax.Tests.ps1
Syntax.Tests.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path | Split-Path -Parent | Join-Path -ChildPath Functions function Measure-String { [cmdletbinding()] Param( [Parameter(ValueFromPipeline)] [string[]]$InputObject , [string]$SearchString , [switch]$SkipComments ) Begin { $...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Tests/Get-ARMparameter.Tests.ps1
Get-ARMparameter.Tests.ps1
#$here = Split-Path -Parent $MyInvocation.MyCommand.Path #$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.' #. "$here\$sut" #Import-Module "C:\Users\tore\Dropbox\SourceTreeRepros\PoshARM\PoshARM.psd1" $modulePath = Split-Path $PSScriptRoot -Parent $modulepath = Join-Path -Path $mod...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Tests/New-ARMfunction.Tests.ps1
New-ARMfunction.Tests.ps1
#$here = Split-Path -Parent $MyInvocation.MyCommand.Path #$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.' #. "$here\$sut" $modulePath = Split-Path $PSScriptRoot -Parent $modulepath = Join-Path -Path $modulePath -ChildPath posharm.psd1 Import-Module $modulePath Describe "New-AR...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Tests/Out-HashString.Tests.ps1
Out-HashString.Tests.ps1
#$here = Split-Path -Parent $MyInvocation.MyCommand.Path #$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.' #. "$here\$sut" $modulePath = Split-Path $PSScriptRoot -Parent $modulepath = Join-Path -Path $modulePath -ChildPath poshARM.psd1 Import-Module $modulePath Describe "Out-Ha...
PowerShellCorpus/PowerShellGallery/posharm/0.1.0.0/Tests/Set-ARMparameter.Tests.ps1
Set-ARMparameter.Tests.ps1
#$here = Split-Path -Parent $MyInvocation.MyCommand.Path #$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.' #. "$here\$sut" $modulePath = Split-Path $PSScriptRoot -Parent $modulepath = Join-Path -Path $modulePath -ChildPath posharm.psd1 Import-Module $modulePath New-ArmTemplate ...
PowerShellCorpus/PowerShellGallery/d00m/1.9.0/d00m.Tests.ps1
d00m.Tests.ps1
$root = Split-path $MyInvocation.MyCommand.Path -Parent Import-Module $root\d00m.psm1 -Force Describe "Get-d00mExcuse" { It "should not throw" { {Get-d00mExcuse} | Should Not Throw } It "should output 1 phrase when count not specified" { (Get-d00mExcuse).Count | ...
PowerShellCorpus/PowerShellGallery/CaaS/3.4.0/CaasCmdAlias.ps1
CaasCmdAlias.ps1
# # Powershell module manifest for the Compute Client for Dimension Data CaaS. # New-Alias New-CaasVM New-CaasServer New-Alias Remove-CaasVM Remove-CaasServer New-Alias Add-CaasNatRule New-CaasNatRule New-Alias Add-CaasAclRule New-CaasAclRule New-Alias Out-CaasWaitForOperation Wait-CaasServerOperation #foll...
PowerShellCorpus/PowerShellGallery/cmlogger/0.1.0/Public/Write-CmLogFile.ps1
Write-CmLogFile.ps1
Function Write-CmLogFile { <# .SYNOPSIS Write CMTrace formated messages to the log file .DESCRIPTION Appends a new line to the log file with the message provided in the parameters and formats the log entry in CMTrace readable format .PARAMETER LogFile Mandatory. Specifies...
PowerShellCorpus/PowerShellGallery/shrinkdadatabase/1.0.3/AppVeyor/AppVeyorBuild.ps1
AppVeyorBuild.ps1
#---------------------------------# # Header # #---------------------------------# Write-Host 'Running AppVeyor build script' -ForegroundColor Yellow Write-Host "ModuleName : $env:ModuleName" Write-Host "Build version : $env:APPVEYOR_BUILD_VERSION" Write-Host "Author : $env:A...
PowerShellCorpus/PowerShellGallery/shrinkdadatabase/1.0.3/AppVeyor/AppVeyorInstall.ps1
AppVeyorInstall.ps1
#---------------------------------# # Header # #---------------------------------# Write-Host 'Running AppVeyor install script' -ForegroundColor Yellow #---------------------------------# # Install NuGet # #---------------------------------# Write-Host 'Installi...
PowerShellCorpus/PowerShellGallery/shrinkdadatabase/1.0.3/AppVeyor/AppVeyorDeploy.ps1
AppVeyorDeploy.ps1
#---------------------------------# # Header # #---------------------------------# Write-Host 'Running AppVeyor deploy script' -ForegroundColor Yellow #---------------------------------# # Update module manifest # #---------------------------------# Write-Host 'Creating ...
PowerShellCorpus/PowerShellGallery/shrinkdadatabase/1.0.3/AppVeyor/AppVeyorTest.ps1
AppVeyorTest.ps1
#---------------------------------# # Header # #---------------------------------# Write-Host 'Running AppVeyor test script' -ForegroundColor Yellow Write-Host "Current working directory: $pwd" #---------------------------------# # Run Pester Tests # #---------------...
PowerShellCorpus/PowerShellGallery/shrinkdadatabase/1.0.3/Tests/PSScriptAnalyzer.Tests.ps1
PSScriptAnalyzer.Tests.ps1
#---------------------------------# # PSScriptAnalyzer tests # #---------------------------------# $Modules = Get-ChildItem “$PSScriptRoot\..\” -Filter ‘*.psm1’ | Where-Object {$_.name -NotMatch ‘Tests.psm’} $Rules = Get-ScriptAnalyzerRule | Where-Object {$_.RuleName -notmatch '(PSUseApprovedVerbs)'} ...
PowerShellCorpus/PowerShellGallery/Microsoft.PowerShell.ODataUtils/1.1.6.0/Microsoft.PowerShell.RedfishAdapter.ps1
Microsoft.PowerShell.RedfishAdapter.ps1
Import-LocalizedData LocalizedData -FileName Microsoft.PowerShell.ODataUtilsStrings.psd1 # Add .NET classes used by the module if ($PSEdition -eq "Core") { Add-Type -TypeDefinition $global:BaseClassDefinitions -ReferencedAssemblies @([System.Collections.ArrayList].Assembly.Location,[System.Management.Automatio...
PowerShellCorpus/PowerShellGallery/Microsoft.PowerShell.ODataUtils/1.1.6.0/Microsoft.PowerShell.ODataV4Adapter.ps1
Microsoft.PowerShell.ODataV4Adapter.ps1
Import-LocalizedData LocalizedData -FileName Microsoft.PowerShell.ODataUtilsStrings.psd1 # Add .NET classes used by the module Add-Type -TypeDefinition $global:BaseClassDefinitions ######################################################### # Generates PowerShell module containing client side # proxy cmdlets th...
PowerShellCorpus/PowerShellGallery/Microsoft.PowerShell.ODataUtils/1.1.6.0/Microsoft.PowerShell.ODataUtilsHelper.ps1
Microsoft.PowerShell.ODataUtilsHelper.ps1
# Base class definitions used by the actual Adapter modules $global:BaseClassDefinitions = @" using System; namespace ODataUtils { public class TypeProperty { public String Name; // OData Type Name, e.g. Edm.Int32 public String TypeName; public bool IsKey; ...
PowerShellCorpus/PowerShellGallery/Microsoft.PowerShell.ODataUtils/1.1.6.0/Microsoft.PowerShell.ODataAdapter.ps1
Microsoft.PowerShell.ODataAdapter.ps1
Import-LocalizedData LocalizedData -FileName Microsoft.PowerShell.ODataUtilsStrings.psd1 # Add .NET classes used by the module Add-Type -TypeDefinition $global:BaseClassDefinitions ######################################################### # Generates PowerShell module containing client side # proxy cmdlets ...
PowerShellCorpus/PowerShellGallery/CMClient/1.3/Get-CMClientUpdates.ps1
Get-CMClientUpdates.ps1
#region Get-CMClientUpdates <# .SYNOPSIS This function gets a list of software updates for a SCCM client. .DESCRIPTION .PARAMETER Computername The name of the system you'd like to invoke the action on .EXAMPLE PS C:\> Get-CMClientUpdates -Computername 'SERVER01' .EXAMPLE PS C:\> Get-CMClientUpdates ...
PowerShellCorpus/PowerShellGallery/CMClient/1.3/Invoke-CMClientUpdateScan.ps1
Invoke-CMClientUpdateScan.ps1
#region Invoke-CMClientUpdateScan <# .SYNOPSIS This function invokes an update scan eval on a ConfigMgr client .DESCRIPTION .PARAMETER Computername The name of the system you'd like to invoke the action on .PARAMETER AsJob Specify this parameter if you'd like to run this as a background job. .EXAMPLE ...
PowerShellCorpus/PowerShellGallery/CMClient/1.3/Invoke-CMClientBaselineEvaluation.ps1
Invoke-CMClientBaselineEvaluation.ps1
<# .Synopsis Initiate the evaluation of Configuration Manager client configuration baselines. .DESCRIPTION Initiate the evaluation of Configuration Manager client configuration baselines. .NOTES Created by: Jason Wasser @wasserja Modified: 5/17/2017 04:09:20 PM .EXAMPLE Invoke-CMClientBaseli...
PowerShellCorpus/PowerShellGallery/CMClient/1.3/Get-CMClientBaselineEvaluation.ps1
Get-CMClientBaselineEvaluation.ps1
<# .Synopsis Get the status of Configuration Manager client configuration baselines. .DESCRIPTION Get the status of Configuration Manager client configuration baselines. .NOTES Created by: Jason Wasser @wasserja Modified: 5/17/2017 04:05:12 PM .EXAMPLE Get-CMClientBaselineEvaluation Compute...
PowerShellCorpus/PowerShellGallery/CMClient/1.3/Invoke-CMClientApplicationDeploymentEvaluation.ps1
Invoke-CMClientApplicationDeploymentEvaluation.ps1
#region Invoke-CMClientApplicationDeploymentEvaluation <# .SYNOPSIS This function invokes an application deployment eval on a ConfigMgr client .DESCRIPTION .PARAMETER Computername The name of the system you'd like to invoke the action on .PARAMETER AsJob Specify this parameter if you'd like to run this a...
PowerShellCorpus/PowerShellGallery/CMClient/1.3/Invoke-CMClientUpdateDeploymentEvaluation.ps1
Invoke-CMClientUpdateDeploymentEvaluation.ps1
#region Invoke-CMClientUpdateDeploymentEvaluation <# .SYNOPSIS This function invokes an update deployment eval on a ConfigMgr client .DESCRIPTION .PARAMETER Computername The name of the system you'd like to invoke the action on .PARAMETER AsJob Specify this parameter if you'd like to run this as a backgr...
PowerShellCorpus/PowerShellGallery/CMClient/1.3/Invoke-CMClientJob.ps1
Invoke-CMClientJob.ps1
#region Initialize-CMClientJob <# .SYNOPSIS This is a helper function that starts and manages background jobs for the all functions in this module. .DESCRIPTION .PARAMETER OriginatingFunction The function where the job request came from. This is used to keep track of which background jobs were started b...
PowerShellCorpus/PowerShellGallery/CMClient/1.3/Invoke-CMClientHardwareInventory.ps1
Invoke-CMClientHardwareInventory.ps1
#region Invoke-CMClientHardwareInventory <# .SYNOPSIS This function invokes a hardware inventory cycle on a ConfigMgr client .DESCRIPTION .PARAMETER Computername The name of the system you'd like to invoke the action on .PARAMETER AsJob Specify this parameter if you'd like to run this as a background job...
PowerShellCorpus/PowerShellGallery/CMClient/1.3/Invoke-CMClientDiscoveryDataCycle.ps1
Invoke-CMClientDiscoveryDataCycle.ps1
#region Invoke-CMClientDiscoveryDataCycle <# .SYNOPSIS This function invokes a DDR cycle on a ConfigMgr client .DESCRIPTION .PARAMETER Computername The name of the system you'd like to invoke the action on .PARAMETER AsJob Specify this parameter if you'd like to run this as a background job. .EXAMPLE ...
PowerShellCorpus/PowerShellGallery/CMClient/1.3/Invoke-CMClientAction.ps1
Invoke-CMClientAction.ps1
#region Invoke-CMClientAction <# .SYNOPSIS This is a helper function that initiates many ConfigMgr client actions. .DESCRIPTION .PARAMETER Computername The system you'd like to initate the action on. .PARAMETER AsJob A switch parameter that initates a job in the background .PARAMETER ClientAction The...
PowerShellCorpus/PowerShellGallery/CMClient/1.3/Invoke-CMClientSoftwareInventory.ps1
Invoke-CMClientSoftwareInventory.ps1
#region Invoke-CMClientSoftwareInventory <# .SYNOPSIS This function invokes a software inventory scan on a ConfigMgr client .DESCRIPTION .PARAMETER Computername The name of the system you'd like to invoke the action on .PARAMETER AsJob Specify this parameter if you'd like to run this as a background job....
PowerShellCorpus/PowerShellGallery/CMClient/1.3/Invoke-CMClientMachinePolicyDownload.ps1
Invoke-CMClientMachinePolicyDownload.ps1
#region Invoke-CMClientMachinePolicyDownload <# .SYNOPSIS This function invokes a machine policy download on a ConfigMgr client .DESCRIPTION .PARAMETER Computername The name of the system you'd like to invoke the machine policy download on .PARAMETER AsJob Specify this parameter if you'd like to run this...
PowerShellCorpus/PowerShellGallery/CMClient/1.3/Invoke-CMClientAdvancedFunctions.ps1
Invoke-CMClientAdvancedFunctions.ps1
## Modify these function as advanced functions <# Function Set-CMClientBusinessHours ($ComputerName, $StartTime = 3, $EndTime = 7, $WorkingDays) { ## The first digit is the start time (7am), the second digit is the end time (7pm) and the third digit is the days of the week. ## The days of the week are calculated ...
PowerShellCorpus/PowerShellGallery/CMClient/1.3/Get-CMClientPendingUpdates.ps1
Get-CMClientPendingUpdates.ps1
#region Get-CMClientPendingUpdates <# .SYNOPSIS This function gets a list of pending software updates for a SCCM client. .DESCRIPTION .PARAMETER Computername The name of the system you'd like to invoke the action on .EXAMPLE PS C:\> Get-CMClientPendingUpdates -Computername 'SERVER01' .EXAMPLE PS C:\...
PowerShellCorpus/PowerShellGallery/CMClient/1.3/Get-CMClientDeviceCollectionMembership.ps1
Get-CMClientDeviceCollectionMembership.ps1
<# .SYNOPSIS Get the collection membership of a configuration manager client device or computer. .DESCRIPTION Get the collection membership of a configuration manager client device or computer. This function will query System Center Configuration manager for a given computer name and return the collections for ...
PowerShellCorpus/PowerShellGallery/CMClient/1.3/Invoke-CMClientComplianceEvaluation.ps1
Invoke-CMClientComplianceEvaluation.ps1
#region Invoke-CMClientComplianceEvaluation <# .SYNOPSIS This function invokes a compliance evaluation on a ConfigMgr client .DESCRIPTION .PARAMETER Computername The name of the system you'd like to invoke the action on .PARAMETER AsJob Specify this parameter if you'd like to run this as a background job...
PowerShellCorpus/PowerShellGallery/PSADSync/1.0.85/PSADSync.Tests.ps1
PSADSync.Tests.ps1
,#region import modules $ThisModule = "$($MyInvocation.MyCommand.Path -replace '\.Tests\.ps1$', '').psd1" $ThisModuleName = (($ThisModule | Split-Path -Leaf) -replace '\.psd1') Get-Module -Name $ThisModuleName -All | Remove-Module -Force Import-Module -Name $ThisModule -Force -ErrorAction Stop #endregion describe 'Mo...
PowerShellCorpus/PowerShellGallery/SpectrumControlBase-Client/1.0.0.46/SpectrumControlBase-Client.Sample.ps1
SpectrumControlBase-Client.Sample.ps1
############################################################################## # # # Licensed Materials - Property of IBM # # # ...
PowerShellCorpus/PowerShellGallery/PowerShellCookbook/1.3.6/Inventory.ps1
Inventory.ps1
############################################################################## ## ## Inventory ## ## From Windows PowerShell Cookbook (O'Reilly) ## by Lee Holmes (http://www.leeholmes.com/guide) ## ############################################################################## <# .SYNOPSIS Serves as the ...
PowerShellCorpus/PowerShellGallery/PowerShellCookbook/1.3.6/TabExpansion.ps1
TabExpansion.ps1
############################################################################## ## ## TabExpansion2 ## ## From Windows PowerShell Cookbook (O'Reilly) ## by Lee Holmes (http://www.leeholmes.com/guide) ## ############################################################################## function TabExpansion2 { ...
PowerShellCorpus/PowerShellGallery/PowerShellCookbook/1.3.6/VerifyCategoryRule.ps1
VerifyCategoryRule.ps1
## From Windows PowerShell Cookbook (O'Reilly) ## by Lee Holmes (http://www.leeholmes.com/guide) Set-StrictMode -Version 3 if($message.Body -match "book") { [Console]::WriteLine("This is a message about the book.") } else { [Console]::WriteLine("This is an unknown message.") }
PowerShellCorpus/PowerShellGallery/PowerShellCookbook/1.3.6/LibraryDirectory.ps1
LibraryDirectory.ps1
## From Windows PowerShell Cookbook (O'Reilly) ## by Lee Holmes (http://www.leeholmes.com/guide) Set-StrictMode -Version 3 ## Get the size of all the items in the current directory function Get-DirectorySize { <# .EXAMPLE PS > $DebugPreference = "Continue" PS > Get-DirectorySize DE...
PowerShellCorpus/PowerShellGallery/PowerShellCookbook/1.3.6/LibraryPrompt.ps1
LibraryPrompt.ps1
############################################################################## ## ## From Windows PowerShell Cookbook (O'Reilly) ## by Lee Holmes (http://www.leeholmes.com/guide) ## ############################################################################## Set-StrictMode -Version 3 function Prompt { ...