FormatPowershellCode
FormatPowershellCode copied to clipboard
Infinite new lines
Heya, I've written a script that looks at a directory and runs the formatter every second on all .ps1 files.
When it came to this code,
Write-Host($subs | Format-Table -Property @{name="Option";expression={$global:indexSub;$global:indexSub+=1}}, SubscriptionId, SubscriptionName | Out-String)
The formatter adds a newline to the front of Out-String, eventually it becomes:
Write-Host($subs |
Format-Table -Property @{name="Option";expression={$global:indexSub;$global:indexSub+=1}}, SubscriptionId, SubscriptionName |
Out-String)
And that blank space increases ad infinitum.
What is the exact formatting code you are using so I can replicate this issue?
I'm doing this:
Get-Content $scriptName -raw |
Format-ScriptReplaceHereStrings |
Format-ScriptReduceLineLength |
Format-ScriptFormatCodeIndentation
Thanks :)