Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Get Write-Warning outputs

$
0
0

Hey,

all of you know the command Write-Error and the Variable $Error which contains the errors that were written.


Is this possible with Write-Warning, too?
I already read about the parameter 'WarningVariable' (http://social.technet.microsoft.com/Forums/windowsserver/en-US/0ed197ad-c3cf-4444-b562-3fa08f9e1c6b/how-do-you-catch-warning-output?forum=ITCG)  but from my point of view this is not working exactly like $error.
Because $error catches ALL Write-Error events - event if they are not produced especially by me but on any kind of error (I can't make sure external written cmdlets or scripts are using the -WarningVariable parameter :(
Is there a variable that automatically contais all Write-Warning events?

Thank you for help

mk-maddin


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>