Skip to content

Commit

Permalink
Merge pull request #70 from danielboth/fix-verbose-boundparameter
Browse files Browse the repository at this point in the history
xRDRemoteApp strip common parameters in Test-TargetResource
  • Loading branch information
danielboth authored Mar 25, 2020
2 parents 581908b + 371736d commit ececb38
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Changed resouce key from Server alone to Role + Server.
This allows the resource to be used multiple times for different roles on
the same server. (Issue #62)
- Changes to xRemoteApp
- Fix xRDRemoteApp Test-TargetResource to not test PowerShell common parameters

## 1.9.0.0

Expand Down
4 changes: 4 additions & 0 deletions source/DSCResources/MSFT_xRDRemoteApp/MSFT_xRDRemoteApp.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,10 @@ function Test-TargetResource
$testTargetResourceResult = $true

$getTargetResourceResult = Get-TargetResource @PSBoundParameters
[System.Management.Automation.PSCmdlet]::CommonParameters | Foreach-Object -Process {
$null = $PSBoundParameters.Remove($_)
}

$PSBoundParameters.Keys | ForEach-Object -Process {
if ($PSBoundParameters[$_] -ne $getTargetResourceResult[$_])
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
Import-Module -Name "$PSScriptRoot\..\..\Modules\xRemoteDesktopSessionHostCommon.psm1"
if (!(Test-xRemoteDesktopSessionHostOsRequirement)) { throw "The minimum OS requirement was not met."}
if (!(Test-xRemoteDesktopSessionHostOsRequirement))
{
throw "The minimum OS requirement was not met."
}
Import-Module RemoteDesktop

#######################################################################
Expand Down

0 comments on commit ececb38

Please sign in to comment.