Closed LaurentDardenne closed 5 years ago
Same error with Exists KeyWord:
$Path='C:\temp'
$Rule='Test.Rule.ps1'
@'
Rule 'All' {
Exists Name
}
'@ >"$Path\$Rule"
$Result= [PSCustomObject]@{PSTypeName='My';name='Test'},(1|Select Name)|Invoke-PSRule -path "$Path\$Rule"
# System.NullReferenceException
[edit] The keyword Match also has the same problem.
@LaurentDardenne Great. Thank you for reporting the issue.
@LaurentDardenne The issue a related to binding TargetName
, so would affect all use cases and is not specific to keywords. Thanks again for reporting.
Description of the issue TypeOf raises a NullReferenceException if a TargetObject property contains null.
Steps to reproduce the issue:
Error output
Capture any error messages and or verbose messages with
-Verbose
.Module in use and version:
Captured output from
$PSVersionTable
: