From 60e9bd28e1c7d46d490bdf41196a786add79c2d6 Mon Sep 17 00:00:00 2001 From: Easyreturns <20781445+jeffotterpohl@users.noreply.github.com> Date: Tue, 26 May 2020 08:49:46 -0500 Subject: [PATCH 1/3] Initial branch creation for PxeDistributionPoint --- CHANGELOG.md | 1 + README.md | 32 +- source/ConfigMgrCBDsc.psd1 | 4 +- .../DSC_CMPxeDistributionPoint.psm1 | 336 ++++++++++++++++++ .../DSC_CMPxeDistributionPoint.schema.mof | 15 + .../DSC_CMPxeDistributionPoint.strings.psd1 | 10 + .../CMPxeDistributionPoint_Disabled.ps1 | 18 + .../CMPxeDistributionPoint_Enabled.ps1 | 35 ++ tests/Unit/CMPxeDistributionPoint.tests.ps1 | 300 ++++++++++++++++ 9 files changed, 749 insertions(+), 2 deletions(-) create mode 100644 source/DSCResources/DSC_CMPxeDistributionPoint/DSC_CMPxeDistributionPoint.psm1 create mode 100644 source/DSCResources/DSC_CMPxeDistributionPoint/DSC_CMPxeDistributionPoint.schema.mof create mode 100644 source/DSCResources/DSC_CMPxeDistributionPoint/en-US/DSC_CMPxeDistributionPoint.strings.psd1 create mode 100644 source/Examples/Resources/CMPxeDistributionPoint/CMPxeDistributionPoint_Disabled.ps1 create mode 100644 source/Examples/Resources/CMPxeDistributionPoint/CMPxeDistributionPoint_Enabled.ps1 create mode 100644 tests/Unit/CMPxeDistributionPoint.tests.ps1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 75c55f0..24f85e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ For older change log history see the [historic changelog](HISTORIC_CHANGELOG.md) - Added CMForestDiscovery resource - Added ConvertTo-CimCMScheduleString to the ResourceHelper - Added CMClientStatusSettings Resource +- Added CMPxeDistributionPoint Resource ### Changed diff --git a/README.md b/README.md index d65531a..d437f0c 100644 --- a/README.md +++ b/README.md @@ -247,7 +247,7 @@ Please check out common DSC Community [contributing guidelines](https://dsccommu - **[String] IsSingleInstance** _(Key)_: Specifies the resource is a single instance, the value must be 'Yes'. { Yes }. -- **[String] SiteCode** _(Key)_: Specifies the Site Code for the Configuration +- **[String] SiteCode** _(Required)_: Specifies the Site Code for the Configuration Manager site. - **[UInt32] ClientPolicyDays** _(Write)_: Specifies the data collection interval for client policy client monitoring activities. @@ -265,3 +265,33 @@ Please check out common DSC Community [contributing guidelines](https://dsccommu #### CMClientStatusSettings Examples - [CMClientStatusSettings](Source\Examples\Resources\CMClientStatusSettings\CMClientStatusSettings.ps1) + +### CMPxeDistributionPoint + +- **[String] SiteCode** _(Key)_: Specifies the SiteCode for the Configuration + Manager site. +- **[String] SiteServerName** _(Key)_: Specifies the SiteServer to install the + role on. +- **[Boolean] EnablePxe** _(Write)_: Indicates whether PXE is enabled on + the distribution point. +- **[Boolean] EnableNonWdsPxe** _(Write)_: Specifies whether to enable Pxe responder + without Windows Deployment services. +- **[Boolean] EnableUnknownComputerSupport** _(Write)_: Indicates whether support + for unknown computers is enabled. +- **[Boolean] AllowPxeResponse** _(Write)_: Indicates whether the distribution + point can respond to PXE requests. +- **[UInt16] PxeServerResponseDelaySec** _(Write)_: Specifies, in seconds, how + long the distribution point delays before it responds to computer requests. +- **[String] UserDeviceAffinity** _(Write)_: Specifies how you want the distribution + point to associate users with their devices for Pxe deployments. + - Values include: { DoNotUse | AllowWithManualApproval | + AllowWithAutomaticApproval } +- **[PSCredential] PxePassword** _(Write)_: Specifies, as a credential, the + Pxe password. +- **[Boolean] IsMulticast** _(Read)_: Specifies if multicast is enabled. +- **[String] DPStatus** _(Read)_: Specifies if the DP role is installed. + +#### CMPxeDistributionPoint Examples + +- [CMPxeDistributionPoint_Disabled](Source\Examples\Resources\CMPxeDistributionPoint\CMPxeDistributionPoint_Disabled.ps1) +- [CMPxeDistributionPoint_Enabled](Source\Examples\Resources\CMPxeDistributionPoint\CMPxeDistributionPoint_Enabled.ps1) diff --git a/source/ConfigMgrCBDsc.psd1 b/source/ConfigMgrCBDsc.psd1 index 1ecc523..159fc37 100644 --- a/source/ConfigMgrCBDsc.psd1 +++ b/source/ConfigMgrCBDsc.psd1 @@ -49,6 +49,7 @@ 'CMBoundaries' 'CMForestDiscovery' 'CMClientStatusSettings' + 'CMPxeDistributionPoint' ) <# @@ -61,7 +62,8 @@ Prerelease = '' # Tags applied to this module. These help with module discovery in online galleries. - Tags = @('DesiredStateConfiguration', 'DSC', 'DSCResourceKit', 'DSCResource', 'ConfigMgrCBDsc', 'ClientSettings','CMAccounts','SccmIniFile','Collections','CMBoundaries','CMForestDiscovery','ClientStatusSettings') + Tags = @('DesiredStateConfiguration', 'DSC', 'DSCResourceKit', 'DSCResource', 'ConfigMgrCBDsc', 'ClientSettings','CMAccounts','SccmIniFile','Collections','CMBoundaries', + 'CMForestDiscovery','ClientStatusSettings','PXE Distribution Point') # A URL to the license for this module. LicenseUri = 'https://github.com/dsccommunity/ConfigMgrCBDsc/blob/master/LICENSE' diff --git a/source/DSCResources/DSC_CMPxeDistributionPoint/DSC_CMPxeDistributionPoint.psm1 b/source/DSCResources/DSC_CMPxeDistributionPoint/DSC_CMPxeDistributionPoint.psm1 new file mode 100644 index 0000000..cb2f997 --- /dev/null +++ b/source/DSCResources/DSC_CMPxeDistributionPoint/DSC_CMPxeDistributionPoint.psm1 @@ -0,0 +1,336 @@ +$script:dscResourceCommonPath = Join-Path -Path $PSScriptRoot -ChildPath '..\..\Modules\DscResource.Common' +$script:configMgrResourcehelper = Join-Path -Path $PSScriptRoot -ChildPath '..\..\Modules\ConfigMgrCBDsc.ResourceHelper' + +Import-Module -Name $script:dscResourceCommonPath +Import-Module -Name $script:configMgrResourcehelper + +$script:localizedData = Get-LocalizedData -DefaultUICulture 'en-US' + +<# + .SYNOPSIS + This will return a hashtable of results. + + .PARAMETER SiteCode + Specifies the site code for Configuration Manager site. + + .PARAMETER SiteServerName + Specifies the SiteServer to install the role on. + + .Notes + This must be ran on the Primary servers to install the Distribution Point role. + The Primary server computer account must be in the local + administrators group to perform the install. +#> +function Get-TargetResource +{ + [CmdletBinding()] + [OutputType([System.Collections.Hashtable])] + param + ( + [Parameter(Mandatory = $true)] + [String] + $SiteCode, + + [Parameter(Mandatory = $true)] + [String] + $SiteServerName + ) + + Write-Verbose -Message $script:localizedData.RetrieveSettingValue + Import-ConfigMgrPowerShellModule -SiteCode $SiteCode + Set-Location -Path "$($SiteCode):\" + + $dpInfo = Get-CMDistributionPointInfo -SiteSystemServerName $SiteServerName -SiteCode $SiteCode + + if ($dpInfo) + { + $uda = $dpInfo.UdaSetting + $udaSetting = @('DoNotUse', 'AllowWithManualApproval','AllowWithAutomaticApproval')[$uda] + + $dpInstall = 'Present' + } + else + { + $dpInstall = 'Absent' + } + + return @{ + SiteCode = $SiteCode + SiteServerName = $SiteServerName + EnablePxe = $dpInfo.IsPxe + EnableNonWdsPxe = $dpInfo.SccmPxe + EnableUnknownComputerSupport = $dpInfo.SupportUnknownMachines + PxePassword = $dpInfo.PxePassword + AllowPxeResponse = $dpInfo.IsActive + PxeServerResponseDelaySec = [UInt16]$dpInfo.ResponseDelay + UserDeviceAffinity = $udaSetting + IsMulticast = $dpInfo.IsMulticast + DPStatus = $dpInstall + } +} + +<# + .SYNOPSIS + This will set the desired state. + + .PARAMETER SiteCode + Specifies the site code for Configuration Manager site. + + .PARAMETER SiteServerName + Specifies the SiteServer to install the role on. + + .PARAMETER EnablePxe + Indicates whether Pxe is enabled on the distribution point. + When you enable Pxe, Configuration Manager installs Windows Deployment Services on the server, if required. + Windows Deployment Services is the service that performs the Pxe boot to install operating systems. + After you create the distribution point, Configuration Manager installs a provider in + Windows Deployment Services that uses the Pxe boot functions. + + .PARAMETER EnableNonWdsPxe + Specifies whether to enable Pxe responder without Windows Deployment services. + + .PARAMETER EnableUnknownComputerSupport + Indicates whether support for unknown computers is enabled. + Unknown computers are computers that are not managed by Configuration Manager. + + .PARAMETER AllowPxeResponse + Indicates whether the distribution point can respond to Pxe requests. + + .PARAMETER PxeServerResponseDelaySec + Specifies, in seconds, how long the distribution point delays before it responds to computer requests when + you are using multiple Pxe-enabled distribution points. By default, the Configuration Manager + Pxe service point responds first to network Pxe requests. + + .PARAMETER UserDeviceAffinity + Specifies how you want the distribution point to associate users with their devices for Pxe deployments. + + .PARAMETER PxePassword + Specifies, as a secure string, the Pxe password. +#> +function Set-TargetResource +{ + [CmdletBinding()] + param + ( + [Parameter(Mandatory = $true)] + [String] + $SiteCode, + + [Parameter(Mandatory = $true)] + [String] + $SiteServerName, + + [Parameter()] + [Boolean] + $EnablePxe, + + [Parameter()] + [Boolean] + $EnableNonWdsPxe, + + [Parameter()] + [Boolean] + $EnableUnknownComputerSupport, + + [Parameter()] + [Boolean] + $AllowPxeResponse, + + [Parameter()] + [ValidateRange(0,32)] + [UInt16] + $PxeServerResponseDelaySec, + + [Parameter()] + [ValidateSet('DoNotUse','AllowWithManualApproval','AllowWithAutomaticApproval')] + [String] + $UserDeviceAffinity, + + [Parameter()] + [PSCredential] + $PxePassword + ) + + Import-ConfigMgrPowerShellModule -SiteCode $SiteCode + Set-Location -Path "$($SiteCode):\" + $state = Get-TargetResource -SiteCode $SiteCode -SiteServerName $SiteServerName + + try + { + if ($state.DPStatus -eq 'Absent') + { + throw ($script:localizedData.DistroPointInstall -f $SiteServerName) + } + + if ((($PSBoundParameters.EnablePxe -eq $false) -or ([string]::IsNullOrEmpty($PSBoundParameters.EnablePxe) -and + $state.EnablePxe -eq $false)) -and (($PSBoundParameters.EnableNonWdsPxe) -or + ($PSBoundParameters.EnableUnknownComputerSupport) -or ($PSBoundParameters.AllowPxeResponse) -or + ($PSBoundParameters.PxeServerResponseDelaySec) -or ($PSBoundParameters.UserDeviceAffinity) -or + ($PSBoundParameters.PxePassword))) + { + throw $script:localizedData.PxeThrow + } + + if ($EnableNonWdsPxe -eq $true -and $state.IsMulticast -eq $true) + { + throw $script:localizedData.NonWdsThrow + } + + $eval = @('EnablePxe','EnableNonWdsPxe','EnableUnknownComputerSupport','AllowPxeResponse', + 'PxeServerResponseDelaySec','UserDeviceAffinity') + + foreach ($param in $PSBoundParameters.GetEnumerator()) + { + if ($eval -contains $param.key) + { + if ($param.Value -ne $state[$param.key]) + { + Write-Verbose -Message ($script:localizedData.SettingValue -f $param.key, $param.Value) + + $buildingParams += @{ + $param.key = $param.Value + } + } + } + } + + if ((-not [string]::IsNullOrEmpty($PxePassword)) -and ([string]::IsNullOrEmpty($state.PxePassword))) + { + Write-Verbose -Message $script:localizedData.SetPxePassword + $buildingParams += @{ + PxePassword = $PxePassword.Password + } + } + + if ($buildingParams) + { + Set-CMDistributionPoint -SiteSystemServerName $SiteServerName -SiteCode $SiteCode @buildingParams + } + } + catch + { + throw $_ + } + finally + { + Set-Location -Path $env:windir + } +} + +<# + .SYNOPSIS + This will test the desired state. + + .PARAMETER SiteCode + Specifies the site code for Configuration Manager site. + + .PARAMETER SiteServerName + Specifies the SiteServer to install the role on. + + .PARAMETER EnablePxe + Indicates whether Pxe is enabled on the distribution point. + When you enable Pxe, Configuration Manager installs Windows Deployment Services on the server, if required. + Windows Deployment Services is the service that performs the Pxe boot to install operating systems. + After you create the distribution point, Configuration Manager installs a provider in + Windows Deployment Services that uses the Pxe boot functions. + + .PARAMETER EnableNonWdsPxe + Specifies whether to enable Pxe responder without Windows Deployment services. + + .PARAMETER EnableUnknownComputerSupport + Indicates whether support for unknown computers is enabled. + Unknown computers are computers that are not managed by Configuration Manager. + + .PARAMETER AllowPxeResponse + Indicates whether the distribution point can respond to Pxe requests. + + .PARAMETER PxeServerResponseDelaySec + Specifies, in seconds, how long the distribution point delays before it responds to computer requests when + you are using multiple Pxe-enabled distribution points. By default, the Configuration Manager + Pxe service point responds first to network Pxe requests. + + .PARAMETER UserDeviceAffinity + Specifies how you want the distribution point to associate users with their devices for Pxe deployments. + + .PARAMETER PxePassword + Specifies, as a secure string, the Pxe password. +#> +function Test-TargetResource +{ + [CmdletBinding()] + [OutputType([System.Boolean])] + param + ( + [Parameter(Mandatory = $true)] + [String] + $SiteCode, + + [Parameter(Mandatory = $true)] + [String] + $SiteServerName, + + [Parameter()] + [Boolean] + $EnablePxe, + + [Parameter()] + [Boolean] + $EnableNonWdsPxe, + + [Parameter()] + [Boolean] + $EnableUnknownComputerSupport, + + [Parameter()] + [Boolean] + $AllowPxeResponse, + + [Parameter()] + [ValidateRange(0,32)] + [UInt16] + $PxeServerResponseDelaySec, + + [Parameter()] + [ValidateSet('DoNotUse','AllowWithManualApproval','AllowWithAutomaticApproval')] + [String] + $UserDeviceAffinity, + + [Parameter()] + [PSCredential] + $PxePassword + ) + + Import-ConfigMgrPowerShellModule -SiteCode $SiteCode + Set-Location -Path "$($SiteCode):\" + $returnValue = $true + $state = Get-TargetResource -SiteCode $SiteCode -SiteServerName $SiteServerName + + if ($state.DPStatus -eq 'Absent') + { + Write-Verbose -Message ($script:localizedData.DistroPointInstall -f $SiteServerName) + $returnValue = $false + } + else + { + $testParams = @{ + CurrentValues = $state + DesiredValues = $PSBoundParameters + ValuesToCheck = @('EnablePxe','EnableNonWdsPxe','EnableUnknownComputerSupport','AllowPxeResponse', + 'PxeServerResponseDelaySec','UserDeviceAffinity') + } + + $returnValue = Test-DscParameterState @testParams -Verbose + + if ((-not [string]::IsNullOrEmpty($PxePassword)) -and ([string]::IsNullOrEmpty($state.PxePassword))) + { + Write-Verbose -Message $script:localizedData.PXEPassword + $returnValue = $false + } + } + + Write-Verbose -Message ($script:localizedData.TestState -f $result) + Set-Location -Path $env:windir + return $returnValue +} + +Export-ModuleMember -Function *-TargetResource diff --git a/source/DSCResources/DSC_CMPxeDistributionPoint/DSC_CMPxeDistributionPoint.schema.mof b/source/DSCResources/DSC_CMPxeDistributionPoint/DSC_CMPxeDistributionPoint.schema.mof new file mode 100644 index 0000000..0b2c5df --- /dev/null +++ b/source/DSCResources/DSC_CMPxeDistributionPoint/DSC_CMPxeDistributionPoint.schema.mof @@ -0,0 +1,15 @@ +[ClassVersion("1.0.0"), FriendlyName("CMPxeDistributionPoint")] +class DSC_CMPxeDistributionPoint : OMI_BaseResource +{ + [Key, Description("Specifies the SiteCode for the Configuration Manager site.")] String SiteCode; + [Key, Description("Specifies the SiteServer to install the role on.")] String SiteServerName; + [Write, Description("Indicates whether PXE is enabled on the distribution point.")] Boolean EnablePxe; + [Write, Description("Specifies whether to enable Pxe responder without Windows Deployment services.")] Boolean EnableNonWdsPxe; + [Write, Description("Indicates whether support for unknown computers is enabled.")] Boolean EnableUnknownComputerSupport; + [Write, Description("Indicates whether the distribution point can respond to PXE requests.")] Boolean AllowPxeResponse; + [Write, Description("Specifies, in seconds, how long the distribution point delays before it responds to computer requests.")] UInt16 PxeServerResponseDelaySec; + [Write, Description("Specifies how you want the distribution point to associate users with their devices for PXE deployments."), ValueMap{"DoNotUse","AllowWithManualApproval","AllowWithAutomaticApproval"}, Values{"DoNotUse","AllowWithManualApproval","AllowWithAutomaticApproval"}] String UserDeviceAffinity; + [Write, Description("Specifies, as a secure string, the PXE password."), EmbeddedInstance("MSFT_Credential")] String PxePassword; + [Read, Description("Specifies if multicast is enabled.")] Boolean IsMulticast; + [Read, Description("Specifies if the DP role is installed.")] String DPStatus; +}; diff --git a/source/DSCResources/DSC_CMPxeDistributionPoint/en-US/DSC_CMPxeDistributionPoint.strings.psd1 b/source/DSCResources/DSC_CMPxeDistributionPoint/en-US/DSC_CMPxeDistributionPoint.strings.psd1 new file mode 100644 index 0000000..afd5520 --- /dev/null +++ b/source/DSCResources/DSC_CMPxeDistributionPoint/en-US/DSC_CMPxeDistributionPoint.strings.psd1 @@ -0,0 +1,10 @@ +ConvertFrom-StringData @' + RetrieveSettingValue = Getting results for Configuration Manager collection. + DistroPointInstall = The Distribution Point role on {0} is not installed, run DSC_CMDistibutionPoint to install the role. + PxePassword = Expected Pxe password to be set. + TestState = Test-TargetResource compliance check returned: {0}. + PxeThrow = Can not specify PXE settings when PXE is currently or setting to $false, please set EnablePxe to $true. + NonWdsThrow = You can not enable nonWDSPxe while multicast is set to enabled. + SettingValue = Setting value: {0} to {1}. + SetPxePassword = Expected a Pxe password to be used, setting Pxe password. +'@ diff --git a/source/Examples/Resources/CMPxeDistributionPoint/CMPxeDistributionPoint_Disabled.ps1 b/source/Examples/Resources/CMPxeDistributionPoint/CMPxeDistributionPoint_Disabled.ps1 new file mode 100644 index 0000000..a9ae800 --- /dev/null +++ b/source/Examples/Resources/CMPxeDistributionPoint/CMPxeDistributionPoint_Disabled.ps1 @@ -0,0 +1,18 @@ +<# + .SYNOPSIS + A DSC configuration script to disable Pxe Distribution Point for Configuration Manager. +#> +Configuration Example +{ + Import-DscResource -ModuleName ConfigMgrCBDsc + + Node localhost + { + CMPxeDistributionPoint ExampleSettings + { + SiteCode = 'Lab' + SiteServerName = 'DP01.contoso.com' + EnablePxe = $false + } + } +} diff --git a/source/Examples/Resources/CMPxeDistributionPoint/CMPxeDistributionPoint_Enabled.ps1 b/source/Examples/Resources/CMPxeDistributionPoint/CMPxeDistributionPoint_Enabled.ps1 new file mode 100644 index 0000000..26d77b2 --- /dev/null +++ b/source/Examples/Resources/CMPxeDistributionPoint/CMPxeDistributionPoint_Enabled.ps1 @@ -0,0 +1,35 @@ +<# + .SYNOPSIS + A DSC configuration script to configure Pxe Distribution Point for Configuration Manager. + + .PARAMETER PxePassword + Specify the password to be used for the Pxe. +#> +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [ValidateNotNullOrEmpty()] + [System.Management.Automation.PSCredential] + $PxePassword + ) + + Import-DscResource -ModuleName ConfigMgrCBDsc + + Node localhost + { + CMPxeDistributionPoint ExampleSettings + { + SiteCode = 'Lab' + SiteServerName = 'DP01.contoso.com' + EnablePxe = $true + EnableNonWdsPxe = $true + EnableUnknownComputerSupport = $true + AllowPxeResponse = $true + PxeServerResponseDelaySec = 2 + UserDeviceAffinity = 'AllowWithAutomaticApproval' + PxePassword = $PxePassword + } + } +} diff --git a/tests/Unit/CMPxeDistributionPoint.tests.ps1 b/tests/Unit/CMPxeDistributionPoint.tests.ps1 new file mode 100644 index 0000000..9e0052c --- /dev/null +++ b/tests/Unit/CMPxeDistributionPoint.tests.ps1 @@ -0,0 +1,300 @@ +[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingConvertToSecureStringWithPlainText', '')] +param () + +$script:dscModuleName = 'ConfigMgrCBDsc' +$script:dscResourceName = 'DSC_CMPxeDistributionPoint' + +function Invoke-TestSetup +{ + try + { + Import-Module -Name DscResource.Test -Force -ErrorAction 'Stop' + } + catch [System.IO.FileNotFoundException] + { + throw 'DscResource.Test module dependency not found. Please run ".\build.ps1 -Tasks build" first.' + } + + $script:testEnvironment = Initialize-TestEnvironment ` + -DSCModuleName $script:dscModuleName ` + -DSCResourceName $script:dscResourceName ` + -ResourceType 'Mof' ` + -TestType 'Unit' + + # Import Stub function + $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) + Import-Module (Join-Path -Path $PSScriptRoot -ChildPath 'Stubs\ConfigMgrCBDscStub.psm1') -Force -WarningAction SilentlyContinue +} + +function Invoke-TestCleanup +{ + Restore-TestEnvironment -TestEnvironment $script:testEnvironment +} + +Invoke-TestSetup + +# Begin Testing +try +{ + InModuleScope $script:dscResourceName { + $moduleResourceName = 'ConfigMgrCBDsc - DSC_CMPxeDistributionPoint' + + # Get input and output + $getDPInfo = @{ + IsPxe = $true + SCCMPxe = $true + SupportUnknownMachines = $true + UdaSetting = 0 + PxePassword = 'password' + IsActive = $true + ResponseDelay = 2 + IsMulticast = $false + } + + $getInput = @{ + SiteCode = 'Lab' + SiteServerName = 'DP01.contoso.com' + } + + # Test and Set + $getStatusAbsent = @{ + SiteCode = 'Lab' + SiteServerName = 'DP01.contoso.com' + EnablePxe = $null + EnableNonWdsPxe = $null + EnableUnknownComputerSupport = $null + PxePassword = $null + AllowPxeResponse = $null + PxeServerResponseDelaySec = 0 + UserDeviceAffinity = $null + IsMulticast = $null + DPStatus = 'Absent' + } + + $getStatusPresentNoPassword = @{ + SiteCode = 'Lab' + SiteServerName = 'DP01.contoso.com' + EnablePxe = $true + EnableNonWdsPxe = $true + EnableUnknownComputerSupport = $true + PxePassword = $null + AllowPxeResponse = $true + PxeServerResponseDelaySec = [UInt16]2 + UserDeviceAffinity = 'AllowWithManualApproval' + IsMulticast = $false + DPStatus = 'Present' + } + + $inputParamsMatch = @{ + SiteCode = 'Lab' + SiteServerName = 'DP01.contoso.com' + EnablePxe = $true + AllowPxeResponse = $true + PxeServerResponseDelaySec = 2 + UserDeviceAffinity = 'AllowWithManualApproval' + } + + $inputParamsMismatch = @{ + SiteCode = 'Lab' + SiteServerName = 'DP01.contoso.com' + EnablePxe = $true + AllowPxeResponse = $false + PxeServerResponseDelaySec = 1 + UserDeviceAffinity = 'DoNotUse' + } + + $testCredential = New-Object ` + -TypeName System.Management.Automation.PSCredential ` + -ArgumentList 'DummyUsername', (ConvertTo-SecureString 'DummyPassword' -AsPlainText -Force) + + $inputParamsPxePassword = @{ + SiteCode = 'Lab' + SiteServerName = 'DP01.contoso.com' + PxePassword = $testCredential + } + + $distroPointError = 'The Distribution Point role on DP01.contoso.com is not installed, run DSC_CMDistibutionPoint to install the role.' + $pxeFalseThrow = 'Can not specify PXE settings when PXE is currently or setting to $false, please set EnablePxe to $true.' + + $badInputPxeFalse = @{ + SiteCode = 'Lab' + SiteServerName = 'DP01.contoso.com' + EnablePxe = $false + PxePassword = $testCredential + } + + $nonWdsThrow = 'You can not enable nonWDSPxe while multicast is set to enabled.' + + $getReturnMulticastEnabled = @{ + SiteCode = 'Lab' + SiteServerName = 'DP01.contoso.com' + EnablePxe = $true + EnableNonWdsPxe = $true + EnableUnknownComputerSupport = $true + PxePassword = $null + AllowPxeResponse = $true + PxeServerResponseDelaySec = [UInt16]2 + UserDeviceAffinity = 'AllowWithManualApproval' + IsMulticast = $true + DPStatus = 'Present' + } + + $setNonWdsEnabled = @{ + SiteCode = 'Lab' + SiteServerName = 'DP01.contoso.com' + EnableNonWdsPxe = $true + } + + Describe "$moduleResourceName\Get-TargetResource" { + Mock -CommandName Import-ConfigMgrPowerShellModule + Mock -CommandName Set-Location + + Context 'When retrieving Collection settings' { + + It 'Should return desired result when all info is returned' { + Mock -CommandName Get-CMDistributionPointInfo -MockWith { $getDPInfo } + + $result = Get-TargetResource @getInput + $result | Should -BeOfType System.Collections.HashTable + $result.SiteCode | Should -Be -ExpectedValue 'Lab' + $result.SiteServerName | Should -Be -ExpectedValue 'DP01.contoso.com' + $result.EnablePxe | Should -Be -ExpectedValue $true + $result.EnableNonWdsPxe | Should -Be -ExpectedValue $true + $result.EnableUnknownComputerSupport | Should -Be -ExpectedValue $true + $result.PxePassword | Should -Be -ExpectedValue 'password' + $result.AllowPxeResponse | Should -Be -ExpectedValue $true + $result.PxeServerResponseDelaySec | Should -Be -ExpectedValue 2 + $result.UserDeviceAffinity | Should -Be -ExpectedValue 'DoNotUse' + $result.IsMulticast | Should -Be -ExpectedValue $false + $result.DPStatus | Should -Be -ExpectedValue 'Present' + } + + It 'Should return desired result when server is not a Distribution Point' { + Mock -CommandName Get-CMDistributionPointInfo -MockWith { $null } + + $result = Get-TargetResource @getInput + $result | Should -BeOfType System.Collections.HashTable + $result.SiteCode | Should -Be -ExpectedValue 'Lab' + $result.SiteServerName | Should -Be -ExpectedValue 'DP01.contoso.com' + $result.EnablePxe | Should -Be -ExpectedValue $null + $result.EnableNonWdsPxe | Should -Be -ExpectedValue $null + $result.EnableUnknownComputerSupport | Should -Be -ExpectedValue $null + $result.PxePassword | Should -Be -ExpectedValue $null + $result.AllowPxeResponse | Should -Be -ExpectedValue $null + $result.PxeServerResponseDelaySec | Should -Be -ExpectedValue 0 + $result.UserDeviceAffinity | Should -Be -ExpectedValue $null + $result.IsMulticast | Should -Be -ExpectedValue $null + $result.DPStatus | Should -Be -ExpectedValue 'Absent' + } + } + } + + Describe "$moduleResourceName\Set-TargetResource" { + Mock -CommandName Import-ConfigMgrPowerShellModule + Mock -CommandName Set-Location + Mock -CommandName Set-CMDistributionPoint + + Context 'When Set-TargetResource runs successfully' { + + It 'Should call expected commands when settings match' { + Mock -CommandName Get-TargetResource -MockWith { $getStatusPresentNoPassword } + + Set-TargetResource @inputParamsMatch + Assert-MockCalled Import-ConfigMgrPowerShellModule -Exactly -Times 1 -Scope It + Assert-MockCalled Set-Location -Exactly -Times 2 -Scope It + Assert-MockCalled Get-TargetResource -Exactly -Times 1 -Scope It + Assert-MockCalled Set-CMDistributionPoint -Exactly -Times 0 -Scope It + } + + It 'Should call expected commands when settings do not match' { + Mock -CommandName Get-TargetResource -MockWith { $getStatusPresentNoPassword } + + Set-TargetResource @inputParamsMismatch + Assert-MockCalled Import-ConfigMgrPowerShellModule -Exactly -Times 1 -Scope It + Assert-MockCalled Set-Location -Exactly -Times 2 -Scope It + Assert-MockCalled Get-TargetResource -Exactly -Times 1 -Scope It + Assert-MockCalled Set-CMDistributionPoint -Exactly -Times 1 -Scope It + } + + It 'Should call expected commands when setting a Pxe password' { + Mock -CommandName Get-TargetResource -MockWith { $getStatusPresentNoPassword } + + Set-TargetResource @inputParamsPxePassword + Assert-MockCalled Import-ConfigMgrPowerShellModule -Exactly -Times 1 -Scope It + Assert-MockCalled Set-Location -Exactly -Times 2 -Scope It + Assert-MockCalled Get-TargetResource -Exactly -Times 1 -Scope It + Assert-MockCalled Set-CMDistributionPoint -Exactly -Times 1 -Scope It + } + } + + Context 'When running Set-TargetResource should throw' { + + It 'Should throw and call expected commands when distribution point rule is not installed' { + Mock -CommandName Get-TargetResource -MockWith { $getStatusAbsent } + + { Set-TargetResource @inputParamsMatch } | Should -Throw -ExpectedMessage $distroPointError + Assert-MockCalled Import-ConfigMgrPowerShellModule -Exactly -Times 1 -Scope It + Assert-MockCalled Set-Location -Exactly -Times 2 -Scope It + Assert-MockCalled Get-TargetResource -Exactly -Times 1 -Scope It + Assert-MockCalled Set-CMDistributionPoint -Exactly -Times 0 -Scope It + } + + It 'Should throw and call expected commands when specifying additional settings and setting EnablePxe to false' { + Mock -CommandName Get-TargetResource -MockWith { $getStatusPresentNoPassword } + + { Set-TargetResource @badInputPxeFalse } | Should -Throw -ExpectedMessage $pxeFalseThrow + Assert-MockCalled Import-ConfigMgrPowerShellModule -Exactly -Times 1 -Scope It + Assert-MockCalled Set-Location -Exactly -Times 2 -Scope It + Assert-MockCalled Get-TargetResource -Exactly -Times 1 -Scope It + Assert-MockCalled Set-CMDistributionPoint -Exactly -Times 0 -Scope It + } + + It 'Should throw and call expected commands when trying to enable NonWdsPxe and Multicast is currently enabled' { + Mock -CommandName Get-TargetResource -MockWith { $getReturnMulticastEnabled } + + { Set-TargetResource @setNonWdsEnabled } | Should -Throw -ExpectedMessage $nonWdsThrow + Assert-MockCalled Import-ConfigMgrPowerShellModule -Exactly -Times 1 -Scope It + Assert-MockCalled Set-Location -Exactly -Times 2 -Scope It + Assert-MockCalled Get-TargetResource -Exactly -Times 1 -Scope It + Assert-MockCalled Set-CMDistributionPoint -Exactly -Times 0 -Scope It + } + } + } + + Describe "$moduleResourceName\Test-TargetResource" { + Mock -CommandName Set-Location + Mock -CommandName Import-ConfigMgrPowerShellModule + + Context 'When running Test-TargetResource and get returns present' { + + It 'Should return desired result true settings match' { + Mock -CommandName Get-TargetResource -MockWith { $getStatusPresentNoPassword } + + Test-TargetResource @inputParamsMatch | Should -Be $true + } + + It 'Should return desired result false settings do not match' { + Mock -CommandName Get-TargetResource -MockWith { $getStatusPresentNoPassword } + + Test-TargetResource @inputParamsMismatch | Should -Be $false + } + + It 'Should return desired result false settings when pxe password not present' { + Mock -CommandName Get-TargetResource -MockWith { $getStatusPresentNoPassword } + + Test-TargetResource @inputParamsPxePassword | Should -Be $false + } + + It 'Should return desired result false settings when server is not a distribution point' { + Mock -CommandName Get-TargetResource -MockWith { $getStatusAbsent } + + Test-TargetResource @inputParamsMatch | Should -Be $false + } + } + } + } +} +finally +{ + Invoke-TestCleanup +} From edbc61645380ac4fe8a3bb830f121a852cb88230 Mon Sep 17 00:00:00 2001 From: Easyreturns <20781445+jeffotterpohl@users.noreply.github.com> Date: Wed, 17 Jun 2020 16:13:00 -0500 Subject: [PATCH 2/3] Updated Pester Tests --- tests/Unit/CMPxeDistributionPoint.tests.ps1 | 290 ++++++++++++-------- 1 file changed, 175 insertions(+), 115 deletions(-) diff --git a/tests/Unit/CMPxeDistributionPoint.tests.ps1 b/tests/Unit/CMPxeDistributionPoint.tests.ps1 index 9e0052c..5d95b78 100644 --- a/tests/Unit/CMPxeDistributionPoint.tests.ps1 +++ b/tests/Unit/CMPxeDistributionPoint.tests.ps1 @@ -37,117 +37,28 @@ Invoke-TestSetup try { InModuleScope $script:dscResourceName { - $moduleResourceName = 'ConfigMgrCBDsc - DSC_CMPxeDistributionPoint' - - # Get input and output - $getDPInfo = @{ - IsPxe = $true - SCCMPxe = $true - SupportUnknownMachines = $true - UdaSetting = 0 - PxePassword = 'password' - IsActive = $true - ResponseDelay = 2 - IsMulticast = $false - } - - $getInput = @{ - SiteCode = 'Lab' - SiteServerName = 'DP01.contoso.com' - } - - # Test and Set - $getStatusAbsent = @{ - SiteCode = 'Lab' - SiteServerName = 'DP01.contoso.com' - EnablePxe = $null - EnableNonWdsPxe = $null - EnableUnknownComputerSupport = $null - PxePassword = $null - AllowPxeResponse = $null - PxeServerResponseDelaySec = 0 - UserDeviceAffinity = $null - IsMulticast = $null - DPStatus = 'Absent' - } - - $getStatusPresentNoPassword = @{ - SiteCode = 'Lab' - SiteServerName = 'DP01.contoso.com' - EnablePxe = $true - EnableNonWdsPxe = $true - EnableUnknownComputerSupport = $true - PxePassword = $null - AllowPxeResponse = $true - PxeServerResponseDelaySec = [UInt16]2 - UserDeviceAffinity = 'AllowWithManualApproval' - IsMulticast = $false - DPStatus = 'Present' - } - - $inputParamsMatch = @{ - SiteCode = 'Lab' - SiteServerName = 'DP01.contoso.com' - EnablePxe = $true - AllowPxeResponse = $true - PxeServerResponseDelaySec = 2 - UserDeviceAffinity = 'AllowWithManualApproval' - } - - $inputParamsMismatch = @{ - SiteCode = 'Lab' - SiteServerName = 'DP01.contoso.com' - EnablePxe = $true - AllowPxeResponse = $false - PxeServerResponseDelaySec = 1 - UserDeviceAffinity = 'DoNotUse' - } - $testCredential = New-Object ` - -TypeName System.Management.Automation.PSCredential ` - -ArgumentList 'DummyUsername', (ConvertTo-SecureString 'DummyPassword' -AsPlainText -Force) - - $inputParamsPxePassword = @{ - SiteCode = 'Lab' - SiteServerName = 'DP01.contoso.com' - PxePassword = $testCredential - } - - $distroPointError = 'The Distribution Point role on DP01.contoso.com is not installed, run DSC_CMDistibutionPoint to install the role.' - $pxeFalseThrow = 'Can not specify PXE settings when PXE is currently or setting to $false, please set EnablePxe to $true.' - - $badInputPxeFalse = @{ - SiteCode = 'Lab' - SiteServerName = 'DP01.contoso.com' - EnablePxe = $false - PxePassword = $testCredential - } - - $nonWdsThrow = 'You can not enable nonWDSPxe while multicast is set to enabled.' - - $getReturnMulticastEnabled = @{ - SiteCode = 'Lab' - SiteServerName = 'DP01.contoso.com' - EnablePxe = $true - EnableNonWdsPxe = $true - EnableUnknownComputerSupport = $true - PxePassword = $null - AllowPxeResponse = $true - PxeServerResponseDelaySec = [UInt16]2 - UserDeviceAffinity = 'AllowWithManualApproval' - IsMulticast = $true - DPStatus = 'Present' - } + Describe 'ConfigMgrCBDsc - DSC_CMPxeDistributionPoint\Get-TargetResource' -Tag 'Get' { + BeforeAll { + $getDPInfo = @{ + IsPxe = $true + SCCMPxe = $true + SupportUnknownMachines = $true + UdaSetting = 0 + PxePassword = 'password' + IsActive = $true + ResponseDelay = 2 + IsMulticast = $false + } - $setNonWdsEnabled = @{ - SiteCode = 'Lab' - SiteServerName = 'DP01.contoso.com' - EnableNonWdsPxe = $true - } + $getInput = @{ + SiteCode = 'Lab' + SiteServerName = 'DP01.contoso.com' + } - Describe "$moduleResourceName\Get-TargetResource" { - Mock -CommandName Import-ConfigMgrPowerShellModule - Mock -CommandName Set-Location + Mock -CommandName Import-ConfigMgrPowerShellModule + Mock -CommandName Set-Location + } Context 'When retrieving Collection settings' { @@ -189,12 +100,57 @@ try } } - Describe "$moduleResourceName\Set-TargetResource" { - Mock -CommandName Import-ConfigMgrPowerShellModule - Mock -CommandName Set-Location - Mock -CommandName Set-CMDistributionPoint + Describe 'ConfigMgrCBDsc - DSC_CMPxeDistributionPoint\Set-TargetResource' -Tag 'Set' { + BeforeAll { + $getStatusPresentNoPassword = @{ + SiteCode = 'Lab' + SiteServerName = 'DP01.contoso.com' + EnablePxe = $true + EnableNonWdsPxe = $true + EnableUnknownComputerSupport = $true + PxePassword = $null + AllowPxeResponse = $true + PxeServerResponseDelaySec = [UInt16]2 + UserDeviceAffinity = 'AllowWithManualApproval' + IsMulticast = $false + DPStatus = 'Present' + } + + $inputParamsMatch = @{ + SiteCode = 'Lab' + SiteServerName = 'DP01.contoso.com' + EnablePxe = $true + AllowPxeResponse = $true + PxeServerResponseDelaySec = 2 + UserDeviceAffinity = 'AllowWithManualApproval' + } + + $testCredential = New-Object ` + -TypeName System.Management.Automation.PSCredential ` + -ArgumentList 'DummyUsername', (ConvertTo-SecureString 'DummyPassword' -AsPlainText -Force) + + Mock -CommandName Import-ConfigMgrPowerShellModule + Mock -CommandName Set-Location + Mock -CommandName Set-CMDistributionPoint + } Context 'When Set-TargetResource runs successfully' { + BeforeEach { + $inputParamsMismatch = @{ + SiteCode = 'Lab' + SiteServerName = 'DP01.contoso.com' + EnablePxe = $true + AllowPxeResponse = $false + PxeServerResponseDelaySec = 1 + UserDeviceAffinity = 'DoNotUse' + } + + $inputParamsPxePassword = @{ + SiteCode = 'Lab' + SiteServerName = 'DP01.contoso.com' + PxePassword = $testCredential + } + } It 'Should call expected commands when settings match' { Mock -CommandName Get-TargetResource -MockWith { $getStatusPresentNoPassword } @@ -228,6 +184,52 @@ try } Context 'When running Set-TargetResource should throw' { + BeforeEach { + $distroPointError = 'The Distribution Point role on DP01.contoso.com is not installed, run DSC_CMDistibutionPoint to install the role.' + $pxeFalseThrow = 'Can not specify PXE settings when PXE is currently or setting to $false, please set EnablePxe to $true.' + $nonWdsThrow = 'You can not enable nonWDSPxe while multicast is set to enabled.' + + $badInputPxeFalse = @{ + SiteCode = 'Lab' + SiteServerName = 'DP01.contoso.com' + EnablePxe = $false + PxePassword = $testCredential + } + + $getReturnMulticastEnabled = @{ + SiteCode = 'Lab' + SiteServerName = 'DP01.contoso.com' + EnablePxe = $true + EnableNonWdsPxe = $true + EnableUnknownComputerSupport = $true + PxePassword = $null + AllowPxeResponse = $true + PxeServerResponseDelaySec = [UInt16]2 + UserDeviceAffinity = 'AllowWithManualApproval' + IsMulticast = $true + DPStatus = 'Present' + } + + $setNonWdsEnabled = @{ + SiteCode = 'Lab' + SiteServerName = 'DP01.contoso.com' + EnableNonWdsPxe = $true + } + + $getStatusAbsent = @{ + SiteCode = 'Lab' + SiteServerName = 'DP01.contoso.com' + EnablePxe = $null + EnableNonWdsPxe = $null + EnableUnknownComputerSupport = $null + PxePassword = $null + AllowPxeResponse = $null + PxeServerResponseDelaySec = 0 + UserDeviceAffinity = $null + IsMulticast = $null + DPStatus = 'Absent' + } + } It 'Should throw and call expected commands when distribution point rule is not installed' { Mock -CommandName Get-TargetResource -MockWith { $getStatusAbsent } @@ -261,9 +263,67 @@ try } } - Describe "$moduleResourceName\Test-TargetResource" { - Mock -CommandName Set-Location - Mock -CommandName Import-ConfigMgrPowerShellModule + Describe 'ConfigMgrCBDsc - DSC_CMPxeDistributionPoint\Test-TargetResource' -Tag 'Test' { + BeforeAll { + $getStatusAbsent = @{ + SiteCode = 'Lab' + SiteServerName = 'DP01.contoso.com' + EnablePxe = $null + EnableNonWdsPxe = $null + EnableUnknownComputerSupport = $null + PxePassword = $null + AllowPxeResponse = $null + PxeServerResponseDelaySec = 0 + UserDeviceAffinity = $null + IsMulticast = $null + DPStatus = 'Absent' + } + + $getStatusPresentNoPassword = @{ + SiteCode = 'Lab' + SiteServerName = 'DP01.contoso.com' + EnablePxe = $true + EnableNonWdsPxe = $true + EnableUnknownComputerSupport = $true + PxePassword = $null + AllowPxeResponse = $true + PxeServerResponseDelaySec = [UInt16]2 + UserDeviceAffinity = 'AllowWithManualApproval' + IsMulticast = $false + DPStatus = 'Present' + } + + $inputParamsMatch = @{ + SiteCode = 'Lab' + SiteServerName = 'DP01.contoso.com' + EnablePxe = $true + AllowPxeResponse = $true + PxeServerResponseDelaySec = 2 + UserDeviceAffinity = 'AllowWithManualApproval' + } + + $inputParamsMismatch = @{ + SiteCode = 'Lab' + SiteServerName = 'DP01.contoso.com' + EnablePxe = $true + AllowPxeResponse = $false + PxeServerResponseDelaySec = 1 + UserDeviceAffinity = 'DoNotUse' + } + + $testCredential = New-Object ` + -TypeName System.Management.Automation.PSCredential ` + -ArgumentList 'DummyUsername', (ConvertTo-SecureString 'DummyPassword' -AsPlainText -Force) + + $inputParamsPxePassword = @{ + SiteCode = 'Lab' + SiteServerName = 'DP01.contoso.com' + PxePassword = $testCredential + } + + Mock -CommandName Set-Location + Mock -CommandName Import-ConfigMgrPowerShellModule + } Context 'When running Test-TargetResource and get returns present' { From 124bf4dea0ba09dbd1b41fc2384e3f499fe5237a Mon Sep 17 00:00:00 2001 From: Easyreturns <20781445+jeffotterpohl@users.noreply.github.com> Date: Wed, 24 Jun 2020 06:07:59 -0500 Subject: [PATCH 3/3] updating PXE casing in text. --- README.md | 8 ++++---- .../CMPxeDistributionPoint_Disabled.ps1 | 2 +- .../CMPxeDistributionPoint_Enabled.ps1 | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index a24e1ed..95e7d69 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ Please check out common DSC Community [contributing guidelines](https://dsccommu - **CMReportingServicePoint**: Provides a resource for creating and managing the SCCM Reporting Service Point role. - **CMPxeDistributionPoint**: Provides a resource for modifying a distribution point - to changing to a Pxe enabled distribution point. + to changing to a PXE enabled distribution point. ### xSccmPreReqs @@ -766,7 +766,7 @@ Please check out common DSC Community [contributing guidelines](https://dsccommu role on. - **[Boolean] EnablePxe** _(Write)_: Indicates whether PXE is enabled on the distribution point. -- **[Boolean] EnableNonWdsPxe** _(Write)_: Specifies whether to enable Pxe responder +- **[Boolean] EnableNonWdsPxe** _(Write)_: Specifies whether to enable PXE responder without Windows Deployment services. - **[Boolean] EnableUnknownComputerSupport** _(Write)_: Indicates whether support for unknown computers is enabled. @@ -775,11 +775,11 @@ Please check out common DSC Community [contributing guidelines](https://dsccommu - **[UInt16] PxeServerResponseDelaySec** _(Write)_: Specifies, in seconds, how long the distribution point delays before it responds to computer requests. - **[String] UserDeviceAffinity** _(Write)_: Specifies how you want the distribution - point to associate users with their devices for Pxe deployments. + point to associate users with their devices for PXE deployments. - Values include: { DoNotUse | AllowWithManualApproval | AllowWithAutomaticApproval } - **[PSCredential] PxePassword** _(Write)_: Specifies, as a credential, the - Pxe password. + PXE password. - **[Boolean] IsMulticast** _(Read)_: Specifies if multicast is enabled. - **[String] DPStatus** _(Read)_: Specifies if the DP role is installed. diff --git a/source/Examples/Resources/CMPxeDistributionPoint/CMPxeDistributionPoint_Disabled.ps1 b/source/Examples/Resources/CMPxeDistributionPoint/CMPxeDistributionPoint_Disabled.ps1 index a9ae800..426173c 100644 --- a/source/Examples/Resources/CMPxeDistributionPoint/CMPxeDistributionPoint_Disabled.ps1 +++ b/source/Examples/Resources/CMPxeDistributionPoint/CMPxeDistributionPoint_Disabled.ps1 @@ -1,6 +1,6 @@ <# .SYNOPSIS - A DSC configuration script to disable Pxe Distribution Point for Configuration Manager. + A DSC configuration script to disable PXE Distribution Point for Configuration Manager. #> Configuration Example { diff --git a/source/Examples/Resources/CMPxeDistributionPoint/CMPxeDistributionPoint_Enabled.ps1 b/source/Examples/Resources/CMPxeDistributionPoint/CMPxeDistributionPoint_Enabled.ps1 index 26d77b2..0847d17 100644 --- a/source/Examples/Resources/CMPxeDistributionPoint/CMPxeDistributionPoint_Enabled.ps1 +++ b/source/Examples/Resources/CMPxeDistributionPoint/CMPxeDistributionPoint_Enabled.ps1 @@ -1,9 +1,9 @@ <# .SYNOPSIS - A DSC configuration script to configure Pxe Distribution Point for Configuration Manager. + A DSC configuration script to configure PXE Distribution Point for Configuration Manager. .PARAMETER PxePassword - Specify the password to be used for the Pxe. + Specify the password to be used for the PXE. #> Configuration Example {