The Add-PhysicalDisk cmdlet adds a physical disk to the specified storage pool.
The cmdlet can also assign a ManualSelect physical disk already in the storage pool to a specific virtual disk.
Examples
Example 1: Adding a physical disk by storage pool friendly name
This example gets the PhysicalDisk object for the physical disk named PhysicalDisk5 and assigns it to the $PDToAdd variable.
It then adds the PhysicalDisk object to the storage pool named CompanyData.
This example gets all PhysicalDisk objects that can be added to a storage pool and assigns them to the $PDToAdd variable.
It then adds the available physical disks to the storage pool named Demo Pool.
Example 3: Piping a storage pool to Add-PhysicalDisk
This example gets all storage pools (except primordial pools) and pipes the output to the Add-PhysicalDisk cmdlet (this will not work if you created more than one storage pool).
This example then uses the Get-Physical Disk cmdlet inside of parentheses to specify all available physical disks without using variables.
Example 4: Manually assigning physical disks to a virtual disk
This example gets two physical disks that have already been added to the storage pool and designated as ManualSelect disks, PhysicalDisk3 and PhysicalDisk4, and assigns them to the virtual disk UserData.
Parameters
-AsJob
Runs the cmdlet as a background job. Use this parameter to run commands that take a long time to complete.
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
-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
Aliases:
Session
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
Type:
SwitchParameter
Default value:
False
Supports wildcards:
False
DontShow:
False
Aliases:
cf
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-PhysicalDisks
Specifies the physical disk objects to add to the storage pool.
Enter one or more PhysicalDisk CIM objects.
Parameter properties
Type:
CimInstance[]
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
-StoragePool
Specifies the storage pool object to which you want to add the physical disk(s).
Enter a StoragePool CIM object.
Parameter properties
Type:
CimInstance
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
ByStoragePool
Position:
0
Mandatory:
True
Value from pipeline:
True
Value from pipeline by property name:
False
Value from remaining arguments:
False
-StoragePoolFriendlyName
Specifies the friendly name of the storage pool to which to add the physical disk.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
ByStoragePoolFriendlyName
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-StoragePoolName
Specifies the name of the storage pool, provided by the Storage Management Provider, to which to add the physical disk.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
ByStoragePoolName
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-StoragePoolUniqueId
Specifies the ID of the storage pool to which to add the physical disk.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
ByStoragePoolUniqueId
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-ThrottleLimit
Specifies the maximum number of concurrent operations that can be established to run the cmdlet.
If this parameter is omitted or a value of 0 is entered, then Windows PowerShell® calculates an optimum throttle limit for the cmdlet based on the number of CIM cmdlets that are running on the computer.
The throttle limit applies only to the current cmdlet, not to the session or to the computer.
Parameter properties
Type:
Int32
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
-Usage
Specifies the allocation method (usage) for the disk.
Valid values are AutoSelect, HotSpare, Journal, ManualSelect, Retired, and Unknown.
Specifies the virtual disk object to which to exclusively assign the physical disk(s).
Enter one or more VirtualDisk CIM objects.
To manually assign a physical disk to a virtual disk, first add the physical disk to the appropriate pool and set the Usage property on the disk to ManualSelect.
You can do so by using the Add-PhysicalDisk or Set-PhysicalDisk cmdlets.
Parameter properties
Type:
CimInstance
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
ByVirtualDisk
Position:
0
Mandatory:
True
Value from pipeline:
True
Value from pipeline by property name:
False
Value from remaining arguments:
False
-VirtualDiskFriendlyName
Specifies the friendly name of the virtual disk to which to exclusively assign the physical disks.
To manually assign a physical disk to a virtual disk, first add the physical disk to the appropriate pool and set the Usage property on the disk to ManualSelect.
You can do so by using the Add-PhysicalDisk or Set-PhysicalDisk cmdlets.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
ByVirtualDiskFriendlyName
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-VirtualDiskName
The Add-PhysicalDisk cmdlet adds a physical disk to the specified storage pool.
The cmdlet can also assign a ManualSelect physical disk already in the storage pool to a specific virtual disk.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
ByVirtualDiskName
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-VirtualDiskUniqueId
Specifies the ID of the virtual disk to which to exclusively assign the physical disks.
To manually assign a physical disk to a virtual disk, first add the physical disk to the appropriate pool and set the Usage property on the disk to ManualSelect.
You can do so by using the Add-PhysicalDisk or Set-PhysicalDisk cmdlets.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
ByVirtualDiskUniqueId
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
Parameter properties
Type:
SwitchParameter
Default value:
False
Supports wildcards:
False
DontShow:
False
Aliases:
wi
Parameter sets
(All)
Position:
Named
Mandatory:
False
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.