PowerShell Where-Object for Null or Empty Values
To find null or empty values with Where-Object, test the property with [string]::IsNullOrWhiteSpace(). It catches $null, empty strings and values that are only spaces. Here it finds employees with no department in a CSV file: Output: Dan’s department is two spaces, so it looks filled in but isn’t. To keep only the rows that have … Read more