New-CMGlobalConditionScript

Creates a Script type global condition in Configuration Manager.

Syntax

New-CMGlobalConditionScript
   -DataType <GlobalConditionDataType>
   -FilePath <String>
   -ScriptLanguage <ScriptingLanguage>
   [-Use32BitHost <Boolean>]
   [-UseLoggedOnUserCredential <Boolean>]
   [-Description <String>]
   -Name <String>
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [<CommonParameters>]
New-CMGlobalConditionScript
   -DataType <GlobalConditionDataType>
   -ScriptLanguage <ScriptingLanguage>
   -ScriptText <String>
   [-Use32BitHost <Boolean>]
   [-UseLoggedOnUserCredential <Boolean>]
   [-Description <String>]
   -Name <String>
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [<CommonParameters>]

Description

The New-CMGlobalConditionScript cmdlet creates a Script type global condition in Configuration Manager.

A global condition is a setting or expression in Configuration Manager that you can use to specify how Configuration Manager provides and deploys an application to clients.

Note

Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>. For more information, see getting started.

Examples

Example 1

$GlobalScript = New-CMGlobalConditionScript -DataType String -ScriptText $string -ScriptLanguage JScript -Name GC5

This command creates a Script type global condition in Configuration Manager.

Parameters

-DataType

Specifies a data type.

Type:GlobalConditionDataType
Accepted values:String, DateTime, Integer, FloatingPoint, Version, Boolean
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Description

Specifies a description.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DisableWildcardHandling

This parameter treats wildcard characters as literal character values. You can't combine it with ForceWildcardHandling.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-FilePath

Specifies a file path of the script. You can use Windows PowerShell, VBScript, or JScript scripts.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ForceWildcardHandling

This parameter processes wildcard characters and may lead to unexpected behavior (not recommended). You can't combine it with DisableWildcardHandling.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

Specifies a name.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ScriptLanguage

Specifies a script language.

Type:ScriptingLanguage
Accepted values:JScript, PowerShell, VBScript
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ScriptText

Specifies a script string.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Use32BitHost

Indicate whether to use 32-bit host.

Type:Boolean
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-UseLoggedOnUserCredential

If you enable this option, the script will run on client computers by using the credentials of the user who is signed in.

Type:Boolean
Aliases:UseLoggedOnUserCredentials
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None

Outputs

System.Object