It's no secret that some code has prerequisites that need to be met in order for it to work. In PowerShell, certain types of requirements can be specified in scripts using a #REQUIRES
statement. Although the #REQUIRES
statement looks like a comment (that is, it starts with #
), it is a statement to the engine that tells PowerShell not to run the script unless the requirements are met. As of PowerShell Version 4.0, the following options are available in a #REQUIRES
statement:
When the conditions of the #REQUIRES
statement are not met, or cannot be met, the...