Windows PowerShell® is a task-based command-line shell and scripting language designed especially for system administration. This reference topic for the information technology (IT) professional provides assistance in utilizing the Windows PowerShell cmdlets to script and automate tasks.
This reference provides cmdlet descriptions and syntax for all Windows Storage Management-specific cmdlets. It lists the cmdlets in alphabetical order based on the verb at the beginning of the cmdlet.
cmdlet | Description |
---|---|
Adds an initiator identifier (ID) to an existing masking set. |
|
Adds an access path such as a drive letter or folder to a partition. |
|
Adds a physical disk to a storage pool for the creation of one or more VirtualDisk objects. |
|
Adds a target port to a specified masking set, allowing a connection between the target port, and any virtual disk and initiator IDs that the masking set contains. |
|
Adds a virtual disk to a specified masking set and grants access to the virtual disk from all initiator IDs defined in the masking set. |
|
Cleans a disk by removing all partition information and un-initializing it, erasing all data on the disk. |
|
Connects a disconnected virtual disk to the specified computer when using the Storage Spaces subsystem. |
|
Turns off the identification LED on the specified PhysicalDisk object. |
|
Disconnects a virtual disk from the specified computer, revoking access to the virtual disk. |
|
Dismounts a disk image (virtual hard disk or ISO) so that it can no longer be accessed as a disk. |
|
Enables an LED on the specified physical disk object, typically used for visual identification of the location of a physical disk in an enclosure for removal and replacement operations. |
|
Formats one or more existing volumes or a new volume on an existing partition. |
|
Gets one or more disks visible to the operating system. |
|
Gets one or more disk image objects (virtual hard disk or ISO). |
|
Gets the InitiatorID objects for the specified iSCSI initiators. |
|
Gets one or more host bus adapter (HBA) initiator ports. |
|
Gets masking sets. Masking sets are used to grant access to a virtual disk or iSCSI VHD for one or more servers. |
|
Returns offloaded data transfer (ODX) settings for the specified subsystem. |
|
Returns a list of all partition objects visible on all disks, or optionally a filtered list using specified parameters. |
|
Returns information on supported partition sizes for the specified Disk object. |
|
Gets a list of all PhysicalDisk objects visible across any available Storage Management Providers, or optionally a filtered list. |
|
Gets the resiliency settings (also known as storage layouts) available for creating virtual disks on the specified storage subsystem. |
|
Returns information about long-running Storage module jobs, such as a repair task. |
|
Gets a specific storage pool, or a set of StoragePool objects either from all storage subsystems across all storage providers, or optionally a filtered subset based on specific parameters. |
|
Returns a list of the storage providers available on the current computer. |
|
Gets the storage reliability counters for the disk or physical disk that you specify. |
|
Returns the storage settings object. |
|
Get-StorageSubsystem |
Gets one or more StorageSubsystem objects. |
Returns a TargetPort object associated with a specific port address and connection type. |
|
Returns a target portal object. |
|
Returns a list of VirtualDisk objects, across all storage pools, across all providers, or optionally a filtered subset based on provided criteria. |
|
Returns all sizes supported by a storage pool for virtual disk creation based on the specified Resiliency Setting Name. |
|
Gets the specified Volume object, or all Volume objects if no filter is provided. |
|
Hides the virtual disk from the host when the Storage Management provider in use does not support masking sets. |
|
Initializes a RAW disk for first time use, enabling the disk to be formatted and used to store data. |
|
Mounts a previously created disk image (virtual hard disk or ISO), making it appear as a normal disk. |
|
Creates a new masking set. |
|
Creates a new partition on an existing Disk object. |
|
Creates a new storage pool using a group of physical disks, and a specific storage subsystem exposed by a storage provider. |
|
Allows the creation of a VirtualDisk object on a storage subsystem that does not support creation of storage pools. |
|
Creates a new virtual disk in the specified storage pool. |
|
Creates a new clone of a specified virtual disk. |
|
Creates a new snapshot of the specified virtual disk. |
|
Optimizes a volume, performing such tasks as defragmentation and trim. |
|
Removes an initiator identifier (ID). |
|
Removes an initiator identifier (ID) from a masking set. |
|
Removes a masking set. |
|
Deletes the specified Partition object on an existing disk and any underlying Volume objects. |
|
Removes an access path such as a drive letter or folder from a partition. |
|
Removes a physical disk from a specified storage pool. |
|
Deletes a storage pool and associated VirtualDisk objects. |
|
Removes a specified target port from a masking set. |
|
Deletes an existing virtual disk and reclaims the used space for use by other virtual disks in the same storage pool. |
|
Removes a virtual disk from a specified masking set to block access to the virtual disk by an initiator IDs defined in the masking set. |
|
Renames an existing masking set. |
|
Performs repairs on a virtual disk that is unhealthy. |
|
Performs repairs on a volume. |
|
Resets the status of a physical disk. |
|
Resizes a partition and the underlying file system. |
|
Resizes an existing virtual disk to be larger or smaller. |
|
Takes a Disk object or unique disk identifiers and a set of attributes, and updates the physical disk on the system. |
|
Sets properties on the InitiatorPort object. |
|
Sets attributes of a partition, such as active, read-only, and offline states. |
|
Sets attributes on a specific physical disk. |
|
Modifies the properties of the specified resiliency setting name. |
|
Modifies the properties of the specified storage pool. |
|
Adjusts or configures current storage settings of the StorageSetting object. |
|
Set-StorageSubsystem |
Sets the friendly name or description of the specified StorageSubsystem object. |
Modifies the attributes of an existing virtual disk. |
|
Sets or changes the file system label of an existing volume. |
|
Makes a virtual disk available to a host for storage subsystems that do not support masking sets. |
|
Updates cached information about the specified Disk object only |
|
Initiates an update on the host storage cache to reflect the current status of storage. |
|
Updates the cache of the service for a particular provider and associated child objects. |
注意
To list all the cmdlets that are available, use the Get-Command –Module Storage
cmdlet.
For more information about, or for the syntax of, any of the cmdlets, use the Get-Help
<cmdlet name> cmdlet, where <cmdlet name> is the name of the cmdlet that you want to research. For more detailed information, you can run any of the following cmdlets:
● Get-Help
<cmdlet name> -Detailed
● Get-Help
<cmdlet name> -Examples
● Get-Help
<cmdlet name> -Full
For more information about the objects that are used by these cmdlets, see the following: