Powershell 脚本错误日志
try{
Get-AD *>&1
}
catch{
Get-Date | Add-Content C:\ScriptErrors.txt
$_ | Add-Content C:\ScriptErrors.txt
"----------------------------------------------------------------------------------------
" | Add-Content C:\ScriptErrors.txt
}