about_requires.help

about_requires.help - TOPIC about_Requires SHORT...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 TOPIC about_Requires SHORT DESCRIPTION Prevents a script from running by requiring the specified snap-ins and version. LONG DESCRIPTION The #Requires statement prevents a script from running unless the Windows PowerShell version, snap-in, and snap-in version prerequisites are met. If the prerequisites are not met, Windows PowerShell does not run the script. You can use #Requires statements in any script. You cannot use them in functions, cmdlets, or snap-ins. Syntax Use the following syntax to specify the snap-in and the version of the snap-in that you want to require: Use the following syntax to specify the minimum version of Windows PowerShell that you want to require: #requires -Version <N>[.<n>] Use the following syntax to specify the shell that you want to require: Rules for Use - The #Requires statement must be the first item on a line in a script. - A script can include more than one #Requires statement.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

about_requires.help - TOPIC about_Requires SHORT...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online