## 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

Name | Type | Description | Required? | Pipeline Input | Default Value
--- | --- | --- | --- | --- | ---
Task | Task[] | Specifies the tasks you want to stop. | true | true (ByValue)
Confirm | SwitchParameter | If 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. | false | false
WhatIf | SwitchParameter | Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified. | false | false

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.