Im having issues getting -ErrorAction SilentlyContinue to work with cmdlet 'Get-ADUser'
This doesn't work, the error is displayed with or without -ErrorAction?
get-aduser "JSmith" -ErrorVariable Err -ErrorAction SilentlyContinue
if ($Err){write-host "This is an error!!!!"}
This works (No error is display and silently continues, under the same conditions?
get-childitem z: -ErrorVariable Err -ErrorAction SilentlyContinue
if ($Err){write-host "This is an error!!!!"}