I'm trying to make a simple check for a log file if it's empty or not
if (Get-Content path-to-file) {
do stuff
}
Issue is that the file may contain a white-space only and return true
I tried .replace(" ", "") and .trim() still returns true, what can I do?
@(' ', '', ' ').Where({-not [string]::IsNullOrWhiteSpace($_)})