Get-CMTSStepRunCommandLine
Get the Run Command Line step from a specific task sequence.
Syntax
Get-CMTSStepRunCommandLine
[-InputObject] <IResultObject>
[-StepName <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Get-CMTSStepRunCommandLine
[-TaskSequenceId] <String>
[-StepName <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Get-CMTSStepRunCommandLine
[-TaskSequenceName] <String>
[-StepName <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Use this cmdlet to get a task sequence step object for one or more instances of the Run Command Line step. You can use this object to:
- Remove the step from a task sequence with Remove-CMTSStepRunCommandLine
- Copy the step to another task sequence with Add-CMTaskSequenceStep
For more information on this step, see About task sequence steps: Run Command Line.
Note
Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>. For more information, see getting started.
Examples
Example 1
This example first gets a task sequence object in the $ts variable. It then passes that variable as the input object to get the Run Command Line step.
$tsName = "Custom task sequence"
$ts = Get-CMTaskSequence -Name $tsName -Fast
$tsStepNameRunCmd = "Run Command Line"
$tsStepRunCmd = Get-CMTSStepRunCommandLine -InputObject $ts -StepName $tsStepNameRunCmd
Parameters
-Confirm
Prompts you for confirmation before running the cmdlet.
| Type: | SwitchParameter |
| Aliases: | cf |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
-InputObject
Specify a task sequence object from which to get the Run Command Line step. To get this object, use the Get-CMTaskSequence cmdlet.
| Type: | IResultObject |
| Aliases: | TaskSequence |
| Position: | 0 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
-StepName
Specify the name of the Run Command Line step to get from the task sequence.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
-TaskSequenceId
Specify the package ID of the task sequence from which to get the Run Command Line step. This value is a standard package ID, for example XYZ00858.
| Type: | String |
| Aliases: | Id, TaskSequencePackageId |
| Position: | 0 |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
-TaskSequenceName
Specify the name of the task sequence from which to get the Run Command Line step.
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet doesn't run.
| Type: | SwitchParameter |
| Aliases: | wi |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Inputs
Microsoft.ConfigurationManagement.ManagementProvider.IResultObject
Outputs
System.Object
Related Links
Feedback
Submit and view feedback for