Skip to content

Latest commit

 

History

History

Requires

Directive #requires

#requires works more or less as documented and expected in PowerShell 2.0. In PowerShell 3.0 it does not.

See help about_Requires:

The #Requires statement must be the first item on a line in a script.

This is not true, see requires-not-first.ps1 and requires-with-leading-space.ps1.

Another oddity is that something like #requiresGarbage is treated as #requires.

Scripts