Remove Empty lines from text file

Sample Code:

get-content "C:\users\sumeet.kumar\Desktop\Services\Scripts\Power Shell Scripts\List All Secondry Drive\sumeet1.txt" | Foreach-Object { ($_  -replace '\s','') } > "C:\Users\sumeet.kumar\Desktop\Services\Scripts\Power Shell Scripts\List All Secondry Drive\FileWithNoEmptyLines.txt"

Comments

Popular posts from this blog

Enterprise CA option is greyed out / unavailable

Rearm the Office 2013 installation

MP has rejected registration request due to failure in client certificate