Format Script hoses foreach loops in some cases.
Posted: Mon Jul 14, 2014 7:11 am
In PowerShell Studio 4.1.62, when I hit Format Script, it hoses several foreach statements in my code. Is there something I'm doing wrong?
What should look like this:
What should look like this:
Ends up like this:$erc_xml.configuration.InstanceConfigurationData.InstanceConfiguration.add | foreach { If ($_.AdfsWhr -eq $Identifier)
...
By putting the command for the foreach on the next line, foreach won't work correctly. I had to go through and fix a bunch of these after being bit by it today. Is there something I can do to avoid this?$erc_xml.configuration.InstanceConfigurationData.InstanceConfiguration.add | foreach
{
If ($_.AdfsWhr -eq $Identifier)
{...