Skip to content

Commit deec1bb

Browse files
committed
Test-TargetResource returning non-boolean value.
If only passing in the $Name parameter to Test-TargetResource, the only required parameter, and $Name –eq $env:COMPUTERNAME, you drop to the bottom of the function and the function completes without returning a bool, causing an error. Since all false cases are covered with existing return, a true return was added to the end of the function.
1 parent a0510cd commit deec1bb

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

DSCResources/MSFT_xComputer/MSFT_xComputer.psm1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,8 @@ function Test-TargetResource
220220
Write-Verbose -Message "Checking if workgroup name is $WorkGroupName"
221221
return ($WorkGroupName -eq (gwmi WIN32_ComputerSystem).WorkGroup)
222222
}
223+
224+
return $true
223225
}
224226

225227
function ValidateDomainOrWorkGroup($DomainName, $WorkGroupName)

0 commit comments

Comments
 (0)