If you're determining whether or not to print depending on the value of the -Verbose parameter, consider using Write-Verbose instead of Write-Host: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/write-verbose?view=powershell-7.1