Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

ScriptRequirements Class

Definition

Namespace:
System.Management.Automation.Language
Assembly:
System.Management.Automation.dll
Package:
Microsoft.PowerShell.5.1.ReferenceAssemblies v1.0.0
Package:
System.Management.Automation v7.4.15
Package:
System.Management.Automation v7.5.6
Package:
System.Management.Automation v7.6.1

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

public ref class ScriptRequirements
public class ScriptRequirements
type ScriptRequirements = class
Public Class ScriptRequirements
Inheritance
ScriptRequirements

Constructors

Name Description
ScriptRequirements()

Properties

Name Description
IsElevationRequired

Specifies if this script requires elevated privileges, specified like: #requires -RunAsAdministrator If nothing is specified, this property is false.

RequiredApplicationId

The application id this script requires, specified like: #requires -Shellid Shell If no application id has been specified, this property is null.

RequiredAssemblies

The assemblies this script requires, specified like: #requires -Assembly path\to\foo.dll#requires -Assembly "System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" If no assemblies are required, this property is an empty collection.

RequiredModules

The modules this script requires, specified like: #requires -Module NetAdapter#requires -Module @{Name="NetAdapter"; Version="1.0.0.0"} If no modules are required, this property is an empty collection.

RequiredPSEditions

The PowerShell Edition this script requires, specified like: #requires -PSEdition Desktop If no PSEdition has been specified, this property is an empty collection.

RequiredPSVersion

The PowerShell version this script requires, specified like: #requires -Version 3 If no version has been specified, this property is null.

RequiresPSSnapIns

The snapins this script requires, specified like: #requires -PSSnapin Snapin#requires -PSSnapin Snapin -Version 2 If no snapins are required, this property is an empty collection.

Applies to