Error object blocks with open brace on newline
Posted: Tue Jun 18, 2019 2:00 pm
Product: PowerShell Studio 2019 (64 Bit)
Build: v5.6.160
OS: Windows 10 Enterprise (64 Bit)
Build: v10.0.17763.0
Hi guys, A slightly annoying issue with powershell is that it does not recognize the object script blocks with an open brace on a newline. I am in the habit (rightly or wrongly) of placing braces on a newline (except under these situations) and occasionally I forget.
PSS does not see this as an error and the script packages up ok but when you go to run it you get that awesome blocking user input request
cmdlet ForEach-Object at command pipeline position 1
Supply values for the following parameters:
eg.
This is good...
(1..3) | ?{ $_ -eq 1 }
This is NOT...
(1..3) | ?
{
$_ -eq 1
}
Maybe a future PS build will handle this but in the meantime would it be possible for PSS to detect this situation as an ERROR?
Thanks
Build: v5.6.160
OS: Windows 10 Enterprise (64 Bit)
Build: v10.0.17763.0
Hi guys, A slightly annoying issue with powershell is that it does not recognize the object script blocks with an open brace on a newline. I am in the habit (rightly or wrongly) of placing braces on a newline (except under these situations) and occasionally I forget.
PSS does not see this as an error and the script packages up ok but when you go to run it you get that awesome blocking user input request
cmdlet ForEach-Object at command pipeline position 1
Supply values for the following parameters:
eg.
This is good...
(1..3) | ?{ $_ -eq 1 }
This is NOT...
(1..3) | ?
{
$_ -eq 1
}
Maybe a future PS build will handle this but in the meantime would it be possible for PSS to detect this situation as an ERROR?
Thanks