this code my teacher gave it to us as homework and it does not work with me idk why

VonPryz is correct, Please try the below code Write-Host “checking users” $testUser=”hgallo” $checkUser = Get-WmiObject -Class Win32_UserAccount -Filter “LocalAccount=”True”” | Select-String -Pattern $testUser if($checkUser -ne $null) { Write-Host “user $testUser found” } else { Write-Host “user $testUser not found” } The error in the code was stating that the -Pattern parameter was failing because the … Read more