Skip to content

Commit 00ba326

Browse files
authored
Merge branch 'main' into update_vmassignabledevice
2 parents 3791bf2 + 4eeec28 commit 00ba326

5 files changed

+1099
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
1+
---
2+
description: Assigns a device to a virtual machine host.
3+
external help file: Microsoft.HyperV.PowerShell.Cmdlets.dll-Help.xml
4+
Module Name: Hyper-V
5+
ms.date: 06/12/2024
6+
online version: https://learn.microsoft.com/powershell/module/hyper-v/add-vmhostassignabledevice?view=windowsserver2022-ps&wt.mc_id=ps-gethelp
7+
schema: 2.0.0
8+
title: Add-VMHostAssignableDevice
9+
---
10+
11+
# Add-VMHostAssignableDevice
12+
13+
## SYNOPSIS
14+
Adds an assignable device to a virtual machine (VM) host.
15+
16+
## SYNTAX
17+
18+
### Path (Default)
19+
20+
```
21+
Add-VMHostAssignableDevice [-CimSession <CimSession[]>] [-ComputerName <String[]>]
22+
[-Credential <PSCredential[]>] [-Force] [-InstancePath <String>] [-LocationPath <String>]
23+
-ResourcePoolName <String[]> [<CommonParameters>]
24+
```
25+
26+
### Object
27+
28+
```
29+
Add-VMHostAssignableDevice [-Force] [-HostAssignableDevice] <VMHostAssignableDevice[]>
30+
-ResourcePoolName <String[]> [<CommonParameters>]
31+
```
32+
33+
## DESCRIPTION
34+
35+
The `Add-VMHostAssignableDevice` cmdlet assigns a hardware device to a virtual machine host. You
36+
can add devices to the VM host by providing either the instance or location path of the device, or
37+
by specifying an existing host-assignable device object.
38+
39+
## EXAMPLES
40+
41+
### Example 1
42+
43+
```powershell
44+
$params = @{
45+
ComputerName = "MyVM01"
46+
InstancePath = "PCI\VEN_8086&DEV_0F48&SUBSYS_72708086&REV_0B\3&11583659&0&D8"
47+
ResourcePoolName = "MyResourcePool"
48+
}
49+
Add-VMHostAssignableDevice $params
50+
```
51+
52+
This example assigns a device identified by its instance path to VM host **MyVM01** within the
53+
resource pool **MyResourcePool**.
54+
55+
## PARAMETERS
56+
57+
### -CimSession
58+
59+
Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session
60+
object, such as the output of a [New-CimSession](/powershell/module/cimcmdlets/new-cimsession)
61+
or [Get-CimSession](/powershell/module/cimcmdlets/get-cimsession) cmdlet. The default is the
62+
current session on the local computer.
63+
64+
```yaml
65+
Type: CimSession[]
66+
Parameter Sets: Path
67+
Aliases:
68+
69+
Required: False
70+
Position: Named
71+
Default value: None
72+
Accept pipeline input: False
73+
Accept wildcard characters: False
74+
```
75+
76+
### -ComputerName
77+
78+
Specifies the name of the Hyper-V host to which the device is to be added. NetBIOS names, IP
79+
addresses, and fully qualified domain names are allowed. The default is the local computer. Use
80+
localhost or a dot (`.`) to specify the local computer explicitly.
81+
82+
```yaml
83+
Type: String[]
84+
Parameter Sets: Path
85+
Aliases:
86+
87+
Required: False
88+
Position: Named
89+
Default value: None
90+
Accept pipeline input: False
91+
Accept wildcard characters: False
92+
```
93+
94+
### -Credential
95+
96+
Specifies one or more user accounts that have permission to perform this action. The default is the
97+
current user.
98+
99+
```yaml
100+
Type: PSCredential[]
101+
Parameter Sets: Path
102+
Aliases:
103+
104+
Required: False
105+
Position: Named
106+
Default value: None
107+
Accept pipeline input: False
108+
Accept wildcard characters: False
109+
```
110+
111+
### -Force
112+
113+
Forces the command to run without asking for user confirmation.
114+
115+
```yaml
116+
Type: SwitchParameter
117+
Parameter Sets: (All)
118+
Aliases:
119+
120+
Required: False
121+
Position: Named
122+
Default value: None
123+
Accept pipeline input: False
124+
Accept wildcard characters: False
125+
```
126+
127+
### -HostAssignableDevice
128+
129+
Specifies the device object to be assigned to the virtual machine.
130+
131+
```yaml
132+
Type: VMHostAssignableDevice[]
133+
Parameter Sets: Object
134+
Aliases: VMHostAssignableDevice
135+
136+
Required: True
137+
Position: 0
138+
Default value: None
139+
Accept pipeline input: True (ByValue)
140+
Accept wildcard characters: False
141+
```
142+
143+
### -InstancePath
144+
145+
Represents the Device Instance path in the host machine.
146+
147+
```yaml
148+
Type: String
149+
Parameter Sets: Path
150+
Aliases:
151+
152+
Required: False
153+
Position: Named
154+
Default value: None
155+
Accept pipeline input: False
156+
Accept wildcard characters: False
157+
```
158+
159+
### -LocationPath
160+
161+
Specifies the location path to the assignable device.
162+
163+
```yaml
164+
Type: String
165+
Parameter Sets: Path
166+
Aliases:
167+
168+
Required: False
169+
Position: Named
170+
Default value: None
171+
Accept pipeline input: False
172+
Accept wildcard characters: False
173+
```
174+
175+
### -ResourcePoolName
176+
177+
Specifies the name of the resource pool to which the device is assigned.
178+
179+
```yaml
180+
Type: String[]
181+
Parameter Sets: (All)
182+
Aliases:
183+
184+
Required: True
185+
Position: Named
186+
Default value: None
187+
Accept pipeline input: False
188+
Accept wildcard characters: False
189+
```
190+
191+
### CommonParameters
192+
193+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
194+
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
195+
-WarningAction, and -WarningVariable. For more information, see
196+
[about_CommonParameters](/powershell/module/microsoft.powershell.core/about/about_commonparameters).
197+
198+
## INPUTS
199+
200+
### Microsoft.HyperV.PowerShell.VMHostAssignableDevice[]
201+
202+
## OUTPUTS
203+
204+
### System.Object
205+
206+
## NOTES
207+
208+
## RELATED LINKS
209+
210+
[Get-VMHostAssignableDevice](get-vmhostassignabledevice.md)
211+
212+
[Dismount-VMHostAssignableDevice](dismount-vmhostassignabledevice.md)
213+
214+
[Mount-VMHostAssignableDevice](mount-vmhostassignabledevice.md)
215+
216+
[Remove-VMHostAssignableDevice](remove-vmhostassignabledevice.md)

0 commit comments

Comments
 (0)