Link to home
Start Free TrialLog in
Avatar of Kelly Garcia
Kelly GarciaFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Powershell warning when running script


When I run my powershell script and getting those warning, how do i stop them from appearing?

WARNING: 16:10:30 - *** The namespace for all the model classes will change from
Microsoft.Azure.Management.Monitor.Management.Models to Microsoft.Azure.Management.Monitor.Models in future releases.
WARNING: 16:10:30 - *** The namespace for output classes will be uniform for all classes in future releases to make it
independent of modifications in the model classes.
WARNING: 16:10:30 - The arguments Categories and Timegrains now have aliases Category and Timegrain respectively. The
plural names will be removed in future releases.

Open in new window

Thank you for your help.

Avatar of Michael B. Smith
Michael B. Smith
Flag of United States of America image

The "warning stream" is number 3.  So re-direct that output to $null.

For example:

write-warning "this is warning text" 3>$null

Open in new window

If you are working with a pipeline, that redirection goes BEFORE the pipe symbol, immediately to the right of the cmdlet generating the warning.
Avatar of oBdA

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial