full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Examples/Sample_xServiceSet.ps1
Sample_xServiceSet.ps1
# Starts a set of existing stopped services Configuration xServiceSetExample { param ( [String[]] $StoppedServiceNames ) Import-DscResource -ModuleName xPSDesiredStateConfiguration xServiceSet ServiceSet1 { Name = $StoppedServiceNames Ensure = "Presen...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Examples/Sample_xProcessSet.ps1
Sample_xProcessSet.ps1
Configuration xProcessSetExample { Import-DscResource -ModuleName xPSDesiredStateConfiguration xProcessSet ProcessSet1 { Path = @("C:\Windows\System32\cmd.exe", "C:\Windows\System32\Notepad.exe") Ensure = "Present" } }
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Examples/Test_Sample_xArchive_ExpandArchive.ps1
Test_Sample_xArchive_ExpandArchive.ps1
$zipFilePath = "$pwd\SampleArchive.zip" $expandedZipDir = "$pwd\TargetExpanded" del "$pwd\SourceDir" -Force -Recurse -ErrorAction SilentlyContinue del "$zipFilePath" -Force -Recurse -ErrorAction SilentlyContinue New-Item $pwd\SourceDir -Type Directory | Out-Null New-Item $pwd\SourceDir\Sample-1.txt -Type Fil...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Examples/Sample_xEnvironment.ps1
Sample_xEnvironment.ps1
Configuration xEnvironmentExample { param () Import-DscResource -ModuleName xPSDesiredStateConfiguration xEnvironment EnvironmentExample { Ensure = "Present" # You can also set Ensure to "Absent" Name = "TestEnvironmentVariable" Value = "TestValue" } }
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Examples/Sample_xDscWebServiceRemoval.ps1
Sample_xDscWebServiceRemoval.ps1
# DSC configuration for removal of Pull Server and Compliance Server configuration Sample_xDscWebService { param ( [string[]]$NodeName = 'localhost' ) Import-DSCResource -ModuleName xPSDesiredStateConfiguration Node $NodeName { WindowsFeature DSCServiceFeature ...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Examples/Sample_xWindowsFeatureSet.ps1
Sample_xWindowsFeatureSet.ps1
<# .SYNOPSIS Installs the set of features named with all their subfeatures from the specified source. #> Configuration $configurationName { param ( [Parameter(Mandatory = $true)] [String[]] $FeatureNames, [Parameter(Mandatory = $true)] [String] $...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Examples/Sample_xRemoteFileUsingProxy.ps1
Sample_xRemoteFileUsingProxy.ps1
configuration Sample_xRemoteFile_DownloadFileUsingProxy { param ( [string[]] $nodeName = 'localhost', [parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [String] $destinationPath, [parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] ...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Examples/Sample_xService_DeleteService.ps1
Sample_xService_DeleteService.ps1
Configuration Sample_xService_DeleteService { param ( [string[]] $nodeName = 'localhost', [System.String] $Name, [System.String] [ValidateSet("Automatic", "Manual", "Disabled")] $StartupType, [System.String] [Va...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Examples/Sample_xArchive_CompressArchive.ps1
Sample_xArchive_CompressArchive.ps1
Configuration Sample_xArchive_CompressArchive { param ( [parameter(mandatory=$true)] [ValidateNotNullOrEmpty()] [string[]] $Path, [parameter (mandatory=$true)] [ValidateNotNullOrEmpty()] [string] $Destination, [parameter (mandatory=$false...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Examples/Sample_xWindowsProcess_EnsureAbsentWithCredential.ps1
Sample_xWindowsProcess_EnsureAbsentWithCredential.ps1
Configuration Sample_xWindowsProcess_EnsureAbsentWithCredential { param ( [pscredential]$cred = (Get-Credential) ) Import-DSCResource -ModuleName xPSDesiredStateConfiguration Node localhost { xWindowsProcess Notepad { Path = "C:\Windows\System32\Not...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Examples/Sample_xRemoteFile.ps1
Sample_xRemoteFile.ps1
configuration Sample_xRemoteFile_DownloadFile { param ( [string[]] $nodeName = 'localhost', [parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [String] $destinationPath, [parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [String...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Examples/Sample_xWindowsFeature.ps1
Sample_xWindowsFeature.ps1
Configuration xWindowsFeatureExample { Import-DSCResource -ModuleName xPSDesiredStateConfiguration xWindowsFeature RoleExample { Ensure = "Present" # Alternatively, to ensure the role is uninstalled, set Ensure to "Absent" Name = "Web-Server" # Use the Name property from Get-WindowsF...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Examples/Sample_xScript.ps1
Sample_xScript.ps1
Configuration xScriptExample { Import-DscResource -ModuleName xPSDesiredStateConfiguration xScript ScriptExample { SetScript = { $sw = New-Object System.IO.StreamWriter("C:\TempFolder\TestFile.txt") $sw.WriteLine("Some sample string") $sw.Close() ...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Examples/Sample_xService_ServiceWithCredential.ps1
Sample_xService_ServiceWithCredential.ps1
Configuration Sample_xService_ServiceWithCredential { param ( [string[]] $nodeName = 'localhost', [System.String] $Name, [System.String] [ValidateSet("Automatic", "Manual", "Disabled")] $StartupType="Automatic", [System....
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Examples/Sample_xWindowsProcess_ArgumentsWithCredential.ps1
Sample_xWindowsProcess_ArgumentsWithCredential.ps1
Configuration Sample_xWindowsProcess_ArgumentsWithCredential { param ( [pscredential]$cred = (Get-Credential) ) Import-DSCResource -ModuleName xPSDesiredStateConfiguration Node localhost { xWindowsProcess powershell { Path = "C:\Windows\System32\Win...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Examples/Sample_xService_CreateService.ps1
Sample_xService_CreateService.ps1
Configuration Sample_xService_CreateService { param ( [string[]] $nodeName = 'localhost', [System.String] $Name, [System.String] [ValidateSet("Automatic", "Manual", "Disabled")] $StartupType="Automatic", [System.String] ...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Examples/Sample_xDscWebService.ps1
Sample_xDscWebService.ps1
# DSC configuration for Pull Server # Prerequisite: Certificate "CN=PSDSCPullServerCert" in "CERT:\LocalMachine\MY\" store for SSL # Prerequisite: $RegistrationKey value generated using ([guid]::NewGuid()).Guid # Note: A Certificate may be generated using MakeCert.exe: http://msdn.microsoft.com/en-us/library/windows...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Examples/Sample_xWindowsProcess_WithCredential.ps1
Sample_xWindowsProcess_WithCredential.ps1
Configuration Sample_xWindowsProcess_WithCredential { param ( [pscredential]$cred = (Get-Credential) ) Import-DSCResource -ModuleName xPSDesiredStateConfiguration Node localhost { xWindowsProcess Notepad { Path = "C:\Windows\System32\Notepad.exe" ...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Examples/Sample_xDscWebServiceRegistration.ps1
Sample_xDscWebServiceRegistration.ps1
# DSC configuration for Pull Server # Prerequisite: Certificate "CN=PSDSCPullServerCert" in "CERT:\LocalMachine\MY\" store # Note: A Certificate may be generated using MakeCert.exe: http://msdn.microsoft.com/en-us/library/windows/desktop/aa386968%28v=vs.85%29.aspx # This version sets the RegistrationKeyPath which is...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Examples/Sample_xWindowsOptionalFeatureSet.ps1
Sample_xWindowsOptionalFeatureSet.ps1
# Installs the Windows optional features 'MicrosoftWindowsPowerShellV2' and 'Internet-Explorer-Optional-amd64' Configuration xWindowsOptionalFeatureSetExample { param ( [Parameter(Mandatory = $true)] [String] $LogPath ) Import-DscResource -ModuleName xPSDesiredStateConfig...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Examples/Sample_xUser.ps1
Sample_xUser.ps1
Configuration xUserExample { param ( [System.Management.Automation.PSCredential] $PasswordCredential ) Import-DscResource -ModuleName xPSDesiredStateConfiguration xUser xUserExample { Ensure = "Present" # To ensure the user account does not exist, set Ensure to ...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Examples/Sample_xArchive_CompressMultipleDirs.ps1
Sample_xArchive_CompressMultipleDirs.ps1
Configuration Sample_xArchive_CompressMultipleDirs { param ( [parameter(mandatory=$true)] [ValidateNotNullOrEmpty()] [string[]] $Path, [parameter (mandatory=$true)] [ValidateNotNullOrEmpty()] [string] $Destination, [parameter (mandatory=$...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Examples/Sample_xArchive_ExpandArchive.ps1
Sample_xArchive_ExpandArchive.ps1
Configuration Sample_xArchive_ExpandArchive { param ( [parameter(mandatory=$true)] [ValidateNotNullOrEmpty()] [string[]] $Path, [parameter (mandatory=$true)] [ValidateNotNullOrEmpty()] [string] $Destination, [parameter (mandatory=$false)]...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Examples/Sample_xPSSessionConfiguration.ps1
Sample_xPSSessionConfiguration.ps1
configuration Sample_xPSEndpoint_NewWithDefaults { param ( [Parameter(Mandatory)] [String]$Name ) Import-DscResource -module xPSDesiredStateConfiguration xPSEndpoint PSSessionConfiguration { Name = $Name Ensure = 'Present' } } configuration...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Examples/Sample_xGroupSet.ps1
Sample_xGroupSet.ps1
Configuration xGroupSetExample { Import-DscResource -ModuleName xPSDesiredStateConfiguration xGroupSet xGroupSet1 { GroupName = @('MyGroup1', 'MyGroup2', 'MyGroup3') Ensure = "Present" MembersToInclude = @('Member1', 'Member2') } }
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Examples/Test_Sample_xArchive_CompressArchive.ps1
Test_Sample_xArchive_CompressArchive.ps1
$zipFilePath = "$pwd\Target.zip" del "$pwd\Sample-1.txt" -Force -Recurse -ErrorAction SilentlyContinue del "$pwd\Sample-2.txt" -Force -Recurse -ErrorAction SilentlyContinue del "$pwd\Sample-3.txt" -Force -Recurse -ErrorAction SilentlyContinue del "$pwd\SourceDir-1" -Force -Recurse -ErrorAction SilentlyContinue ...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Examples/Sample_xFileUpload.ps1
Sample_xFileUpload.ps1
Configuration FileUploadConfiguration { param ( [parameter(Mandatory = $true)] [String] $destinationPath, [parameter(Mandatory = $true)] [String] $sourcePath, [PSCredential] $credential, [String] $certificateThumbprint ) Import-DscResource -modulename xPSDesiredStateConfiguration no...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Examples/PullServerDeploymentVerificationTest/PullServerSetupTests.ps1
PullServerSetupTests.ps1
<# * * Once you setup your pullserver(V2), run the following set of tests on the pullserver machine to verify if the pullserver is setup properly and ready to go. * This test assumes default values are used during deployment for the location of web.config and pull server URL. * If default values are not used...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/ResourceDesignerScripts/New-PSSessionConfigurationResource.ps1
New-PSSessionConfigurationResource.ps1
ipmo xDSCResourceDesigner $resProperties = @{ Name = New-xDscResourceProperty -Description 'Name of the PS Remoting Endpoint' ` -Name Name -Type String -Attribute Key RunAsCred = New-xDscResourceProperty -Description 'Credential for Running under d...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/ResourceDesignerScripts/GenerateXRemoteFileSchema.ps1
GenerateXRemoteFileSchema.ps1
$DestinationPath = New-xDscResourceProperty -Name DestinationPath -Type String -Attribute Key -Description 'Path under which downloaded or copied file should be accessible after operation.' $Uri = New-xDscResourceProperty -Name Uri -Type String -Attribute Required -Description 'Uri of a file which should be copied or ...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Tests/MSFT_xRegistryResource.Tests.ps1
MSFT_xRegistryResource.Tests.ps1
$ErrorActionPreference = 'Stop' Get-Module MSFT_xRegistryResource | Remove-Module -Force Import-Module $PSScriptRoot\..\DSCResources\MSFT_xRegistryResource\MSFT_xRegistryResource.psm1 -Prefix UnitTest Describe 'MSFT_xRegistryResource' { BeforeAll { $rootPath = 'Software\__MSFT_xRegistryResource__' ...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Tests/MSFT_xPackageResource.tests.ps1
MSFT_xPackageResource.tests.ps1
<# .summary Test suite for MSFT_xPackageResource.psm1 #> [CmdletBinding()] param() Import-Module $PSScriptRoot\..\DSCResources\MSFT_xPackageResource\MSFT_xPackageResource.psm1 $ErrorActionPreference = 'stop' Set-StrictMode -Version latest function Suite.BeforeAll { # Remove any leftovers from...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Tests/Unit/MSFT_xServiceResource.Tests.ps1
MSFT_xServiceResource.Tests.ps1
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")] param () Import-Module "$PSScriptRoot\..\..\DSCResource.Tests\TestHelper.psm1" -Force $TestEnvironment = Initialize-TestEnvironment ` -DSCModuleName 'xPSDesiredStateConfiguration' ` -DSCResourceNam...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Tests/Unit/MSFT_xScriptResource.Tests.ps1
MSFT_xScriptResource.Tests.ps1
# All tests with credentials will be skipped $TestEnvironment = Initialize-TestEnvironment ` -DSCModuleName 'xPSDesiredStateConfiguration' ` -DSCResourceName 'MSFT_xScriptResource' ` -TestType Unit InModuleScope 'MSFT_xScriptResource' { Describe 'xScript Unit Tests' { BeforeAll { ...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Tests/Unit/MSFT_xEnvironmentResource.Tests.ps1
MSFT_xEnvironmentResource.Tests.ps1
# These tests must be run with elevated access $TestEnvironment = Initialize-TestEnvironment ` -DSCModuleName 'xPSDesiredStateConfiguration' ` -DSCResourceName 'MSFT_xEnvironmentResource' ` -TestType Unit InModuleScope 'MSFT_xEnvironmentResource' { function Get-EnvironmentVariable { ...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Tests/Unit/MSFT_xWindowsFeature.Tests.ps1
MSFT_xWindowsFeature.Tests.ps1
# These tests use a mock server module. They will fail on an actual server. # All tests that require a credential will be skipped Initialize-TestEnvironment ` -DSCModuleName 'xPSDesiredStateConfiguration' ` -DSCResourceName 'MSFT_xWindowsFeature' ` -TestType Unit ` | Out-Null InModuleScope 'M...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Tests/Unit/MSFT_xRemoteFile.Tests.ps1
MSFT_xRemoteFile.Tests.ps1
$Global:DSCModuleName = 'xPSDesiredStateConfiguration' $Global:DSCResourceName = 'MSFT_xRemoteFile' #region HEADER # Unit Test Template Version: 1.1.0 [String] $moduleRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path)) if ( (-not (Test-Path -Path (Join-...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Tests/Unit/MSFT_xWindowsOptionalFeature.Tests.ps1
MSFT_xWindowsOptionalFeature.Tests.ps1
$Global:DSCModuleName = 'xPSDesiredStateConfiguration' $Global:DSCResourceName = 'MSFT_xWindowsOptionalFeature' #region HEADER if ( (-not (Test-Path -Path '.\DSCResource.Tests\')) -or ` (-not (Test-Path -Path '.\DSCResource.Tests\TestHelper.psm1')) ) { & git @('clone','https://github.com/PowerS...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Tests/Unit/MSFT_xUserResource.Tests.ps1
MSFT_xUserResource.Tests.ps1
#To run these tests, the currently logged on user must have rights to create a user [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")] param () $TestEnvironment = Initialize-TestEnvironment ` -DSCModuleName 'xPSDesiredStateConfiguration' ` -DSCResour...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Tests/Unit/MSFT_xArchive.Tests.ps1
MSFT_xArchive.Tests.ps1
Import-Module "$PSScriptRoot\..\..\DscResource.Tests\TestHelper.psm1" -Force $TestEnvironment = Initialize-TestEnvironment ` -DSCModuleName 'xPSDesiredStateConfiguration' ` -DSCResourceName 'MSFT_xArchive' ` -TestType Unit InModuleScope 'MSFT_xArchive' { Describe 'xArchive Unit Tests' { ...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Tests/Unit/MSFT_xGroupResource.Tests.ps1
MSFT_xGroupResource.Tests.ps1
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingConvertToSecureStringWithPlainText', '')] param () Import-Module "$PSScriptRoot\..\..\DSCResource.Tests\TestHelper.psm1" -Force Initialize-TestEnvironment ` -DSCModuleName 'xPSDesiredStateConfiguration' ` -DSCResourceName 'MSFT_xGroupResou...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Tests/Integration/MSFT_xGroupSet.Tests.ps1
MSFT_xGroupSet.Tests.ps1
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")] param () $TestEnvironment = Initialize-TestEnvironment ` -DSCModuleName 'xPSDesiredStateConfiguration' ` -DSCResourceName 'MSFT_xGroupSet' ` -TestType Integration Describe "xGroupSet Integrat...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Tests/Integration/MSFT_xServiceSet.Tests.ps1
MSFT_xServiceSet.Tests.ps1
$TestEnvironment = Initialize-TestEnvironment ` -DSCModuleName 'xPSDesiredStateConfiguration' ` -DSCResourceName 'MSFT_xServiceSet' ` -TestType Integration Describe "xServiceSet Integration Tests" { BeforeAll { Import-Module "$PSScriptRoot\..\MSFT_xServiceResource.TestHelper.psm1" ...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Tests/Integration/MSFT_xRemoteFile.config.ps1
MSFT_xRemoteFile.config.ps1
$TestConfigPath = Join-Path -Path $PSScriptRoot -ChildPath "MSFT_xRemoteFile.config.ps1" $TestURI = "file://$TestConfigPath" $TestDestinationPath = Join-Path -Path $ENV:Temp -ChildPath "MSFT_xRemoteFile.config.ps1" # Integration Test Config Template Version: 1.0.0 configuration MSFT_xRemoteFile_config { Impo...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Tests/Integration/MSFT_xWindowsOptionalFeatureSet.Tests.ps1
MSFT_xWindowsOptionalFeatureSet.Tests.ps1
$TestEnvironment = Initialize-TestEnvironment ` -DSCModuleName 'xPSDesiredStateConfiguration' ` -DSCResourceName 'MSFT_xWindowsOptionalFeatureSet' ` -TestType Integration Describe "xWindowsOptionalFeatureSet Integration Tests" { It "Install two valid Windows optional features" { $configu...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Tests/Integration/MSFT_xRemoteFile.Tests.ps1
MSFT_xRemoteFile.Tests.ps1
$Global:DSCModuleName = 'xPSDesiredStateConfiguration' # Example xNetworking $Global:DSCResourceName = 'MSFT_xRemoteFile' # Example MSFT_xFirewall #region HEADER # Integration Test Template Version: 1.1.0 [String] $moduleRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocat...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Tests/Integration/MSFT_xWindowsFeatureSet.Tests.ps1
MSFT_xWindowsFeatureSet.Tests.ps1
$TestEnvironment = Initialize-TestEnvironment ` -DSCModuleName 'xPSDesiredStateConfiguration' ` -DSCResourceName 'MSFT_xWindowsFeatureSet' ` -TestType Integration Describe "xWindowsFeatureSet Integration Tests" { It "Prepare to install a set of Windows features with their sub features" { ...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Tests/Integration/MSFT_xDSCWebService.xxx.ps1
MSFT_xDSCWebService.xxx.ps1
###################################################################################### # Integration Tests for DSC Resource xDSCWebService # # There tests will make changes to your system, we are tyring to roll them back, # but you never know. Best to run this on a throwaway VM. # Run as an elevated administrator...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xPSDesiredStateConfiguration/3.11.0.0/Tests/Integration/MSFT_xProcessSet.Tests.ps1
MSFT_xProcessSet.Tests.ps1
$TestEnvironment = Initialize-TestEnvironment ` -DSCModuleName 'xPSDesiredStateConfiguration' ` -DSCResourceName 'MSFT_xProcessSet' ` -TestType Integration Describe "xProcessSet Integration Tests" { BeforeAll { Import-Module "$PSScriptRoot\..\Unit\MSFT_xProcessResource.TestHelper.psm1" -...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xActiveDirectory/2.12.0.0/Assert-HADC.ps1
Assert-HADC.ps1
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")] param () # A configuration to Create High Availability Domain Controller $secpasswd = ConvertTo-SecureString "Adrumble@6" -AsPlainText -Force $domainCred = New-Object System.Management.Automation.PSCredent...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xActiveDirectory/2.12.0.0/Assert-ParentChildDomains.ps1
Assert-ParentChildDomains.ps1
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")] param () $secpasswd = ConvertTo-SecureString "Adrumble@6" -AsPlainText -Force $domainCred = New-Object System.Management.Automation.PSCredential ("sva-dscdom\Administrator", $secpasswd) $safemodeAdministrator...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xActiveDirectory/2.12.0.0/Misc/New-ADDomainTrust.ps1
New-ADDomainTrust.ps1
$Properties = @{ SourceDomain = New-xDscResourceProperty -Name SourceDomainName -Type String -Attribute Key ` -Description 'Name of the AD domain that is requesting the trust' TargetDomain = New-xDscResourceProperty -Nam...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xActiveDirectory/2.12.0.0/DSCResources/MSFT_xADRecycleBin/Examples/xActiveDirectory_xADRecycleBin.ps1
xActiveDirectory_xADRecycleBin.ps1
Configuration Example_xADRecycleBin { Param( [parameter(Mandatory = $true)] [System.String] $ForestFQDN, [parameter(Mandatory = $true)] [System.Management.Automation.PSCredential] $EACredential ) Import-DscResource -Module xActiveDirectory Node $AllNodes.NodeName {...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xActiveDirectory/2.12.0.0/DSCResources/MSFT_xADRecycleBin/ResourceDesignerScripts/GeneratexADRecycleBinSchema.ps1
GeneratexADRecycleBinSchema.ps1
New-xDscResource -Name MSFT_xADRecycleBin -FriendlyName xADRecycleBin -ModuleName xActiveDirectory -Path . -Force -Property @( New-xDscResourceProperty -Name ForestFQDN -Type String -Attribute Key New-xDscResourceProperty -Name EnterpriseAdministratorCredential -Type PSCredential -Attribute Required New-...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xActiveDirectory/2.12.0.0/DSCResources/MSFT_xADCommon/MSFT_xADCommon.ps1
MSFT_xADCommon.ps1
data localizedString { # culture="en-US" ConvertFrom-StringData @' RoleNotFoundError = Please ensure that the PowerShell module for role '{0}' is installed MembersAndIncludeExcludeError = The '{0}' and '{1}' and/or '{2}' parameters conflict. The '{0}' parameter should not be u...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xActiveDirectory/2.12.0.0/Tests/Unit/MSFT_xADDomain.Tests.ps1
MSFT_xADDomain.Tests.ps1
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")] param () $Global:DSCModuleName = 'xActiveDirectory' # Example xNetworking $Global:DSCResourceName = 'MSFT_xADDomain' # Example MSFT_xFirewall #region HEADER [String] $moduleRoot = Split-Path -Paren...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xActiveDirectory/2.12.0.0/Tests/Unit/MSFT_xWaitForADDomain.Tests.ps1
MSFT_xWaitForADDomain.Tests.ps1
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")] param () $Global:DSCModuleName = 'xActiveDirectory' $Global:DSCResourceName = 'MSFT_xWaitForADDomain' #region HEADER [String] $moduleRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Paren...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xActiveDirectory/2.12.0.0/Tests/Unit/MSFT_xADCommon.Tests.ps1
MSFT_xADCommon.Tests.ps1
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")] param () $Global:DSCModuleName = 'xActiveDirectory' # Example xNetworking $Global:DSCResourceName = 'MSFT_xADCommon' # Example MSFT_xFirewall #region HEADER [String] $moduleRoot = Split-Path -Paren...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xActiveDirectory/2.12.0.0/Tests/Unit/MSFT_xADComputer.Tests.ps1
MSFT_xADComputer.Tests.ps1
$Global:DSCModuleName = 'xActiveDirectory' # Example xNetworking $Global:DSCResourceName = 'MSFT_xADComputer' # Example MSFT_xFirewall #region HEADER # Unit Test Template Version: 1.1.0 [String] $moduleRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path)) ...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xActiveDirectory/2.12.0.0/Tests/Unit/MSFT_xADOrganizationalUnit.Tests.ps1
MSFT_xADOrganizationalUnit.Tests.ps1
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")] param () $Global:DSCModuleName = 'xActiveDirectory' # Example xNetworking $Global:DSCResourceName = 'MSFT_xADOrganizationalUnit' # Example MSFT_xFirewall #region HEADER [String] $moduleRoot = Split...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xActiveDirectory/2.12.0.0/Tests/Unit/MSFT_xADGroup.Tests.ps1
MSFT_xADGroup.Tests.ps1
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")] param () $Global:DSCModuleName = 'xActiveDirectory' # Example xNetworking $Global:DSCResourceName = 'MSFT_xADGroup' # Example MSFT_xFirewall #region HEADER [String] $moduleRoot = Split-Path -Parent...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xActiveDirectory/2.12.0.0/Tests/Unit/MSFT_xADUser.Tests.ps1
MSFT_xADUser.Tests.ps1
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")] param () $Global:DSCModuleName = 'xActiveDirectory' # Example xNetworking $Global:DSCResourceName = 'MSFT_xADUser' # Example MSFT_xFirewall #region HEADER [String] $moduleRoot = Split-Path -Parent ...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xActiveDirectory/2.12.0.0/Tests/Unit/MSFT_xADDomainDefaultPasswordPolicy.Tests.ps1
MSFT_xADDomainDefaultPasswordPolicy.Tests.ps1
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")] param () $Global:DSCModuleName = 'xActiveDirectory' # Example xNetworking $Global:DSCResourceName = 'MSFT_xADDomainDefaultPasswordPolicy' # Example MSFT_xFirewall #region HEADER [String] $moduleRoo...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xStorage/2.6.0.0/tests/unit/MSFT_xDisk.tests.ps1
MSFT_xDisk.tests.ps1
<# .Synopsis Unit tests for xDisk .DESCRIPTION Unit tests for xDisk .NOTES Code in HEADER and FOOTER regions are standard and may be moved into DSCResource.Tools in Future and therefore should not be altered if possible. #> $Global:DSCModuleName = 'xDisk' # Example xNetworking $Global:DSC...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xStorage/2.6.0.0/Resources/xDscResourceDesigner_CreateScript.ps1
xDscResourceDesigner_CreateScript.ps1
$modules = 'C:\Program Files\WindowsPowerShell\Modules\' $modulename = 'xDiskImage' $Description = 'This module is used to mount ISO or VHD files as local disks.' if (!(test-path (join-path $modules $modulename))) { $modulefolder = mkdir (join-path $modules $modulename) New-ModuleManifest -Path (join-p...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xStorage/2.6.0.0/Resources/ExampleScript.ps1
ExampleScript.ps1
# Mount ISO configuration MountISO { Import-DscResource -ModuleName xDiskImage xMountImage ISO { Name = 'SQL Disk' ImagePath = 'c:\Sources\SQL.iso' DriveLetter = 's:' } } MountISO -out c:\DSC\ Start-DscConfiguration -Wait -Force -Path c:\DSC\ -V...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xWebAdministration/IIS.ps1
IIS.ps1
Configuration DemoIIS { LocalConfigurationManager { RebootNodeIfNeeded = $true } WindowsFeature IIS { Ensure = "Present" Name = "Web-Server" } WindowsFeature ASP { Ensure = "Present" Name = "Web-Asp-Net45" } WindowsFea...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xWebAdministration/1.11.0.0/DSCResources/MSFT_xIisModule/xIisModuleDesigner.ps1
xIisModuleDesigner.ps1
$diff = join-Path ${env:ProgramFiles(x86)} "Beyond compare 2\bc2.exe" $friendlyName = "xIisModule" $resourceName = "MSFT_$friendlyName" $classVersion = "1.0.0" $scriptRoot = Split-Path $MyInvocation.MyCommand.Path $originalModuleRoot = join-Path $scriptroot "..\.." $originalModuleRootPath = Resolve-Path $origin...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xWebAdministration/1.11.0.0/Examples/Sample_xIisMimeTypeMapping_RemoveVideo.ps1
Sample_xIisMimeTypeMapping_RemoveVideo.ps1
configuration Sample_RemoveVideoMimeTypeMappings { param ( # Target nodes to apply the configuration [string[]]$NodeName = 'localhost' ) # Import the module that defines custom resources Import-DscResource -Module xWebAdministration, PSDesiredStateConfiguration Node ...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xWebAdministration/1.11.0.0/Examples/Sample_xIisFeatureDelegation_AllowSome.ps1
Sample_xIisFeatureDelegation_AllowSome.ps1
configuration Sample_IISFeatureDelegation { param ( # Target nodes to apply the configuration [string[]] $NodeName = 'localhost' ) # Import the module that defines custom resources Import-DscResource -Module xWebAdministration, PSDesiredStateConfiguration Node $NodeN...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xWebAdministration/1.11.0.0/Examples/Sample_xSSLSettings_RequireCert.ps1
Sample_xSSLSettings_RequireCert.ps1
configuration Sample_xSSLSetting_RequireCert { param ( # Target nodes to apply the configuration [string[]]$NodeName = 'localhost' ) # Import the module that defines custom resources Import-DscResource -Module xWebAdministration Node $NodeName { xSSLSe...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xWebAdministration/1.11.0.0/Examples/Sample_xIisHandler_Remove32Bit.ps1
Sample_xIisHandler_Remove32Bit.ps1
configuration Sample_RemoveSome32BitHandlers { param ( # Target nodes to apply the configuration [string[]]$NodeName = 'localhost' ) # Import the module that defines custom resources Import-DscResource -Module xWebAdministration, PSDesiredStateConfiguration Node $Nod...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xWebAdministration/1.11.0.0/Examples/Sample_xWebsite_WithSSLFlags.ps1
Sample_xWebsite_WithSSLFlags.ps1
configuration Sample_xWebsite_NewWebsite { param ( # Target nodes to apply the configuration [string[]]$NodeName = 'localhost', # Name of the website to create [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [String]$WebSiteName, # Source P...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xWebAdministration/1.11.0.0/Examples/Sample_xWebsite_NewWebsiteFromConfigurationData.ps1
Sample_xWebsite_NewWebsiteFromConfigurationData.ps1
Configuration Sample_xWebsite_FromConfigurationData { # Import the module that defines custom resources Import-DscResource -Module xWebAdministration, PSDesiredStateConfiguration # Dynamically find the applicable nodes from configuration data Node $AllNodes.where{$_.Role -eq 'Web'}.NodeName ...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xWebAdministration/1.11.0.0/Examples/Sample_xIisServerDefaults.ps1
Sample_xIisServerDefaults.ps1
configuration Sample_IISServerDefaults { param ( # Target nodes to apply the configuration [string[]]$NodeName = 'localhost' ) # Import the module that defines custom resources Import-DscResource -Module xWebAdministration, PSDesiredStateConfiguration Node $NodeName ...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xWebAdministration/1.11.0.0/Examples/Sample_xWebsite_NewWebsite.ps1
Sample_xWebsite_NewWebsite.ps1
configuration Sample_xWebsite_NewWebsite { param ( # Target nodes to apply the configuration [string[]]$NodeName = 'localhost', # Name of the website to create [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [String]$WebSiteName, # Source P...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xWebAdministration/1.11.0.0/Examples/Sample_xWebsite_RemoveDefault.ps1
Sample_xWebsite_RemoveDefault.ps1
configuration Sample_xWebsite_StopDefault { param ( # Target nodes to apply the configuration [string[]]$NodeName = 'localhost' ) # Import the module that defines custom resources Import-DscResource -Module xWebAdministration, PSDesiredStateConfiguration Node $NodeNa...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xWebAdministration/1.11.0.0/Examples/Sample_xWebAppPool.ps1
Sample_xWebAppPool.ps1
<# .SYNOPSIS Create and configure an application pool. .DESCRIPTION This example shows how to use the xWebAppPool DSC resource to create and configure an application pool. #> Configuration Sample_xWebAppPool { param ( [String[]]$NodeName = 'localhost' ) Import-DscResource...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xWebAdministration/1.11.0.0/Tests/Unit/MSFT_xSSLSettings.Tests.ps1
MSFT_xSSLSettings.Tests.ps1
$global:DSCModuleName = 'xWebAdministration' $global:DSCResourceName = 'MSFT_xSSLSettings' #region HEADER [String] $moduleRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path)) if ( (-not (Test-Path -Path (Join-Path -Path $moduleRoot -ChildPath 'DSCResource.Tests'...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xWebAdministration/1.11.0.0/Tests/Unit/MSFT_xIISFeatureDelegation.tests.ps1
MSFT_xIISFeatureDelegation.tests.ps1
$global:DSCModuleName = 'xWebAdministration' $global:DSCResourceName = 'MSFT_xIISFeatureDelegation' #region HEADER [String] $moduleRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path)) if ( (-not (Test-Path -Path (Join-Path -Path $moduleRoot -ChildPath 'DSCReso...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xWebAdministration/1.11.0.0/Tests/Unit/MSFT_xWebApplication.Tests.ps1
MSFT_xWebApplication.Tests.ps1
$Global:DSCModuleName = 'xWebAdministration' $Global:DSCResourceName = 'MSFT_xWebApplication' #region HEADER [String] $moduleRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path)) if ( (-not (Test-Path -Path (Join-Path -Path $moduleRoot -ChildPath 'DSCResource.Tes...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xWebAdministration/1.11.0.0/Tests/Unit/MSFT_xIISHandler.tests.ps1
MSFT_xIISHandler.tests.ps1
$global:DSCModuleName = 'xWebAdministration' $global:DSCResourceName = 'MSFT_xIISHandler' #region HEADER [String] $moduleRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path)) if ( (-not (Test-Path -Path (Join-Path -Path $moduleRoot -ChildPath 'DSCResource.Tests')...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xWebAdministration/1.11.0.0/Tests/Unit/MSFT_xWebsite.Tests.ps1
MSFT_xWebsite.Tests.ps1
$Global:DSCModuleName = 'xWebAdministration' $Global:DSCResourceName = 'MSFT_xWebsite' #region HEADER [String] $moduleRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path)) if ( (-not (Test-Path -Path (Join-Path -Path $moduleRoot -ChildPath 'DSCResource.Tests')))...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xWebAdministration/1.11.0.0/Tests/Unit/MSFT_xWebAppPool.Tests.ps1
MSFT_xWebAppPool.Tests.ps1
#requires -Version 4.0 [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingConvertToSecureStringWithPlainText', '')] param () $Global:DSCModuleName = 'xWebAdministration' $Global:DSCResourceName = 'MSFT_xWebAppPool' #region HEADER [String] $moduleRoot = Split-Path -Parent (Split-Path -P...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xWebAdministration/1.11.0.0/Tests/Unit/MSFT_xWebVirtualDirectory.tests.ps1
MSFT_xWebVirtualDirectory.tests.ps1
$global:DSCModuleName = 'xWebAdministration' $global:DSCResourceName = 'MSFT_xWebVirtualDirectory' #region HEADER [String] $moduleRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path)) if ( (-not (Test-Path -Path (Join-Path -Path $moduleRoot -ChildPath 'DSCResourc...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xWebAdministration/1.11.0.0/Tests/Integration/MSFT_xIISFeatureDelegation.config.ps1
MSFT_xIISFeatureDelegation.config.ps1
configuration MSFT_xIISFeatureDelegation_AllowDelegation { Import-DscResource -ModuleName xWebAdministration xIisFeatureDelegation AllowDelegation { SectionName = 'security/authentication/anonymousAuthentication' OverrideMode = 'Allow' } } configuration MSFT_xIISFeatureDeleg...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xWebAdministration/1.11.0.0/Tests/Integration/MSFT_xWebsiteDefaults.config.ps1
MSFT_xWebsiteDefaults.config.ps1
[string] $originalValue = (Get-WebConfigurationProperty ` -PSPath 'MACHINE/WEBROOT/APPHOST' ` -Filter 'system.applicationHost/sites/virtualDirectoryDefaults' ` -Name 'allowSubDirConfig').Value if ($originalValue -eq "true") { $env:PesterVirtualDirectoryDefaults = "false" } else { $env:Pe...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xWebAdministration/1.11.0.0/Tests/Integration/MSFT_xWebAppPoolDefaults.Integration.Tests.ps1
MSFT_xWebAppPoolDefaults.Integration.Tests.ps1
$Global:DSCModuleName = 'xWebAdministration' $Global:DSCResourceName = 'MSFT_xWebAppPoolDefaults' #region HEADER [String] $moduleRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path)) if ( (-not (Test-Path -Path (Join-Path -Path $moduleRoot -ChildPath 'DSCR...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xWebAdministration/1.11.0.0/Tests/Integration/MSFT_xWebAppPool.config.ps1
MSFT_xWebAppPool.config.ps1
#requires -Version 4.0 [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingConvertToSecureStringWithPlainText', '')] param () $ConfigData = @{ AllNodes = @( @{ NodeName = '*' PSDscAllowPlainTextPassword = $true } @{ NodeNam...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xWebAdministration/1.11.0.0/Tests/Integration/MSFT_xWebsite.Integration.Tests.ps1
MSFT_xWebsite.Integration.Tests.ps1
$Global:DSCModuleName = 'xWebAdministration' $Global:DSCResourceName = 'MSFT_xWebsite' #region HEADER [String] $moduleRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path)) if ( (-not (Test-Path -Path (Join-Path -Path $moduleRoot -ChildPath 'DSCResource.Tests')))...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xWebAdministration/1.11.0.0/Tests/Integration/MSFT_xIISHandler.config.ps1
MSFT_xIISHandler.config.ps1
configuration MSFT_xIISHandler_RemoveHandler { Import-DscResource -ModuleName xWebAdministration xIisHandler TRACEVerbHandler { Name = 'TRACEVerbHandler' Ensure = 'Absent' } } configuration MSFT_xIISHandler_AddHandler { Import-DscResource -ModuleName xWebAdministration...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xWebAdministration/1.11.0.0/Tests/Integration/MSFT_xWebsite.config.ps1
MSFT_xWebsite.config.ps1
configuration MSFT_xWebsite_Config { Import-DscResource -ModuleName xWebAdministration xWebsite WebBindingInfo { Name = 'foobar' Ensure = 'absent' PhysicalPath = "$env:temp\WebBindingInfo" } }
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xWebAdministration/1.11.0.0/Tests/Integration/MSFT_xWebsiteDefaults.Integration.Tests.ps1
MSFT_xWebsiteDefaults.Integration.Tests.ps1
$Global:DSCModuleName = 'xWebAdministration' $Global:DSCResourceName = 'MSFT_xWebsiteDefaults' #region HEADER [String] $moduleRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path)) if ( (-not (Test-Path -Path (Join-Path -Path $moduleRoot -ChildPath 'DSCResource.Tes...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xWebAdministration/1.11.0.0/Tests/Integration/MSFT_xWebAppPool.Integration.tests.ps1
MSFT_xWebAppPool.Integration.tests.ps1
#requires -Version 4.0 $Global:DSCModuleName = 'xWebAdministration' $Global:DSCResourceName = 'MSFT_xWebAppPool' #region HEADER [String] $moduleRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path)) if ( (-not (Test-Path -Path (Join-Path -Path $moduleRoot -Chi...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xWebAdministration/1.11.0.0/Tests/Integration/MSFT_xWebAppPoolDefaults.config.ps1
MSFT_xWebAppPoolDefaults.config.ps1
[string] $constPsPath = 'MACHINE/WEBROOT/APPHOST' [string] $constAPDFilter = 'system.applicationHost/applicationPools/applicationPoolDefaults' [string] $constSiteFilter = 'system.applicationHost/sites/' [string] $originalValue = (Get-WebConfigurationProperty -pspath $constPsPath -filter $constAPDFilter -name manag...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xWebAdministration/1.11.0.0/Tests/Integration/MSFT_xIISFeatureDelegation.Integration.Tests.ps1
MSFT_xIISFeatureDelegation.Integration.Tests.ps1
$global:DSCModuleName = 'xWebAdministration' $global:DSCResourceName = 'MSFT_xIISFeatureDelegation' #region HEADER [String] $moduleRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path)) if ( (-not (Test-Path -Path (Join-Path -Path $moduleRoot -ChildPath 'DSCResourc...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xWebAdministration/1.11.0.0/Tests/Integration/MSFT_xIISMimeTypeMapping.config.ps1
MSFT_xIISMimeTypeMapping.config.ps1
configuration MSFT_xIISMimeTypeMapping_Config { Import-DscResource -ModuleName xWebAdministration xIIsMimeTypeMapping AddMimeType { Extension = '.PesterDummy' MimeType = 'text/plain' Ensure = 'Present' } } configuration MSFT_xIISMimeTypeMapping_AddMimeType { I...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xWebAdministration/1.11.0.0/Tests/Integration/MSFT_xIISHandler.Integration.Tests.ps1
MSFT_xIISHandler.Integration.Tests.ps1
$Global:DSCModuleName = 'xWebAdministration' $Global:DSCResourceName = 'MSFT_xIISHandler' #region HEADER [String] $moduleRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path)) if ( (-not (Test-Path -Path (Join-Path -Path $moduleRoot -ChildPath 'DSCResource....
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xWebAdministration/1.11.0.0/Tests/Integration/MSFT_xIISMimeTypeMapping.Integration.Tests.ps1
MSFT_xIISMimeTypeMapping.Integration.Tests.ps1
$Global:DSCModuleName = 'xWebAdministration' $Global:DSCResourceName = 'MSFT_xIISMimeTypeMapping' #region HEADER [String] $moduleRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path)) if ( (-not (Test-Path -Path (Join-Path -Path $moduleRoot -ChildPath 'DSCR...
PowerShellCorpus/Github/smithr17_AzureCLI/0-Common/DSC/xNetworking/Examples/Sample_xIPAddress_FixedValue.ps1
Sample_xIPAddress_FixedValue.ps1
configuration Sample_xIPAddress_FixedValue { param ( [string[]]$NodeName = 'localhost' ) Import-DscResource -Module xNetworking Node $NodeName { xIPAddress NewIPAddress { IPAddress = "2001:4898:200:7:6c71:a102:ebd8:f482" Interf...