22description : Adds a GPU partition adapter to a virtual machine.
33external help file : Microsoft.HyperV.PowerShell.Cmdlets.dll-Help.xml
44Module Name : Hyper-V
5- ms.date : 09/22/2022
5+ ms.date : 06/12/2024
66online version : https://learn.microsoft.com/powershell/module/hyper-v/add-vmgpupartitionadapter?view=windowsserver2022-ps&wt.mc_id=ps-gethelp
77schema : 2.0.0
88title : Add-VMGpuPartitionAdapter
@@ -16,53 +16,62 @@ Adds a GPU partition adapter to a virtual machine.
1616## SYNTAX
1717
1818### VMName (Default)
19+
1920```
2021Add-VMGpuPartitionAdapter [-CimSession <CimSession[]>] [-ComputerName <String[]>]
2122 [-Credential <PSCredential[]>] [-VMName] <String[]> [-Passthru] [-InstancePath <String>]
2223 [-MinPartitionVRAM <UInt64>] [-MaxPartitionVRAM <UInt64>] [-OptimalPartitionVRAM <UInt64>]
2324 [-MinPartitionEncode <UInt64>] [-MaxPartitionEncode <UInt64>] [-OptimalPartitionEncode <UInt64>]
2425 [-MinPartitionDecode <UInt64>] [-MaxPartitionDecode <UInt64>] [-OptimalPartitionDecode <UInt64>]
25- [-MinPartitionCompute <UInt64>] [-MaxPartitionCompute <UInt64>] [-OptimalPartitionCompute <UInt64>] [-WhatIf]
26- [-Confirm] [<CommonParameters>]
26+ [-MinPartitionCompute <UInt64>] [-MaxPartitionCompute <UInt64>] [-OptimalPartitionCompute <UInt64>]
27+ [-WhatIf] [- Confirm] [<CommonParameters>]
2728```
2829
2930### VMObject
31+
3032```
3133Add-VMGpuPartitionAdapter [-VM] <VirtualMachine[]> [-Passthru] [-InstancePath <String>]
3234 [-MinPartitionVRAM <UInt64>] [-MaxPartitionVRAM <UInt64>] [-OptimalPartitionVRAM <UInt64>]
3335 [-MinPartitionEncode <UInt64>] [-MaxPartitionEncode <UInt64>] [-OptimalPartitionEncode <UInt64>]
3436 [-MinPartitionDecode <UInt64>] [-MaxPartitionDecode <UInt64>] [-OptimalPartitionDecode <UInt64>]
35- [-MinPartitionCompute <UInt64>] [-MaxPartitionCompute <UInt64>] [-OptimalPartitionCompute <UInt64>] [-WhatIf]
36- [-Confirm] [<CommonParameters>]
37+ [-MinPartitionCompute <UInt64>] [-MaxPartitionCompute <UInt64>] [-OptimalPartitionCompute <UInt64>]
38+ [-WhatIf] [- Confirm] [<CommonParameters>]
3739```
3840
3941## DESCRIPTION
40- The 'Add-VMGpuPartitionAdapter' cmdlet adds a GPU partition adapter to a virtual machine. With no parameter, it assigns a full partition from an assignable GPU to a VM.
42+
43+ The ` Add-VMGpuPartitionAdapter ` cmdlet adds a GPU partition adapter to a virtual machine. With no
44+ parameter, it assigns a full partition from an assignable GPU to a VM.
4145
4246## EXAMPLES
4347
4448### Example 1
49+
4550``` powershell
46- $vm = Get-VM -name "TestVM"
51+ $vm = Get-VM -Name "TestVM"
4752Add-VMGpuPartitionAdapter -VM $vm
4853```
4954
5055This example assigns a partition to a specific VM object.
5156
5257### Example 2
58+
5359``` powershell
54- $vm = Get-VM -name "TestVM"
55- Add-VMGpuPartitionAdapter -VM $vm -Instancepath "SampleGPUInstancePath "
60+ $vm = Get-VM -Name "TestVM"
61+ Add-VMGpuPartitionAdapter -VM $vm -InstancePath "GPUInstancePath "
5662```
5763
58- This example assigns a partition from a specific GPU to a VM where the instance path is the GPU device ID name on the host.
64+ This example assigns a partition from a specific GPU to a VM where the instance path is the GPU
65+ device ID name on the host.
5966
6067## PARAMETERS
6168
6269### -CimSession
63- Runs the cmdlet in a remote session or on a remote computer.
64- Enter a computer name or a session object, such as the output of a [ New-CimSession] ( https://go.microsoft.com/fwlink/p/?LinkId=227967 ) or [ Get-CimSession] ( https://go.microsoft.com/fwlink/p/?LinkId=227966 ) cmdlet.
65- The default is the current session on the local computer.
70+
71+ Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session
72+ object, such as the output of a [ New-CimSession] ( /powershell/module/cimcmdlets/new-cimsession )
73+ or [ Get-CimSession] ( /powershell/module/cimcmdlets/get-cimsession ) cmdlet. The default is the
74+ current session on the local computer.
6675
6776``` yaml
6877Type : CimSession[]
@@ -77,10 +86,10 @@ Accept wildcard characters: False
7786` ` `
7887
7988### -ComputerName
80- Specifies one or more Hyper-V hosts from which virtual machines are to be retrieved.
81- NetBIOS names, IP addresses, and fully qualified domain names are allowable.
82- The default is the local computer.
83- Use localhost or a dot ('.' ) to specify the local computer explicitly.
89+
90+ Specifies one or more Hyper-V hosts from which virtual machines are to be retrieved. NetBIOS names,
91+ IP addresses, and fully qualified domain names are allowable. The default is the local computer.
92+ Use localhost or a dot (` .` ) to specify the local computer explicitly.
8493
8594` ` ` yaml
8695Type: String[]
@@ -95,8 +104,9 @@ Accept wildcard characters: False
95104` ` `
96105
97106# ## -Credential
98- Specifies one or more user accounts that have permission to perform this action.
99- The default is the current user.
107+
108+ Specifies one or more user accounts that have permission to perform this action. The default is the
109+ current user.
100110
101111` ` ` yaml
102112Type: PSCredential[]
@@ -111,7 +121,9 @@ Accept wildcard characters: False
111121` ` `
112122
113123# ## -InstancePath
114- Represents the Device Instance path of a GPU in the host. This value can be obtained from the "Name" property of the command 'Get-VMHostPartitionableGpu'.
124+
125+ Represents the Device Instance path of a GPU in the host. This value can be obtained from the
126+ " Name" property of the command `Get-VMHostPartitionableGpu`.
115127
116128` ` ` yaml
117129Type: String
@@ -126,7 +138,9 @@ Accept wildcard characters: False
126138` ` `
127139
128140# ## -MaxPartitionCompute
129- The maximum number of compute assigned by the host GPU. This is defined by the manufacturer's driver.
141+
142+ The maximum number of compute assigned by the host GPU. This is defined by the manufacturer's
143+ driver.
130144
131145` ` ` yaml
132146Type: UInt64
@@ -141,7 +155,9 @@ Accept wildcard characters: False
141155` ` `
142156
143157# ## -MaxPartitionDecode
144- The maximum number of decoders assigned by the host GPU. This is defined by the manufacturer's driver.
158+
159+ The maximum number of decoders assigned by the host GPU. This is defined by the manufacturer's
160+ driver.
145161
146162` ` ` yaml
147163Type: UInt64
@@ -156,7 +172,9 @@ Accept wildcard characters: False
156172` ` `
157173
158174# ## -MaxPartitionEncode
159- The maximum number of encoders assigned by the host GPU. This is defined by the manufacturer's driver.
175+
176+ The maximum number of encoders assigned by the host GPU. This is defined by the manufacturer's
177+ driver.
160178
161179` ` ` yaml
162180Type: UInt64
@@ -171,6 +189,7 @@ Accept wildcard characters: False
171189` ` `
172190
173191# ## -MaxPartitionVRAM
192+
174193The maximum VRAM in bytes supported by the host GPU. This is defined by the manufacturer's driver.
175194
176195` ` ` yaml
@@ -186,7 +205,9 @@ Accept wildcard characters: False
186205` ` `
187206
188207# ## -MinPartitionCompute
189- The minimum number of compute assigned by the host GPU. This is defined by the manufacturer's driver.
208+
209+ The minimum number of compute assigned by the host GPU. This is defined by the manufacturer's
210+ driver.
190211
191212` ` ` yaml
192213Type: UInt64
@@ -201,7 +222,9 @@ Accept wildcard characters: False
201222` ` `
202223
203224# ## -MinPartitionDecode
204- The minimum number of decoders assigned by the host GPU. This is defined by the manufacturer's driver.
225+
226+ The minimum number of decoders assigned by the host GPU. This is defined by the manufacturer's
227+ driver.
205228
206229` ` ` yaml
207230Type: UInt64
@@ -216,7 +239,9 @@ Accept wildcard characters: False
216239` ` `
217240
218241# ## -MinPartitionEncode
219- The minimum number of encoders assigned by the host GPU. This is defined by the manufacturer's driver.
242+
243+ The minimum number of encoders assigned by the host GPU. This is defined by the manufacturer's
244+ driver.
220245
221246` ` ` yaml
222247Type: UInt64
@@ -231,6 +256,7 @@ Accept wildcard characters: False
231256` ` `
232257
233258# ## -MinPartitionVRAM
259+
234260The minimum VRAM in bytes supported by the host GPU. This is defined by the manufacturer's driver.
235261
236262` ` ` yaml
@@ -246,7 +272,9 @@ Accept wildcard characters: False
246272` ` `
247273
248274# ## -OptimalPartitionCompute
249- The optimal number of compute assigned by the host GPU. This is defined by the manufacturer's driver.
275+
276+ The optimal number of compute assigned by the host GPU. This is defined by the manufacturer's
277+ driver.
250278
251279` ` ` yaml
252280Type: UInt64
@@ -261,7 +289,9 @@ Accept wildcard characters: False
261289` ` `
262290
263291# ## -OptimalPartitionDecode
264- The optimal number of decoders assigned by the host GPU. This is defined by the manufacturer's driver.
292+
293+ The optimal number of decoders assigned by the host GPU. This is defined by the manufacturer's
294+ driver.
265295
266296` ` ` yaml
267297Type: UInt64
@@ -276,7 +306,9 @@ Accept wildcard characters: False
276306` ` `
277307
278308# ## -OptimalPartitionEncode
279- The optimal number of encoders assigned by the host GPU. This is defined by the manufacturer's driver.
309+
310+ The optimal number of encoders assigned by the host GPU. This is defined by the manufacturer's
311+ driver.
280312
281313` ` ` yaml
282314Type: UInt64
@@ -291,6 +323,7 @@ Accept wildcard characters: False
291323` ` `
292324
293325# ## -OptimalPartitionVRAM
326+
294327The optimal VRAM in bytes supported by the host GPU. This is defined by the manufacturer's driver.
295328
296329` ` ` yaml
@@ -306,6 +339,7 @@ Accept wildcard characters: False
306339` ` `
307340
308341# ## -Passthru
342+
309343Returns an object for each process that the cmdlet started.
310344
311345` ` ` yaml
@@ -321,6 +355,7 @@ Accept wildcard characters: False
321355` ` `
322356
323357# ## -VM
358+
324359Specifies the virtual machine on which the network adapter is to be added.
325360
326361` ` ` yaml
@@ -336,6 +371,7 @@ Accept wildcard characters: False
336371` ` `
337372
338373# ## -VMName
374+
339375Specifies the name of the virtual machine on which the network adapter is to be added.
340376
341377` ` ` yaml
@@ -351,6 +387,7 @@ Accept wildcard characters: False
351387` ` `
352388
353389# ## -Confirm
390+
354391Prompts you for confirmation before running the cmdlet.
355392
356393` ` ` yaml
@@ -366,8 +403,8 @@ Accept wildcard characters: False
366403` ` `
367404
368405# ## -WhatIf
369- Shows what would happen if the cmdlet runs.
370- The cmdlet is not run.
406+
407+ Shows what would happen if the cmdlet runs. The cmdlet is not run.
371408
372409` ` ` yaml
373410Type: SwitchParameter
@@ -382,7 +419,11 @@ Accept wildcard characters: False
382419` ` `
383420
384421# ## CommonParameters
385- This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
422+
423+ This cmdlet supports the common parameters : -Debug, -ErrorAction, -ErrorVariable,
424+ -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
425+ -WarningAction, and -WarningVariable. For more information, see
426+ [about_CommonParameters](/powershell/module/microsoft.powershell.core/about/about_commonparameters).
386427
387428# # INPUTS
388429
@@ -397,3 +438,9 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
397438# # NOTES
398439
399440# # RELATED LINKS
441+
442+ [Get-VMGpuPartitionAdapter](get-vmgpupartitionadapter.md)
443+
444+ [Remove-VMGpuPartitionAdapter](remove-vmgpupartitionadapter.md)
445+
446+ [Set-VMGpuPartitionAdapter](set-vmgpupartitionadapter.md)
0 commit comments