How to detect powershell commandlets that fail because they need administrator?
Assuming I have a powershell function to run a command and log the output to file that other scripts are also logging to, is there a generic way to detect that a PowerShell commandlet has not executed to completion because it requires Administrator privileges?