Output Screen warnings
perhaps simple question
i'm running power shell command -whatif parameter on serveral thousand objects. screen scrolls see various warnings. i'd output warnings further review. how output warnings log file?
thx
that's not simple question. is, assuming trying capture someting write-warning produce. there feature request can vote include ability redirect :
the workaround call cmd.exe /c , redirect output there:
cmd /c powershell.exe -file 'c:\writewarning.ps1' > c:\output.txt
this assumes writewarning.ps1 file has line has this:
write-warning "blah"
alternatively you can use start-transcript if running on supported os transcripts.
http://twitter.com/toenuff
write-host ((0..56)|%{if (($_+1)%3 -eq 0){[char][int]("116111101110117102102064103109097105108046099111109"[($_-2)..$_] -join "")}}) -separator ""
Windows Server > Windows PowerShell
Comments
Post a Comment