Click or drag to resize
New-DtTaskParameters

Creates a parameter set to be used with the Invoke-DtQueueTask cmdlet.

Syntax

New-DtTaskParameters [-ScriptPath] <String> [-Arguments] <String> [<CommonParameters>]

Parameters
-ScriptPath<String>

Specify the full path and script name.

Required?

true

Position?

1

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Arguments<String>

Specify any arguments that need to be passed to the script.

Required?

false

Position?

2

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see about_CommonParameters.

Examples

------------------EXAMPLE 1------------------

The script called ScriptName, located in C:\PathDir, along with two arguments, is stored in the variable DtScript.

$DtScript = New-DtTaskParameters -ScriptPath "C:\PathDir\ScriptName" -Arguments "arg1 arg2"

------------------EXAMPLE 2------------------

The script to launch PowerShell and run the script called Script.ps1, located in C:\PathDir, along with two arguments and the ExecutionPolicy parameter, is stored in the variable DtPsScript.

$DtPsScript = New-DtTaskParameters -ScriptPath "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -Arguments "-File ""C:\PathDir\Script.ps1"" ""-Arg1 argument1_info -Arg2 argument2_info"" -ExecutionPolicy RemoteSigned"