-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Closed
Labels
Issue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Engine-Format
Description
Put this in a file like testme.ps1:
param(
[switch]$skip = $false,
[switch]$weird = $false
)
if (! $skip) {
$weird # skip this line and it works!
}
$hash2=@{}
$hash2["aaa"]=1
"hash value is"
$hash2
Without the -skip parameter, nothing gets printed for the hash value...
PS C:\temp> powershell .\testme.ps1
IsPresent
---------
False
hash value is
PS C:\temp> powershell .\testme.ps1 -skip
hash value is
Name Value
---- -----
aaa 1
PS C:\temp>
I would have expected the hash value output to be the same in both cases?
I see the same behavior on Core 7.1.3 and Desktop 5.1.19041.906.
Is there a workaround?
Thanks.
Metadata
Metadata
Assignees
Labels
Issue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Engine-Format