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

Java Control Panel Icon "Application Not Found"

Enterprise CA option is greyed out / unavailable

Unable to connect to Wireless profile being pushed using GPO