In a previous post I showed you how to create a storage pool, today I want to show you how to use PowerShell to create a virtual disk in your Storage Pool.

new-virtualdisk

To create a virtual disk using Powershell, use the New-VirtualDisk cmdlet with the following syntax:

-StoragePoolFriendyName Parameter

To obtain the correct designations for the storage pool, use the cmdlet: Get-StoragePool.

get-storagepool

-ProvisioningType Parameter

Use Thin except when using storage spaces that use storage levels or a clustered storage group in that case use Fixed.

-PhysicalDiskRedundancy Parameter

This value represents how many failed physical disks can tolerate the virtual disk without data loss.

Create the New Virtual Disk

Run the following PowerShell commands as administrator.

Virtual Disk

Initialize the Virtual Disk

The following command initializes a Disk object with the GPT partition style

initialize-disk

Partition the Virtual Disk

The following command creates a new partition on disk 10, using the maximum available space, and assigning drive letter E.

new-partition

Format the Virtual Disk

The following cmdlet performs a full format of the E volume using the NTFS file system.

Virtual Disk PowerShell

Checking

The following cmdlet returns a list of Virtual Disk objects, across all storage pools.

Virtual Disk PowerShell

If you want to know more about New-VirtualDisk cmdlet, check out this link: https://docs.microsoft.com/en-us/powershell/module/storage/new-virtualdisk?view=win10-ps