Add-VMHostAssignableDevice
Adds an assignable device to a virtual machine (VM) host.
Syntax
Path (Default)
Add-VMHostAssignableDevice
-ResourcePoolName <String[]>
[-CimSession <CimSession[]>]
[-ComputerName <String[]>]
[-Credential <PSCredential[]>]
[-Force]
[-InstancePath <String>]
[-LocationPath <String>]
[<CommonParameters>]
Object
Add-VMHostAssignableDevice
[-HostAssignableDevice] <VMHostAssignableDevice[]>
-ResourcePoolName <String[]>
[-Force]
[<CommonParameters>]
Description
The Add-VMHostAssignableDevice
cmdlet assigns a hardware device to a virtual machine host. You
can add devices to the VM host by providing either the instance or ___location path of the device, or
by specifying an existing host-assignable device object.
Examples
Example 1
$params = @{
ComputerName = "MyVM01"
InstancePath = "PCI\VEN_8086&DEV_0F48&SUBSYS_72708086&REV_0B\3&11583659&0&D8"
ResourcePoolName = "MyResourcePool"
}
Add-VMHostAssignableDevice $params
This example assigns a device identified by its instance path to VM host MyVM01 within the resource pool MyResourcePool.
Example 2
$gpu = Get-VMHostAssignableDevice
Add-VMHostAssignableDevice -HostAssignableDevice $gpu -ResourcePoolName "GpuChildPool"
This example retrieves a list of GPUs or other assignable devices and adds these devices to a resource pool named GpuChildPool, making the devices available for use by virtual machines in that resource pool.
Parameters
-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
Path
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-ComputerName
Specifies the name of the Hyper-V host to which the device is to be added. 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
Path
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
Path
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-Force
Forces the command to run without asking for user confirmation.
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 |
-HostAssignableDevice
Specifies the device object to be assigned to the virtual machine.
Parameter properties
Type: | VMHostAssignableDevice[] |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | VMHostAssignableDevice |
Parameter sets
Object
Position: | 0 |
Mandatory: | True |
Value from pipeline: | True |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-InstancePath
Represents the Device Instance path in the host machine.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
Path
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-LocationPath
Specifies the ___location path to the assignable device.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
Path
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-ResourcePoolName
Specifies the name of the resource pool to which the device is assigned.
Parameter properties
Type: | String[] |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | True |
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.