Remoe whitelines in file through PowerShell

3/13/2014 0 Comments

In need of removing all white lines in a file quickly use the below script.
(Get-Content c:\temp\script.ps1) | ? {$_.trim() -ne ""} | Set-Content c:\temp\script.ps1


0 comments :