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"