Possible Duplicate:
Is there a PowerShell code formatter / pretty printer?
Does anyone know of a tool that you can use to re-format/tidy Powershell code:-
Eg:-
if ($c -eq "Cat")
{
$a="Bubble"
}
else
{
$a="Trouble"
}
Write-Host $a
To:-
if ($c -eq "Cat")
{
$a="Bubble"
}
else
{
$a="Trouble"
}
Write-Host $a
ie, tabbing If Statements etc, I know they was tools to do it with VB but I haven't seen any for Powershell yet?
Quick update - it's now on GitHub: https://github.com/DTW-DanWard/PowerShell-Beautifier I wrote a PowerShell pretty printer / code cleaner in PowerShell. It cleans white space, indents code groups, replaces aliases with commands, fixes casing on commands, parameters, types, etc. You can use it to reformat a file in place or read a source file and output the result in a different file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With