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

SCCM PXE Error after booting – The certificate associated with this media has expired

Rearm the Office 2013 installation

Computers not joining domain in SCCM task sequence