PowerCLI Reference

Stop-Task

Synopsis

This cmdlet stops the specified tasks.

Syntax

Stop-Task [-Task] <Task[]> [-WhatIf] [-Confirm] [<CommonParameters>]

Related Commands

Online version
Get-Task
Wait-Task

Detailed Description

This cmdlet stops the tasks specified by the Task parameter.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
TaskTask[]Specifies the tasks you want to stop.truetrue (ByValue)
ConfirmSwitchParameterIf the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation.falsefalse
WhatIfSwitchParameterIndicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.falsefalse

Return Type

None

Notes

Examples

-------------- Example 1 --------------

$vm = Get-VM -Name "VM1"

$datacenter = Get-Datacenter -Name "Datacenter1"

$task = New-Template -Name "Template1" -Location $datacenter -VM $vm -RunAsync

Stop-Task -Task $task

Stops the process of creating a new template from a virtual machine.


Copyright © VMware, Inc. All rights reserved.