-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-AnsweredThe question is answered.The question is answered.
Description
if condition checking for a null variable is incorrect in Powershell 7 (rc3)
Steps to reproduce
- Run this code in Powershell 7(rc3)
$Body = $Body | ConvertTo-Json -Depth 10 -Compress
if ($Body) {
Write-Host "I am not Null."
}
else{
Write-Host "I am NULL."
}
Expected behavior
It should show "I am NULL."
Actual behavior
It shows "I am not Null.".
Here is the screenshot. I run the same scripts in Powershell 7 (rc3), Powershell 6 and Powershell 5. It works correctly in PS5 and 6 but not in PS7rc3.
Environment data
Name Value
---- -----
PSVersion 7.0.0-rc.3
PSEdition Core
GitCommitId 7.0.0-rc.3
OS Microsoft Windows 10.0.18363
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
```
Metadata
Metadata
Assignees
Labels
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-AnsweredThe question is answered.The question is answered.
