Windows PowerShell ‘#Requires’ Statement

The #Requires is a statement that prevents the script or module to run if the prerequisites defined with the requirement isn’t met. The statement can appear on any line in a script but must be the first item on a line. A script can include more than one #Requires statement.

To find out which parameters can be used, type

Get-Help about_requires

in the Windows PowerShell Console.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.