Skip to content

Commit a130464

Browse files
committed
Ready for review
1 parent 0101bc7 commit a130464

File tree

3 files changed

+49
-9
lines changed

3 files changed

+49
-9
lines changed

docset/winserver2025-ps/VMDirectStorage/Add-VMDirectVirtualDisk.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,21 +47,34 @@ disk to the VM.
4747

4848
## Examples
4949

50-
### Example 1
50+
### Example 1: Attach a virtual disk by specifying VM name and controller details
51+
52+
This example attaches the virtual disk with the unique ID "111BBE22FD037E4EB87F366648FBF111" to the
53+
virtual machine named "VM1" at controller 0, location 1.
5154

5255
```powershell
5356
$parameters = @{
5457
VMName = "VM1"
5558
ControllerType = "SCSI"
5659
ControllerNumber = 0
5760
ControllerLocation = 1
58-
VirtualDiskUniqueId = "12345-67890"
61+
VirtualDiskUniqueId = "111BBE22FD037E4EB87F366648FBF111"
5962
}
63+
6064
Add-VMDirectVirtualDisk @parameters
6165
```
6266

63-
This command attaches the virtual disk with the unique ID "12345-67890" to the virtual machine named
64-
"VM1" at controller 0, location 1.
67+
### Example 2: Attach a virtual disk by using a virtual disk object
68+
69+
This example gets the Storage Spaces Direct virtual disk object named "Volume01" and the VM object
70+
named "VM1", and then directly attaches the disk to the VM.
71+
72+
```powershell
73+
$virtualDisk = Get-VirtualDisk -Friendlyname "Volume01"
74+
$vm = Get-VM -Name "VM1"
75+
76+
Add-VMDirectVirtualDisk -VM $vm -VirtualDiskUniqueId $virtualDisk.UniqueId
77+
```
6578

6679
## Parameters
6780

docset/winserver2025-ps/VMDirectStorage/Get-VMDirectVirtualDisk.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,31 @@ name, and its location on the controller.
4545

4646
## Examples
4747

48-
### Example 1
48+
### Example 1: Retrieve virtual disks by virtual machine name
49+
50+
This command retrieves all virtual disks attached to the virtual machine named "VM1".
4951

5052
```powershell
5153
Get-VMDirectVirtualDisk -VMName "VM1"
5254
```
5355

54-
This command retrieves all virtual disks attached to the virtual machine named "VM1".
56+
Here's example output:
57+
58+
```Output
59+
VMName ControllerType ControllerNumber ControllerLocation VirtualDiskFriendlyName VirtualDiskUniqueId
60+
------ -------------- ---------------- ------------------ ----------------------- -------------------
61+
VM1 SCSI 0 1 Volume01 111BBE22FD037E4E...
62+
```
63+
64+
### Example 2: Retrieve virtual disks by virtual machine object
65+
66+
This command gets the virtual machine object for "VM1" and then retrieves its directly attached
67+
virtual disks.
68+
69+
```powershell
70+
$vm = Get-VM -Name "VM1"
71+
Get-VMDirectVirtualDisk -VM $vm
72+
```
5573

5674
## Parameters
5775

docset/winserver2025-ps/VMDirectStorage/Remove-VMDirectVirtualDisk.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ virtual machine. This operation ensures that the virtual disk is no longer acces
3636

3737
## Examples
3838

39-
### Example 1
39+
### Example 1: Detach a virtual disk by specifying VM name and controller details
40+
41+
This command detaches the virtual disk located at controller 0, location 1, from the virtual machine
42+
named "VM1".
4043

4144
```powershell
4245
$parameters = @{
@@ -48,8 +51,14 @@ $parameters = @{
4851
Remove-VMDirectVirtualDisk @parameters
4952
```
5053

51-
This command detaches the virtual disk located at controller 0, location 1, from the virtual machine
52-
named "VM1".
54+
### Example 2: Detach a virtual disk by using the virtual disk object
55+
56+
This example gets the virtual disk object attached to "VM1" and then removes it.
57+
58+
```powershell
59+
$virtualDisk = Get-VMDirectVirtualDisk -VMName "VM1"
60+
Remove-VMDirectVirtualDisk -VirtualDisk $virtualDisk
61+
```
5362

5463
## Parameters
5564

0 commit comments

Comments
 (0)