You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been debugging my script for hours, and finally figured out that the format I did last time, broke my null-conditional operators as it adds spaces between the braces, for example:
$c=$a.{b}?.Trim();
Turns into
$c=$a.{ b }?.Trim();
Causing $c to be empty/null
I fixed this manually in my script but noticed that formatting changes it back - I think this is a wrong format for this specific use-case as it breaks these operators.
Prerequisites
Summary
I've been debugging my script for hours, and finally figured out that the format I did last time, broke my null-conditional operators as it adds spaces between the braces, for example:
Turns into
Causing
$c
to be empty/nullI fixed this manually in my script but noticed that formatting changes it back - I think this is a wrong format for this specific use-case as it breaks these operators.
Information about the operator: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_operators?view=powershell-7.4#null-conditional-operators--and-
PowerShell Version
Visual Studio Code Version
Extension Version
Steps to Reproduce
Visuals
No response
Logs
No response
The text was updated successfully, but these errors were encountered: