Edit

Share via


Remove-VMGpuPartitionAdapter

Removes an assigned GPU partition from a virtual machine.

Syntax

VMName (Default)

Remove-VMGpuPartitionAdapter
    [-VMName] <String[]>
    [-CimSession <CimSession[]>]
    [-ComputerName <String[]>]
    [-Credential <PSCredential[]>]
    [-Passthru]
    [-AdapterId <String>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

VMObject

Remove-VMGpuPartitionAdapter
    [-VM] <VirtualMachine[]>
    [-Passthru]
    [-AdapterId <String>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Object

Remove-VMGpuPartitionAdapter
    [-VMGpuPartitionAdapter] <VMGpuPartitionAdapter[]>
    [-Passthru]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Remove-VMGpuPartitionAdapter cmdlet removes an assigned graphic processing unit partition from a virtual machine and releases that partition back to the host GPU.

Examples

Example 1

$testvm = Get-VM "TestVM"
Remove-VMGpuPartitionAdapter -VM $testvm

This example removes a partition assigned to a specific VM object.

Example 2

$testvm = Get-VM "TestVM"
$GPUpartition = Get-VMGpuPartitionAdapter -VM $testvm
Remove-VMGpuPartitionAdapter -VM $testvm -AdapterId $GPUpartiton[0].id

This example removes a specific partition object from a specific VM.

Parameters

-AdapterId

This is a VM's GPU partition identification number used to remove a GPU from a VM.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

VMName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
VMObject
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-CimSession

Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session object, such as the output of a New-CimSession or Get-CimSession cmdlet. The default is the current session on the local computer.

Parameter properties

Type:

CimSession[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

VMName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ComputerName

Specifies one or more Hyper-V hosts on the virtual network adapters are to be retrieved. NetBIOS names, IP addresses, and fully qualified domain names are allowed. The default is the local computer.Use localhost or a dot (.) to specify the local computer explicitly.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

VMName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Credential

Specifies one or more user accounts that have permission to perform this action. The default is the current user.

Parameter properties

Type:

PSCredential[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

VMName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Passthru

Returns an object for each process that the cmdlet started.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-VM

Specifies the virtual machine whose virtual network adapters are to be retrieved. The asterisk (*) is the wildcard. If it is specified the cmdlet returns virtual network adapters from every virtual machine in the system.

Parameter properties

Type:

VirtualMachine[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

VMObject
Position:0
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-VMGpuPartitionAdapter

GPU partition object obtained from Get-VMGpuPartitionAdapter.

Parameter properties

Type:

VMGpuPartitionAdapter[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

Object
Position:0
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-VMName

Specifies the name of the virtual machine whose network adapters are to be removed.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

VMName
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

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

Inputs

Microsoft.HyperV.PowerShell.VirtualMachine

Microsoft.HyperV.PowerShell.VMGpuPartitionAdapter

Outputs

Microsoft.HyperV.PowerShell.VMGpuPartitionAdapter