Stop-Task Command | Vmware PowerCLI Reference

Stop-Task

This cmdlet stops the tasks specified by the Task parameter.

Syntax

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

Parameters

Required Parameter Name Type Position Features Description
required
Task Task[] named
  • pipeline
Specifies the tasks you want to stop.

Output

Examples

Example 1

Import-Module VMware.VimAutomation.Core

$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. This example uses commands from the VMware.VimAutomation.Core module.

Related Commands

Task

This cmdlet retrieves the tasks on the specified VMware Server.

This cmdlet stops the specified tasks.

This cmdlet waits for the completion of the specified tasks.