Share via


Full help of Microsoft Powershell STORAGE module

NAME
    Format-Volume
     
SYNOPSIS
    Formats one or more existing volumes or a new volume on an existing partition.
     
    Example 1: Quick format
     
    PS C:\> Format-Volume -DriveLetter D
     
     
    This example performs a format of the D volume.
    Example 2: Full format using FAT32
     
    PS C:\> Format-Volume -DriveLetter C -FileSystem FAT32 -FullFormat –Force
     
     
    This example performs a full format of the D volume using the FAT32 file system.
 
NAME
    Add-InitiatorIdToMaskingSet
     
SYNOPSIS
    Adds an initiator ID to an existing masking set, granting the host associated with the initiator ID access to the 
    virtual disk and target port resources defined in the masking set.
     
    Example 1: Adding an InitiatorID to a masking set by masking set object
     
    PS C:\> $fcPorts = Get-InitiatorPort -CimSession Srv1 -ConnectionType FibreChannel
     
     
    This example shows getting Fibre Channel initiator ports from the Srv1 computer, then getting the masking set 
    object for the Cluster1MaskingSet, then enabling Srv1 access to all virtual disks defined in the masking set.
 
NAME
    Add-PartitionAccessPath
     
SYNOPSIS
    Adds an access path such as a drive letter or folder to a partition.
     
    Example 1: Add a drive letter to a partition by disk and partition number
     
    PS C:\> Add-PartitionAccessPath -DiskNumber 1 -PartitionNumber 2 -AccessPath F:
     
     
    This example adds the access path F: to partition 2 of disk 1.
 
NAME
    Add-PhysicalDisk
     
SYNOPSIS
    Adds a physical disk to the specified storage pool or manually assigns a physical disk to a specific virtual disk.
     
    Example 1: Adding a physical disk by storage pool friendly name
     
    PS C:\> $PDToAdd = Get-PhysicalDisk -FriendlyName PhysicalDisk5
     
     
    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.
    Example 2: Adding all available physical disks
     
    PS C:\> $PDToAdd = Get-PhysicalDisk -CanPool $True
     
     
    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
     
    PS C:\> Get-StoragePool -IsPrimordial $False | Add-PhysicalDisk -PhysicalDisks (Get-PhysicalDisk -CanPool $True)
     
     
    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
     
    PS C:\> Add-PhysicalDisk –VirtualDiskFriendlyName UserData –PhysicalDisks (Get-PhysicalDisk -FriendlyName 
    PhysicalDisk3, PhysicalDisk4)
     
     
    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.
 
NAME
    Add-TargetPortToMaskingSet
     
SYNOPSIS
    Adds one or more target ports to a specified masking set, allowing a connection between the target ports, and any 
    virtual disks and initiator IDs that the masking set contains.
     
    Example 1: Add a target port
     
    PS C:\> $TargetPortObject = Get-TargetPort
     
     
    PS C:\> $subSystem = Get-StorageSubSystem SANArray1
    FriendlyName          PortAddress
     
    ------------          -----------
     
    Stor1_FCTargetPort.0a 500A098387995A75
     
    Stor1_FCTargetPort.0b 500A098487995A75
     
    Stor1_FCTargetPort.0c 500A098187995A75
     
    Stor1_FCTargetPort.0d 500A098287995A75
     
    PS C:\> $maskingSet | Add-TargetPortToMaskingSet -TargetPortAddresses "500A098187995A75"
     
     
    This example demonstrates enumerating the Fibre Channel target ports on a given storage subsystem, and adding one 
    of the target ports to an existing masking set.
 
NAME
    Add-VirtualDiskToMaskingSet
     
SYNOPSIS
    Adds a virtual disk to a specified masking set and grants access to the virtual disk to all initiator IDs defined 
    in the masking set.
     
    Example 1: Add a virtual disk to an existing masking set
     
    PS C:\> $maskingSet = Get-MaskingSet Cluster1MaskingSet
     
     
    This example adds the virtual disks named Volume12 to a masking set named Cluster1MaskingSet, and sets the device 
    access to read-write.
 
NAME
    Clear-Disk
     
SYNOPSIS
    Cleans a disk by removing all partition information and un-initializing it, erasing all data on the disk.
     
    Example 1: Clear a blank disk
     
    PS C:\> Clear-Disk -DiskNumber 1
     
     
    This example clears disk number one only if it does not contain both data or OEM partitions.
    Example 2: Clear a disk with data partitions
     
    PS C:\> Clear-Disk -DiskNumber 1 –RemoveData
     
     
    This example clears the disk if it has data partitions, but not if it also has OEM partitions.
    Clear a disk with data and OEM partitions
     
    PS C:\> Clear-Disk -DiskNumber 1 -RemoveData –RemoveOEM
     
     
    This example clears the disk regardless of whether it contains data or OEM partitions.
 
NAME
    Connect-VirtualDisk
     
SYNOPSIS
    Connects a disconnected virtual disk to the specified computer when using the Storage Spaces subsystem.
     
    Example 1: Connect a virtual disk to the local computer
     
    PS C:\> Connect-VirtualDisk –FriendlyName "VirtualDisk1"
     
     
    This example connects the virtual disk named VirtualDisk1 to the local computer.
    Example 2: Connect all disconnected virtual disks on a remote server
     
    PS C:\> Get-VirtualDisk –CimSession Srv2 | Where-Object -Filter { $_.OperationalStatus -eq "Detached" } | 
    Connect-VirtualDisk
     
     
    This example uses the Get-VirtualDisk cmdlet to get all virtual disk objects on the computer Srv2 (by using the 
    CimSession parameter). It then pipes the objects to the Where-Object cmdlet to filter out all virtual disks except  
    those with the “Detached” operational status. Finally, it pipes these objects to the Connect-VirtualDisk cmdlet.
    Example 3: Connect all disconnected virtual disks on two remote computers by using Invoke-Command
     
    PS C:\> Invoke-Command -ComputerName Srv1, Srv2 -ScriptBlock { Get-VirtualDisk | Where-Object -Filter { 
    $_.OperationalStatus -eq "Detached" } | Connect-VirtualDisk }
     
     
    This example uses the Invoke-Command cmdlet to run the cmdlets specified in Example 2 (now specified in the 
    ScriptBlock parameter) on multiple remote computers simultaneously, with all processing done in parallel on each 
    computer and only the results being sent back to the local PowerShell session.
 
NAME
    Disable-PhysicalDiskIndication
     
SYNOPSIS
    Turns off the identification LED on the specified physical disk.
     
    Example 1: Disable the identification LED on all physical disks in a pool
     
    PS C:\> $stpool = (Get-StoragePool -FriendlyName "SpacePool")
     
     
    PS C:\> Disable-PhysicalDiskIndication -StoragePool $stpool
     
     
    This example assigns the storage pool named SpacePool to the $stpool variable, and then uses this cmdlet to 
    disable the identification LED on all disks in the storage pool referenced by the $stpool variable, SpacePool.
    Example 2: Disable the identification LED on all physical disks used by a virtual disk
     
    PS C:\> $vdisk = (Get-VirtualDisk -FriendlyName "Bruce's Music")
     
     
    PS C:\> Disable-PhysicalDiskIndication -VirtualDisk $vdisk
     
     
    This example assign the virtual disk named Bruce’s Music to the $vdisk variable, and then uses this cmdlet to 
    disable the identification LED on the virtual disk referenced by the $vdisk variable,
 
NAME
    Disconnect-VirtualDisk
     
SYNOPSIS
    Disconnects a virtual disk from the specified computer, revoking access to the virtual disk.
     
    Example 1: Disconnect a virtual disk by friendly name
     
    PS C:\> Disconnect-VirtualDisk -FriendlyName VirtualDisk01
     
     
    This example disconnects a virtual disk named VirtualDisk01 from the local machine to prevent futher access to the 
    virtual disk.
 
NAME
    Dismount-DiskImage
     
SYNOPSIS
    Dismounts a disk image (virtual hard disk or ISO) so that it can no longer be accessed as a disk.
     
    Example 1: Dismount a disk image by path
     
    PS C:\> Dismount-DiskImage -ImagePath "E:\ISO-Files\My US Visit Fall 2010 Pictures.iso"
     
     
    This example ejects an ISO named My US Visit Fall 2010 Pictures by specifying the image path at E:\ISO-Files.
    Example 2: Dismount a disk image by device path
     
    PS C:\> Dismount-DiskImage -DevicePath \\.\CDROM1
     
     
    This example ejects an ISO by specifying device path for cdrom1. Refer to the Get-DiskImage cmdlet to learn how to 
    find the device path of an ISO or VHD file.
 
NAME
    Enable-PhysicalDiskIndication
     
SYNOPSIS
    Enables the identification LED on the specified physical disk.
     
    Example 1: Enable the identification LED on all physical disks in a pool
     
    PS C:\> $stpool = (Get-StoragePool -FriendlyName "SpacePool")
     
     
    PS C:\> Enable-PhsicalDiskIndication -StoragePool $stpool
     
     
    This example enables the identification LED on all physical disks associated with the Storage Pool SpacePool. This 
    is useful for identifying a specific virtual disk, when the LED on the disk in question is not functioning.
    Example 2: Enable the identification LED on all physical disks used by a virtual disk
     
    PS C:\> $vdisk = (Get-VirtualDisk -FriendlyName "Bruce's Music")
     
     
    PS C:\> Enable-PhysicalDiskIndication -VirtualDisk $vdisk
     
     
    This example enables the identification LED on all physical disks associated with the virtual disk named Bruce’s 
    Music to visually identify the Physical Storage associated with the virtual disk.
    Example 3: Enable the identification LED on all disks that are not healthy
     
    PS C:\> Get-PhysicalDisk | Where-Object -FilterScript { $_.HealthStatus –Ne "healthy" } | 
    Enable-PhysicalDiskIndication
     
     
    This example gets all physical disks with a health status that is not Healthy, and pipes the disks to the 
    Enable-PhysicalDiskIndication cmdlet, enabling the LEDs on the disks, if supported by the drive enclosure.
 
NAME
    Format-Volume
     
SYNOPSIS
    Formats one or more existing volumes or a new volume on an existing partition.
     
    Example 1: Quick format
     
    PS C:\> Format-Volume -DriveLetter D
     
     
    This example performs a format of the D volume.
    Example 2: Full format using FAT32
     
    PS C:\> Format-Volume -DriveLetter C -FileSystem FAT32 -FullFormat –Force
     
     
    This example performs a full format of the D volume using the FAT32 file system.
 
NAME
    Get-Disk
     
SYNOPSIS
    Gets one or more disks visible to the operating system.
     
    Example 1: Get  all disks
     
    PS C:\> Get-Disk
     
     
    This example gets all disks visible to the operating system.
    Example 2: Get  a disk by disk number
     
    PS C:\> Get-Disk -Number 6
     
     
    This example gets disk 6.
    Example 3: Get  all USB disks
     
    PS C:\> Get-Disk | Where-Object –FilterScript {$_.Bustype -Eq "USB"}
     
     
    PS C:\>
     
     
    This example gets all disks attached via the USB bus by piping the output of Get-Disk to the Where-Object cmdlet, 
    and filtering by the USB value of the Bustype property.
    Example 4: Get  the iSCSI sessions for all iSCSI disks
     
    PS C:\> Get-Disk | Where-Object –FilterScript {$_.BusType -Eq "iSCSI"} |
     
    Get-IscsiSession | Format-Table
     
     
    This example gets all disks attached via the iSCSI bus by piping the output of Get-Disk to the Where-Object
    cmdlet, and filtering by the iSCSI value of the Bustype property. It then passes the Disk objects in the pipeline 
    to the Get-IscisSession cmdlet, which gets the associated iSCSI sessions, and then pipes the output to the 
    Format-Table cmdlet for simplified display.
 
NAME
    Get-DiskImage
     
SYNOPSIS
    Gets one or more disk image objects (virtual hard disk or ISO).
     
    Example 1: Get  a disk image by path
     
    PS C:\> Get-DiskImage –ImagePath "E:\ISO-Files\My US Visit Fall 2010 Pictures.iso"
     
     
    This example gets an ISO disk image specified by path and displays information about the disk image.
    Example 2: Get  a disk image by device path
     
    PS C:\> Get-DiskImage -DevicePath \\.\CDROM1
     
     
    This example gets an ISO disk image specified by device path and displays information about the disk image.
    Example 3: Get  the drive letter associated with a mounted ISO
     
    PS C:\> Get-DiskImage -DevicePath \\.\CDROM1 | Get-Volume
     
     
    This example displays the drive letter associated with an ISO file.
    Example 4: Get  the drive letter associated with a mounted VHD
     
    PS C:\> Get-DiskImage –ImagePath E:\vhd1.vhdx | Get-Disk | Get-Partition | Get-Volume
    DriveLetter       FileSystemLabel   FileSystem        DriveType         HealthStatus        SizeRemaining          
       Size
     
    -----------       ---------------   ----------        ---------         ------------        -------------          
       ----
     
    F                 New  Volume        NTFS              Fixed             Healthy                  19.27 GB         
    19.87 GB
     
     
    This example displays one or more drive letters associated with volumes in a VHD file.
 
NAME
    Get-FileIntegrity
     
SYNOPSIS
     
     
     
     
    PS C:\>
     
     
     
     
     
    PS C:\>
     
     
     
 
NAME
    Get-InitiatorId
     
SYNOPSIS
    Gets the InitiatorID objects for the specified iSCSI initiators.
     
    Example 1: Get  all InitiatorIDs
     
    PS C:\> Get-InitiatorID
     
     
    This example gets and displays all iSCSI initiator IDs on the computer.
    Example 2: Get  the storage providers for each InitiatorID
     
    PS C:\> Get-InitiatorId | Get-StorageSubSystem | Get-StorageProvider
     
     
    This example gets and displays the storage providers for each InitiatorID by piping the output from the 
    Get-InitiatorId cmdlet to the Get-StorageSubSystem cmdlet, and then piping that cmdlet’s output to the 
    Get-StorageProvider cmdlet.
    Example 3:Get the InitatorID objects for a masking set
     
    PS C:\> Get-InitiatorId -MaskingSet (Get-MaskingSet -FriendlyName *EQLV1)
     
     
    This example uses the Get-MaskingSet cmdlet to get the masking set with a friendly name that ends with EQLV1, and 
    then gets all associated InitiatorID objects.
 
NAME
    Get-InitiatorPort
     
SYNOPSIS
    Gets one or more host bus adapter (HBA) initiator ports.
     
    Example 1: Get  all initiator ports
     
    PS C:\> Get-InitiatorPort
    InstanceName                  NodeAddress                   PortAddress                   ConnectionType 
    ------------                  -----------                   -----------                   -------------- 
    ROOT\ISCSIPRT\0000_0          iqn.1991-05.com.contoso:...   ISCSI ANY PORT                iSCSI
     
     
    This example gets all available initiator ports.
    Example 2: Get  all initiator ports, and filter the display
     
    PS C:\> Get-InitiatorPort | Select-Object -Property NodeAddress,ConnectionType | Format-Table -AutoSize
    NodeAddress                                                    ConnectionType 
    -----------                                                    -------------- 
    iqn.1991-05.com.microsoft:johnj99-pc2.contoso.com              iSCSI
     
     
    This example gets all available initiator ports. selects only the NodeAddress and ConnectionType properties, and 
    then displays this information.
 
NAME
    Get-MaskingSet
     
SYNOPSIS
    Gets masking sets. Masking sets are used to grant access to a virtual disk or iSCSI VHD for one or more servers.
     
    Example 1: Get  all masking sets
     
    PS C:\> Get-MaskingSet
     
     
    This example gets and displays all existing MaskingSet objects which have been created using any available Storage 
    Management Providers across all visible storage subsystems.
    Example 2: Get  all Microsoft Windows masking sets
     
    PS C:\> Get-MaskingSet -HostType MicrosoftWindows
     
     
    This example gets and displays all masking sets hosted by a computer running Microsoft Windows.
    Example 3: Get  the masking set for a specific virtual disk
     
    PS C:\> Get-MaskingSet -VirtualDisk (Get-VirtualDisk -FriendlyName CompanyData)
     
     
    This example gets the masking set for the CompanyData virtual disk. It does so by using the Get-VirtualDisk cmdlet 
    to get the appropriate VirtualDisk object and provide it to the VirtualDisk parameter of Get-MaskingSet.
 
NAME
    Get-OffloadDataTransferSetting
     
SYNOPSIS
    Returns offloaded data transfer (ODX) settings for the specified subsystem.
     
    Example 1: Get  all ODX settings
     
    PS C:\> Get-OffloadDataTransferSetting
     
     
    This example gets all ODX settings for connected storage arrays, not including storage arrays that support ODX 
    using the SMI-S protocol.
    Example 2: Get  storage subsystems that have SMPs that support ODX
     
    PS C:\> Get-OffloadDataTransferSetting | Get-StorageSubSystem
     
     
    This example displays all storage subsystems on storage management providers that support ODX, not including 
    storage arrays that support ODX using the SMI-S protocol.
    Example 3: Get  the ODX settings for a particular storage subsystem
     
    PS C:\> $stsubsys = Get-StorageSubsystem –FriendlyName "Big Array"
     
     
    PS C:\> Get-OffloadDataTransferSetting -StorageSubsystem $stsubsys
     
     
    This example returns the offload data transfer settings for the StorageSubsystem objects returned by 
    Get-StorageSubSystem cmdlet.
 
NAME
    Get-Partition
     
SYNOPSIS
    Returns a list of all partition objects visible on all disks, or optionally a filtered list using specified 
    parameters.
     
    EXAMPLE 1
     
    PS C:\> Get-Partition
     
     
    This example return all partitions, on all disks.
    EXAMPLE 2
     
    PS C:\> Get-Partition -DiskNumber 5
    Disk Number: 5 
      
    PartitionNumber  DriveLetter Offset                                        Size Type 
    ---------------  ----------- ------                                        ---- ---- 
    1                H           1048576                                  298.09 GB IFS
     
     
    This example return all partitions on disk 5.
    EXAMPLE 3
     
    PS C:\> Get-Partition -DriveLetter C
    Disk Number: 0 
      
    PartitionNumber  DriveLetter Offset                                        Size Type 
    ---------------  ----------- ------                                        ---- ---- 
    2                C           368050176                                465.42 GB IFS
     
     
    This example partition associated with the volume for drive letter C.
    EXAMPLE 4
     
    PS C:\> Get-Partition | Where-Object –FilterScript {$_.Type -Eq "Basic"}
     
     
    This example returns only the basic partitions on all disks.
 
NAME
    Get-PartitionSupportedSize
     
SYNOPSIS
    Returns information on supported partition sizes for the specified Disk object.
     
    EXAMPLE 1
     
    PS C:\> Get-PartitionSupportedSizes -DiskNumber 3 -PartitionNumber 2
    MinimumSize                                                 MaximumSize 
    -----------                                                 -----------
     
     
    This example is not fully implemented and does not include size values.
 
NAME
    Get-PhysicalDisk
     
SYNOPSIS
    Gets a list of all PhysicalDisk objects visible across any available Storage Management Providers, or optionally a 
    filtered list.
     
    Example 1: Getting all physical disks
     
    PS C:\> Get-PhysicalDisk
    FriendlyName        CanPool            OperationalStatus   HealthStatus        Usage                              
    Size 
    ------------        --------            -----------------   ------------        -----                              
    ---- 
    PhysicalDisk4       False                OK                  Healthy             Data Store                         
    25 GB
     
     
    This example returns an array of all PhysicalDisk objects present in the computer. A storage management provider 
    is required to manage physical disks.
    Example 2: Getting all physical disks eligible for adding to a storage pool
     
    PS C:\> Get-PhysicalDisk -CanPool $True
     
     
    This example returns an array of PhysicalDisk objects that are available for adding to a storage pool (they are in 
    a primordial pool).
 
NAME
    Get-ResiliencySetting
     
SYNOPSIS
    Gets the resiliency settings (also known as storage layouts) available for creating virtual disks on the specified 
    storage subsystem.
     
    Example 1: Get  all resiliency setting objects
     
    PS C:\> Get-ResiliencySetting
    Name                    NumberOfDataCopies      PhysicalDiskRedundancy  NumberOfColumns         Interleave 
    ----                    ------------------      ----------------------  ---------------         ---------- 
    Simple                  1                       0                       8                       65536 
    Mirror                  2                       1                       4                       65536 
    Parity                  1                       1                       8                       65536
     
     
    This example gets all resiliency setting objects for each storage pool, showing which resiliency settings are 
    available for use when creating virtual disks. If  there are multiple storage pools, the same resiliency setting 
    might appear more than once, with each object representing the resiliency setting support for a particular storage 
    pool.
    Example 2: Get  only Mirror, Parity, and Simple resiliency setting objects
     
    PS C:\> Get-ResiliencySetting -Name Mirror,Parity,Simple
     
     
    This example displays only the resiliency settings for the types Mirror, Parity and Simple. Other defined 
    resiliency settings are not displayed.
    Example 3: Get  a resiliency setting object by UniqueID
     
    PS C:\> Get-ResiliencySetting -UniqueId "{5d792e9b-ca00-11e1-9350-00155db7aa01}:1"
     
     
    This example displays one particular resiliency setting object by specifying its UniqueID value, enclosed in 
    quotation marks.
 
NAME
    Get-StorageJob
     
SYNOPSIS
    Returns information about long-running Storage module jobs, such as a repair task.
     
    Example 1: Get  all current storage jobs
     
    PS C:\> Get-StorageJob
    Name                  ElapsedTime           JobState              PercentComplete       IsBackgroundTask
    ----                  -----------           --------              ---------------       ----------------
    Regeneration          00:00:00              Running               50                    True
     
     
    This example displays a list of all current storage jobs.
    Example 2: Get  all storage jobs on the Storage Spaces subsystem
     
    PS C:\> Get-StorageJob -StorageSubsystem (Get-StorageSubSystem -FriendlyName "Storage Spaces*")
     
     
    This example gets all storage jobs on the Storage Spaces subsystem, using the Get-StorageSubSystem cmdlet to get 
    the StorageSubsystem object.
 
NAME
    Get-StoragePool
     
SYNOPSIS
    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.
     
    Example 1: Get  all storage pools
     
    PS C:\> Get-StoragePool
    FriendlyName            OperationalStatus       HealthStatus            IsPrimordial            IsReadOnly
    ------------            -----------------       ------------            ------------            ----------
    CompanyData             OK                      Healthy                 False                   False
    Primordial              OK                      Healthy                 True                    False
     
     
    This example lists all storage pools, (when run without parameter) from all Storage Management Providers, from all 
    storage subsystems. This list may optionally be filtered using one or more parameters.
    Example 2: Get  all storage pools (not including primordial pools)
     
    PS C:\> Get-StoragePool -IsPrimordial $False
    FriendlyName            OperationalStatus       HealthStatus            IsPrimordial            IsReadOnly
    ------------            -----------------       ------------            ------------            ----------
    CompanyData             OK                      Healthy                 False                   False
     
     
    This example lists all (concrete) storage pools, excluding primordial pools (which store physical disks that have 
    yet to be added to a concrete storage pool).
    Example 3: Get  all storage pools that support the Mirror resiliency setting
     
    PS C:\> Get-ResiliencySetting -Name Mirror | Get-StoragePool
    FriendlyName                  OperationalStatus             HealthStatus                  IsPrimordial             
         IsReadOnly
    ------------                  -----------------             ------------                  ------------             
         ----------                   
    CompanyData                   OK                            Healthy                       False                   
         False                       
    Primordial                    OK                            Healthy                       True                    
         False
     
     
    This example uses the Get-ResiliencySetting cmdlet to retrieve ResiliencySetting objects that represent each 
    storage pool that supports the specified resiliency setting (also known as storage layout), in this case Mirror, 
    and then pipes the array of objects to the Get-StoragePool cmdlet.
 
NAME
    Get-StorageProvider
     
SYNOPSIS
    Returns a list of the storage providers available on the local computer.
     
    EXAMPLE 1
     
    PS C:\> Get-StorageProvider
    Type    Name                                                    Manufacturer 
    ----    ----                                                    ------------ 
    SMP     Storage Spaces Management Provider                      Microsoft Corporation
     
     
    This example displays the Storage Spaces provider. When  run without additional filters, this cmdlet will display 
    all available Storage Management Providers on the system.
 
NAME
    Get-StorageReliabilityCounter
     
SYNOPSIS
    Gets the storage reliability counters for the disk or physical disk that you specify.
     
    Example 1: Get  the counters for all physical disks
     
    PS C:\> Get-PhysicalDisk | Get-StorageReliabilityCounter
     
     
    This example pipes the output of the Get-PhysicalDisk cmdlet to the Get-StorageReliabilityCounter cmdlet, getting 
    the counters for all physical disks.
 
NAME
    Get-StorageSetting
     
SYNOPSIS
    Returns the StorageSettings object.
     
    EXAMPLE 1
     
    PS C:\> ipmo storage
     
     
    PS C:\> Get-StorageSetting
    NewDiskPolicy                                               PSComputerName 
    -------------                                               -------------- 
    OnlineAll
     
     
    This example shows the current value of the New  Disk Policy.
 
NAME
    Get-StorageSubsystem
     
SYNOPSIS
    Gets one or more StorageSubsystem objects.
     
    Example 1: Get  all storage subsystems
     
    PS C:\> Get-StorageSubsystem
     
     
    This example returns a list of all visible StorageSubsystem objects across all accessible StorageProvider objects.
    Example 2: Get  the Storage Spaces subsystem
     
    PS C:\> Get-StorageSubSystem -Model "Storage Spaces"
    FriendlyName                            HealthStatus                            OperationalStatus
     
    ------------                            ------------                            -----------------
     
    Storage Spaces on SRV1                  Healthy                                 OK
     
     
    This example returns only the StorageSubsystem object for the Storage Spaces provider.
    Example 3: Get  all unhealthy storage subsystems
     
    PS C:\> Get-StorageSubSystem -HealthStatus Unhealthy
     
     
    This example gets all storage subsystems in an unhealthy state.
    Example 4: Get  storage subsystems that have SMPs that support ODX
     
    PS C:\> Get-OffloadDataTransferSetting | Get-StorageSubSystem
     
     
    This example displays all storage subsystems on storage management providers that support Windows Offloaded Data 
    Transfers (ODX). Storage arrays that support ODX using the SMI-S protocol are not shown.
 
NAME
    Get-SupportedClusterSizes
     
SYNOPSIS
     
     
     
     
    PS C:\>
     
     
     
     
     
    PS C:\>
     
     
     
 
NAME
    Get-SupportedFileSystems
     
SYNOPSIS
     
     
     
     
    PS C:\>
     
     
     
     
     
    PS C:\>
     
     
     
 
NAME
    Get-TargetPort
     
SYNOPSIS
    Returns a TargetPort object associated with a specific port address and connection type.
     
    EXAMPLE 1
     
    PS C:\> $StorageSubsystem = Get-StorageSubsystem
     
     
    PS C:\> Get-Targetport -StorageSubsystem $StorageSubsystem
     
     
    This example returns a list of target ports on the specified storage subsystem.
 
NAME
    Get-TargetPortal
     
SYNOPSIS
    Returns a TargetPortal object.
     
    EXAMPLE 1
     
    PS C:\> Get-TargetPortal
     
     
    This example gets all target portals.
    EXAMPLE 2
     
    PS C:\> Get-TargetPortal -IPv4Address 192.168.0.1
     
     
    This example gets the target portal with the IPv4 address of 192.168.0.1.
 
NAME
    Get-VirtualDisk
     
SYNOPSIS
    Returns a list of VirtualDisk objects, across all storage pools, across all providers, or optionally a filtered 
    subset based on provided criteria.
     
    EXAMPLE 1
     
    PS C:\> Get-VirtualDisk
     
     
    This example returns all VirtualDisk objects across all visible StoragePool objects, across all visible 
    StorageProvider objects.
    EXAMPLE 2
     
    PS C:\> $stpool = (Get-StoragePool -FriendlyName "SpacesPool")
     
     
    PS C:\> Get-VirtualDisk -StoragePool $stpool
     
     
    This example lists only the virtual disks from the StoragePool object named SpacesPool.
    EXAMPLE 3
     
    PS C:\> Get-VirtualDisk | Where-Object –FilterScript {$_.HealthStatus -Ne "Healthy"}
     
     
    This example lists all virtual disks, across all pools, and all providers, which are not currently in a healthy 
    state.
    EXAMPLE 4
     
    PS C:\> $part = (Get-Partition -DriveLetter Y)
     
     
    PS C:\> Get-VirtualDisk -Partition $part
     
     
    This example gets the virtual disk associated with the partition with drive letter Y.
 
NAME
    Get-VirtualDiskSupportedSize
     
SYNOPSIS
    Returns all sizes supported by a storage pool for virtual disk creation based on the specified resiliency setting 
    name.
     
    EXAMPLE 1
     
    PS C:\> Get-VirtualDiskSupportedSize -ResiliencySettingsName Mirror
     
     
    This example lists the minimum and maximum supported sizes for virtual disk creation using the specified 
    resiliency settings name.
 
NAME
    Get-Volume
     
SYNOPSIS
    Gets the specified Volume object, or all Volume objects if no filter is provided.
     
    Example 1: Get  all volumes
     
    PS C:\> Get-Volume
     
     
    This example returns all volumes on all partitions, on all disks.
    Example 2: Get  the volume for a particular drive letter
     
    PS C:\> Get-Volume -DriveLetter C
    DriveLetter         FileSystemLabel     FileSystem          HealthStatus              SizeRemaining                
    Size 
    -----------         ---------------     ----------          ------------              -------------                
    ---- 
    C                                       NTFS                Healthy                        23.61 GB           
    465.42 GB
     
     
    This example gets the Volume object for drive letter C.
 
NAME
    Get-VolumeCorruptionCount
     
SYNOPSIS
     
     
     
     
    PS C:\>
     
     
     
     
     
    PS C:\>
     
     
     
 
NAME
    Get-VolumeScrubPolicy
     
SYNOPSIS
     
     
     
     
    PS C:\>
     
     
     
     
     
    PS C:\>
     
     
     
 
NAME
    Hide-VirtualDisk
     
SYNOPSIS
    Hides the virtual disk from the host when the Storage Management Provider in use does not support masking sets.
     
    EXAMPLE 1
     
    PS C:\> $iniport = (Get-InitiatorPort)
     
     
    PS C:\> $tarport = (Get-TargetPort)
     
     
    PS C:\> Hide-VirtualDisk -FriendlyName "SQLData_27a"  -TargetPortAddresses $tarport.NodeAddress -InitiatorAddress 
    $iniport.NodeAddress
     
     
    This example displays hides the virtual disk when the storage provider does not support masking sets. This cmdlet 
    can be used either locally or remotely, to hide or deny access.
 
NAME
    Initialize-Disk
     
SYNOPSIS
    Initializes a RAW disk for first time use, enabling the disk to be formatted and used to store data.
     
    Example 1: Initialize a disk using default values
     
    PS C:\> Initialize-Disk -Number 1
     
     
    This example initializes the first disk in the computer (disk number 1), using the default values, which 
    initializes the disk using the GPT partition style.
    Example 2: Initialize a disk using the MBR partition style
     
    PS C:\> Initialize-Disk -Number 1 -PartitionStyle MBR
     
     
    This example initializes a disk using the MBR partition style.
    Example 3: Initialize a virtual disk
     
    PS C:\> Initialize-Disk -VirtualDisk (Get-VirtualDisk -FriendlyName UserData)
     
     
    This example uses the VirtualDisk parameter with the Get-VirtualDisk cmdlet to get a virtual disk with the 
    friendly name UserData, and initialize the Disk object associated with the virtual disk.
 
NAME
    Mount-DiskImage
     
SYNOPSIS
    Mounts a previously created disk image (virtual hard disk or ISO), making it appear as a normal disk.
     
    Example 1: Mounting an ISO
     
    PS C:\> Mount-DiskImage -ImagePath "E:\ISO-Files\My US Visit Fall 2010 Pictures.iso"
     
     
    This example mounts an ISO by specifying the image path.
 
NAME
    New-MaskingSet
     
SYNOPSIS
    Creates a new masking set.
     
    Example 1: Create a masking set
     
    PS C:\> $StorageSubsystem = Get-StorageSubsystem
     
     
    PS C:\> $VirtualDisks = Get-VirtualDisk -Name "Virtual01,Virtual02"
     
     
    PS C:\> $Initiator = Get-InitiatorPort
     
     
    PS C:\> $Target = Get-TargetPort
     
     
    PS C:\> New-MaskingSet -StorageSubsystemFriendlyName $StorageSubsystem.FriendlyName -VirtualDiskNames 
    $VirtualDisks.Name -FriendlyName "MyFirstMaskingSet"  -InitiatorAddresses $Initiator.NodeAddress 
    -TargetPortAddresses $Target.PortAddress
     
     
    This example collects the necessary information and then creating a new masking set to expose the virtual disks 
    that have the friendly names VirtualDisk01 and VirtualDisk02 to the local machine.
 
NAME
    New-Partition
     
SYNOPSIS
    Creates a new partition on an existing Disk object.
     
    Example 1: Create a new partition on disk 1
     
    PS C:\> New-Partiton -DiskNumber 1 -UseMaximumSize -AssignDriveLetter
     
     
    This example creates a new partition on disk 1, using the maximum available space, and automatically assigning a 
    drive letter.
    Example 2: Get  all RAW disks, initialize the disks, partition, and format them
     
    This line gets all disk objects and then pipes the objects to the next command.
    PS C:\> Get-Disk |
     
    This line selects only objects where the PartitionStyle property value equals "RAW", and then pipes the objects to 
    the next command.
    PS C:\> Where-Object PartitionStyle –Eq "RAW" |
     
    This line initializes all Disk objects in the pipeline and then pipes the objects to the next cmdlet.
    PS C:\> Initialize-Disk -PassThru |
     
    This line creates a maximum sized partition on each initialized Disk object, assigns a drive letter to the 
    partitions, and then pipes the objects to the next cmdlet.
    PS C:\> New-Partition -AssignDriveLetter -UseMaximumSize |
     
    This line formats all newly partitioned disks.
    PS C:\> Format-Volume
     
     
    This example uses five cmdlets and the pipeline to get all disks, filter them for only RAW, unpartitioned disks, 
    initialize the disks, partition the disks, and then format them.
 
NAME
    New-StoragePool
     
SYNOPSIS
    Creates a new storage pool using a group of physical disks, and a specific storage subsystem exposed by a storage 
    provider.
     
    Example 1: Create a new storage pool using Storage Spaces
     
    This line uses the Get-PhysicalDisk cmdlet to get all PhysicalDisk objects than are not yet in a (concrete) 
    storage pool, and assigns the array of objects to the $PhysicalDisks variable.
    PS C:\> $PhysicalDisks = (Get-PhysicalDisk -CanPool $True)
     
    This line creates a new storage pool using the $PhysicalDisks variable to specify the disks to include from the 
    Storage Spaces subsystem (specified with a wildcard * to remove the need to modify the friendly name for different 
    computers).
    PS C:\> New-StoragePool -FriendlyName CompanyData -StorageSubsystemFriendlyName "Storage Spaces*"  -PhysicalDisks 
    $PhysicalDisks
     
     
    This example creates a new storage pool named CompanyData using the Storage Spaces subsytem, using the minimum 
    parameters, and assuming that there are no other storage subsystems attached to the computer that have available 
    disks.
    Example 2: Create a new pool and set defaults for virtual disks
     
    PS C:\> $PhysicalDisks = (Get-PhysicalDisk -CanPool $True) 
     
     
    PS C:\> New-StoragePool -FriendlyName CompanyData -StorageSubsystemFriendlyName "Storage Spaces*"  -PhysicalDisks 
    $PhysicalDisks -ResiliencySettingNameDefault Mirror -ProvisioningTypeDefault Thin –Verbose
     
     
    This example creates a new storage pool named CompanyData using the Storage Spaces subsystem and sets default 
    values for virtual disk creation.
    Example 3: Create a new storage pool, virtual disk, partition, and volume
     
    This line gets the storage subsystem object for the Storage Spaces subsystem, passes it to the Get-PhysicalDisk 
    cmdlet, which then gets the physical disks in the specified subsystem that are available to add to a storage pool, 
    and assigns these disks to the $PhysicalDisks variable.
    PS C:\> $PhysicalDisks = Get-StorageSubSystem -FriendlyName "Storage Spaces*"  | Get-PhysicalDisk -CanPool $True
     
    This line creates a new storage pool using the physical disks in the $PhysicalDisks variable, and then passes the 
    new storage pool down the pipeline.
    PS C:\> New-StoragePool -FriendlyName CompanyData -StorageSubsystemFriendlyName "Storage Spaces*"  -PhysicalDisks 
    $PhysicalDisks |
     
    This line creates a new virtual disk on the passed in storage pool, and then passes the new virtual disk down the 
    pipeline.
    PS C:\> New-VirtualDisk -FriendlyName UserData -Size 100GB -ProvisioningType Thin |
     
    This line initializes the disk that was passed in, and then passes the disk down the pipeline.
    PS C:\> Initialize-Disk -PassThru |
     
    This line creates a new partition on the disk that was passed in, assigns it the next available drive letter, and 
    then passes the partition down the pipeline.
    PS C:\> New-Partition -AssignDriveLetter -UseMaximumSize |
     
    This line formats the partition that was passed in.
    PS C:\> Format-Volume
     
     
    This example creates a new storage pool, and then makes use of the pipeline to create a new virtual disk in the 
    pool, initialize the disk, create a new partition on the disk, and then format the new partition (volume).
 
NAME
    New-StorageSubsystemVirtualDisk
     
SYNOPSIS
    Allows the creation of a VirtualDisk object on a storage subsystem that does not support creation of storage pools.
     
    EXAMPLE 1
     
    PS C:\> $stsubsys = (Get-StorageSubsystem)
     
     
    PS C:\> New-StorageSubsystemVirtualDisk -StorageSubsystemUniqueId $stsubsys.UniqueID -FriendlyName "VirtualDisk01"
    -Size "5GB" -ProvisioningType Fixed
     
     
    This example creates a Virtual Disk named VirtualDisk01 on the provided StorageSubsystem without the use of a 
    Storage Pool
 
NAME
    New-VirtualDisk
     
SYNOPSIS
    Creates a new virtual disk in the specified storage pool.
     
    Example 1: Creating a 100 GB virtual disk using default settings
     
    PS C:\> New-VirtualDisk -StoragePoolFriendlyName CompanyData -FriendlyName UserData -Size 100GB
     
     
    This example creates a virtual disk named UserData from the storage pool named CompanyData that is 100GB in size, 
    using the storage pool default settings for unspecified parameters.
    Example 2: Creating a thinly-provisioned mirror
     
    PS C:\> New-VirtualDisk -StoragePoolFriendlyName CompanyData -FriendlyName DataWarehouse –ResiliencySettingName 
    Mirror -Size 42TB -ProvisioningType Thin
     
     
    This example creates a virtual disk named DataWarehouse, which is 42TB in size, uses the Mirror resiliency 
    setting, and is thinly provisioned.
    Example 3: Creating a three-way mirror
     
    PS C:\> New-VirtualDisk -StoragePoolFriendlyName CompanyData -FriendlyName BusinessCritical -ResiliencySettingName 
    Mirror -NumberOfDataCopies 3 -Size 42TB -ProvisioningType Thin
     
     
    This example creates a 42 TB thinly-provisioned virtual disk on the Storage Spaces subsystem, using the Mirror 
    resiliency setting with three data copies. This creates a three-way mirror that is capable of tolerating two disk 
    failures).
    Example 4: Creating a two-column mirror
     
    PS C:\> New-VirtualDisk -StoragePoolFriendlyName CompanyData -FriendlyName BusinessCritical -ResiliencySettingName 
    Mirror - -Size 42TB -ProvisioningType Thin -NumberOfColumns 2
     
     
    This example creates a thinly-provisioned virtual disk on the Storage Spaces subsystem that uses two columns, 
    regardless of how many physical disks are in the storage pool above the two-disk minimum for a two-way mirror.
 
NAME
    New-VirtualDiskClone
     
SYNOPSIS
    Creates a new clone of a specified virtual disk.
     
    EXAMPLE 1
     
    PS C:\> New-VirtualDiskClone -VirtualDiskFriendlyName "SQLData5" -TargetVirtualDiskName "SQLData5Clone"
    -TargetStoragePoolName "ClonePool"
     
     
    This example creates a full clone of the specified Virtual Disk object. Note: This cmdlet requires support from 
    the Storage Management Provider. This cmdlet returns the Virtual Disk object for the newly clone.
     
 
NAME
    New-VirtualDiskSnapshot
     
SYNOPSIS
    Creates a new snapshot of the specified virtual disk.
     
    EXAMPLE 1
     
    PS C:\> New-VirtualDiskSnapshot -VirtualDiskFriendlyName "SQLData5" -TargetStoragePoolName "Snapshots"
     
     
    This example creates a snapshot of the Virtual Disk object. The cmdlet returns the resultant snapshot as a new 
    Virtual Disk object.
 
NAME
    Optimize-Volume
     
SYNOPSIS
    Optimizes a volume, performing such tasks as defragmentation and trim.
     
    Example 1: Perform TRIM optimization
     
    PS C:\> Optimize-Volume -DriveLetter H -ReTrim –Verbose
     
     
    This example optimizes drive H by re-sending Trim requests. This is useful on SSD media, and thinly provisioned 
    storage.
    Example 2: Analyze a volume
     
    PS C:\> Optimize-Volume -DriveLetter H -Analyze –Verbose
     
     
    This example reports only the current optimization state of drive H.
    Example 3: Defragment a volume
     
    PS C:\> Optimize-Volume -DriveLetter H -Defrag –Verbose
     
     
    This example defragments drive H.
    Example 4: Perform slab consolidation
     
    PS C:\> Optimize-Volume -DriveLetter H -SlabConsolidate –Verbose
     
     
    This example performs slab consolidation on the storage space backing volume H.
 
NAME
    Remove-InitiatorId
     
SYNOPSIS
    Removes an initiator identifier (ID).
     
    Example 1: Remove an iSCSI initiator ID
     
    PS C:\> Remove-InitiatorID -InitiatorAddress $SomeiSCSIIQN
     
     
    This example removes the iSCSI IQN previously stored in the variable $SomeIscsiIQN from the list of Initiator IDs.
 
NAME
    Remove-InitiatorIdFromMaskingSet
     
SYNOPSIS
    Removes an initiator identifier (ID) from a masking set.
     
    Example 1: Remove an initiator ID from a masking set
     
    PS C:\> $initid = (Get-InitiatorID)
     
     
    PS C:\> Remove-InitiatorIDFromMaskingSet -InitiatorIDs $initid -MaskingSetFriendlyName "Server1A-MaskingSet"
     
     
    This example removes an initator ID from a masking set. This cmdlet prevents the specified initiator ID from 
    accessing any of the resources defined in the masking set
 
NAME
    Remove-MaskingSet
     
SYNOPSIS
    Removes a masking set.
     
    Example 1: Remove a masking set
     
    PS C:\> Remove-MaskingSet -FriendlyName "MaskingSet01"
     
     
    This example removes the masking set named MaskingSet01. The virtual disks that were defined in this masking set 
    are no longer accessible to any initiators defined in this masking set. A new masking set must be created to 
    restore access to the virtual disks from a Windows computer acting as a client to the storage subsystem.
 
NAME
    Remove-Partition
     
SYNOPSIS
    Deletes the specified Partition object on an existing disk and any underlying Volume objects.
     
    EXAMPLE 1
     
    PS C:\> Remove-Partition -DriveLetter Y
     
     
    This example removes the partition associated with drive letter Y.
    EXAMPLE 2
     
    PS C:\> Remove-Partition -DiskNumber 5 -PartitionNumber 2
     
     
    This example removes partition number 2 from disk number 5.
 
NAME
    Remove-PartitionAccessPath
     
SYNOPSIS
    Removes an access path such as a drive letter or folder from a partition.
     
    EXAMPLE 1
     
    PS C:\> Remove-PartitionAccessPath -DiskNumber 5 -PartitionNumber 2 -AccessPath K:
     
     
    This example specifies a drive letter, or a mount point.
 
NAME
    Remove-PhysicalDisk
     
SYNOPSIS
    Removes a physical disk from a specified storage pool.
     
    EXAMPLE 1
     
    PS C:\> $PDToRemove = Get-PhysicalDisk -Friendlyname "PhysicalDisk25"
     
     
    PS C:\> Remove-PhysicalDisk -PhysicalDisks $PDToRemove -StoragePoolFriendlyName "DemoPool"
     
     
    This example removes a specific Physical Disk object from the specified storage pool.
 
NAME
    Remove-StoragePool
     
SYNOPSIS
    Deletes a storage pool and associated VirtualDisk objects.
     
    EXAMPLE 1
     
    PS C:\> Remove-StoragePool -FriendlyName "DemoPool"
     
     
    This example removes the storage pool with the friendly name DemoPool. When  a storage pool is created, it consumes 
    one or more physical disks to create the pool, from which virtual disks are subsequently created. The removal of a 
    storage pool, which can only be performed after all virtual disks have first been removed, destroys the storage 
    pool, and returns the physical disks back to a non-pooled state, where they may be re-consumed.
 
NAME
    Remove-TargetPortFromMaskingSet
     
SYNOPSIS
    Removes a specified target port from a masking set.
     
    EXAMPLE 1
     
    PS C:\> $masksfname = “MyFirstMaskingSet”
     
     
    PS C:\> $targetpaddress = (Get-TargetPort).PortAddress
     
     
    PS C:\> Remove-TargetPortFromMaskingSet -MaskingSetFriendlyName $masksfname -TargetPortAddresses $targetpaddress
     
     
    This example removes a target port from a masking set. And  prevents any of the VirtualDisk or InitiatorId objects 
    defined in the masking set from utilizing the target port.
 
NAME
    Remove-VirtualDisk
     
SYNOPSIS
    Deletes an existing virtual disk and reclaims the used space for use by other virtual disks in the same storage 
    pool.
     
    EXAMPLE 1
     
    PS C:\> Remove-VirtualDisk -FriendlyName "Scratch-Data01"
     
     
    This example permanently deletes a VirtualDisk object and all child items, such as the Disk, Partition, and Volume 
    objects. Not  a recoverable action. This cmdlet is used to delete the VirtualDisk object, and return the space it 
    used to the storage pool that exposes the VirtualDisk object.
     
 
NAME
    Remove-VirtualDiskFromMaskingSet
     
SYNOPSIS
    Removes a virtual disk from a specified masking set to block access to the virtual disk by an InitiatorIds object 
    defined in the masking set.
     
    EXAMPLE 1
     
    PS C:\> Remove-VirtualDiskFromMaskingSet -MaskingSetFriendlyName "Masking Set 1"  -VirtualDiskNames "Virtual Disk 
    1,Virtual Disk 2,Virtual Disk 3"
     
     
    This example removes a virtual disk from a masking set.
 
NAME
    Rename-MaskingSet
     
SYNOPSIS
    Renames an existing masking set.
     
    Example 1: Rename a masking set
     
    PS C:\> Rename-MaskingSet -FriendlyName "MaskingSet" -NewFriendlyName "Server1A-MaskingSet"
     
     
    This example renames the friendly name of the existing masking set to make it more descriptive.
 
NAME
    Repair-FileIntegrity
     
SYNOPSIS
     
     
     
     
    PS C:\>
     
     
     
     
     
    PS C:\>
     
     
     
 
NAME
    Repair-VirtualDisk
     
SYNOPSIS
    Performs repairs on a virtual disk that is unhealthy.
     
    EXAMPLE 1
     
    PS C:\> Repair-VirtualDisk -FriendlyName Space05
     
     
    This example repairs the virtual disk named Space05 which is currently unhealthy.
    EXAMPLE 2
     
    PS C:\> Get-VirtualDisk | Where-Object –FilterScript {$_.HealthStatus -Eq "Unhealthy"} | Repair-VirtualDisk
     
     
    This example gets all of the unhealthy VirtualDisk objects, and runs repairs on all of them serially.
     
 
NAME
    Repair-Volume
     
SYNOPSIS
    Performs repairs on a volume.
     
    EXAMPLE 1
     
    PS C:\> Repair-Volume -DriveLetter H –Scan
     
     
    This example scans drive H and reports errors only.
    EXAMPLE 2
     
    PS C:\> Repair-Volume -DriveLetter H –OfflineScanAndFix
     
     
    This example takes drive H offline, and fixes all issues.
    EXAMPLE 3
     
    PS C:\> Repair-Volume -DriveLetter H –SpotFix
     
     
    This example uses the spot verifier functionality to quickly fix drive H.
 
NAME
    Reset-PhysicalDisk
     
SYNOPSIS
    Resets the status of a physical disk.
     
    EXAMPLE 1
     
    PS C:\> Reset-PhysicalDisk -FriendlyName "PhysicalDisk5"
     
     
    This example resets the state of a specific physical disk.
    EXAMPLE 2
     
    PS C:\> $phydisk = (Get-Physicaldisk | Where-Object  –FilterScript {$_.HealthStatus -Eq "Unhealthy"}
     
     
    PS C:\> Reset-PhysicalDisk -FriendlyName $phydisk.FriendlyName
     
     
    This example resets all of the unhealthy physical disks.
 
NAME
    Reset-StorageReliabilityCounter
     
SYNOPSIS
     
     
     
     
    PS C:\>
     
     
     
     
     
    PS C:\>
     
     
     
 
NAME
    Resize-Partition
     
SYNOPSIS
    Resizes a partition and the underlying file system.
     
    EXAMPLE 1
     
    PS C:\> Get-Partition -DiskNumber 3 -PartitionNumber 2
    Disk Number: 3 
      
    PartitionNumber  DriveLetter Offset                                        Size Type 
    ---------------  ----------- ------                                        ---- ---- 
    2                D           135266304                                931.39 GB Basic 
    Resize the partition to 900GB.
    PS C:\> Resize-Partition -DiskNumber 3 -PartitionNumber 2 -Size (900GB)
     
    The partition is now 900GB.
    PS C:\> Get-Partition -DiskNumber 3 -PartitionNumber 2
    Disk Number: 3 
      
    PartitionNumber  DriveLetter Offset                                        Size Type 
    ---------------  ----------- ------                                        ---- ---- 
    2                D           135266304                                   900 GB Basic 
    Get the partition sizes.
    PS C:\> $size = (Get-PartitionSupportedSize –DiskNumber 3 –PartitionNumber 2)
     
    Resize to the maximum size.
    PS C:\> Resize-Partition -DiskNumber 3 –PartitionNumber 2 -Size $size.MaximumSize
     
     
    This example starts with a 931.39 GB partition.
 
NAME
    Resize-VirtualDisk
     
SYNOPSIS
    Resizes an existing virtual disk to be larger or smaller.
     
    EXAMPLE 1
     
    PS C:\> Resize-VirtualDisk -FriendlyName "Sqldata5" -Size (25GB)
     
     
    This example changes the size of the VirtualDisk object. Note: Any associated Partition object must also be 
    resized to utilize this space.
 
NAME
    Set-Disk
     
SYNOPSIS
    Takes a Disk object or unique disk identifiers and a set of attributes, and updates the physical disk on the 
    system.
     
    EXAMPLE 1
     
    PS C:\> Set-Disk -Number 5 -IsOffline $False
     
     
    This example takes a disk that is offline and makes it online.
    EXAMPLE 2
     
    PS C:\> Set-Disk –Number 5 -IsReadonly $False
     
     
    This example takes a disk that is read-only and makes it writeable.
 
NAME
    Set-FileIntegrity
     
SYNOPSIS
     
     
     
     
    PS C:\>
     
     
     
     
     
    PS C:\>
     
     
     
 
NAME
    Set-InitiatorPort
     
SYNOPSIS
    Sets properties on the InitiatorPort object.
     
    Example 1: Change the node address
     
    PS C:\> $address = (Get-InitiatorPort)
     
     
    PS C:\> $address | Select  NodeAddress
    NodeAddress 
    ----------- 
    iqn.1991-05.com.contoso:test-pc2.contoso.com 
     
    PS C:\> Set-InitiatorPort -NodeAddress $address.NodeAddress -NewNodeAddress "iqn.test2"
     
     
    This example uses a node address from the Get-InitiatorPort cmdlet as input.
 
NAME
    Set-Partition
     
SYNOPSIS
    Sets attributes of a partition, such as active, read-only, and offline states.
     
    Example 1: Set  the partition to read-only
     
    PS C:\> Set-Partition -DriveLetter Y -IsReadOnly $True
     
     
    This example makes partition Y read-only.
    Example 2: Set  an MBR partition to active
     
    PS C:\> Set-Partition -DriveLetter Y -IsActive $True
     
     
    This example makes the MBR partition Y active.
    Example 3: Hide the partition
     
    PS C:\> Set-Partition -DriveLetter Y -IsHidden $True
     
     
    This example hides partition Y.
    Example 4: Take the partition offline
     
    PS C:\> Set-Partition -DriveLetter Y -IsOffline $True
     
     
    This example takes the partition and volume offline.
    Example 5: Change the drive letter
     
    PS C:\> Set-Partition -DriveLetter Y -NewDriveLetter Z
     
     
    This example changes the drive letter from Y to Z.
 
NAME
    Set-PhysicalDisk
     
SYNOPSIS
    Sets attributes on a specific physical disk.
     
    Example 1: Change the friendly name of a physical disk
     
    PS C:\> Set-PhysicalDisk -FriendlyName "PhysicalDisk4"  -NewFriendlyName "PhysicalDiskInSlot5"
     
     
    This example changes the friendly name of PhysicalDisk4 to PhysicalDiskInSlot5.
    Example 2: Change the Usage of a physical disk
     
    PS C:\> Set-PhysicalDisk -FriendlyName PhysicalDisk2 -Usage AutoSelect
     
     
    This example changes the Usage property of PhysicalDisk2 to AutoSelect.
 
NAME
    Set-ResiliencySetting
     
SYNOPSIS
    Modifies the properties of the specified resiliency setting name.
     
    EXAMPLE 1
     
    PS C:\> Set-ResiliencySetting -Name "Mirror" -NumberofColumnsDefault 8 -NumberofDataCopies 2
     
     
    This example sets the default number of columns to eight on virtual disks that use the Mirror setting, with the 
    number of data copies set to two, indicating a two-way mirror, instead of a three-way mirror. A two-way mirror 
    with eight columns requires 16 physical disks to create.
 
NAME
    Set-StoragePool
     
SYNOPSIS
    Modifies the properties of the specified storage pool.
     
    Example 1: Change the friendly name
     
    PS C:\> Set-StoragePool -FriendlyName StoragePool -NewFriendlyName StoragePool2
     
     
    This example changes the friendly name of StoragePool to StoragePool2.
    Example 2: Make a read-only storage pool writeable
     
    PS C:\> Set-StoragePool -FriendlyName "Storage Pool 1"  -IsReadOnly $False
     
     
    This example makes the storage pool named Storage Pool 1 writable when it is in a read-only state.
    Example 3: Set  the default resiliency and provisioning settings
     
    PS C:\> Set-StoragePool -FriendlyName "Storage Pool 1"  -ResiliencySettingsNameDefault Mirror 
    -ProvisioningTypeDefault Thin
     
     
    This example makes any new virtual disks by default use the Mirror resiliency setting and thin provisioning.
 
NAME
    Set-StorageSetting
     
SYNOPSIS
    Adjusts or configures current storage settings of the StorageSetting object.
     
    EXAMPLE 1
     
    PS C:\> Set-StorageSettings -NewDiskPolicy OfflineAll
     
     
    This example changes the new disk policy so that all newly attached disks remain offline.
    EXAMPLE 2
     
    PS C:\> Set-StorageSettings -NewDiskPolicy OfflineInternal
     
     
    This example changes the new disk policy so that all newly attached disks on a local bus remain offline.
    EXAMPLE 3
     
    PS C:\> Set-StorageSettings -NewDiskPolicy OfflineShared
     
     
    This example changes the new disk policy so that all new shared bus disks remain offline and all new local bus 
    disks remain online.
    EXAMPLE 4
     
    PS C:\> Set-StorageSettings -NewDiskPolicy OnlineAll
     
     
    This example changes the new disk policy so that all new disks are brought online, regardless of whether the disk 
    are on a local or shared bus.
 
NAME
    Set-StorageSubsystem
     
SYNOPSIS
    Sets the friendly name or description of the specified StorageSubsystem object.
     
    EXAMPLE 1
     
    PS C:\> $inpobject = (Get-StorageSubsystem)
     
     
    PS C:\> Set-StorageSubsystem -InputObject $inpobject -Description "Non-Production Testing only"
     
     
    This example changes the Description field on a StorageSubsystem object.
 
NAME
    Set-VirtualDisk
     
SYNOPSIS
    Modifies the attributes of an existing virtual disk.
     
    EXAMPLE 1
     
    PS C:\> Set-VirtualDisk -FriendlyName VirtualDisk1 -NewFriendlyName "Storage For Contoso"
     
     
    This example changes the friendly name of a virtual disk.
    EXAMPLE 2
     
    PS C:\> Set-VirtualDisk -FriendlyName "Storage For Contoso"  -IsManualAttach $False
     
     
    This example attaches a virtual disk that is currently set to manual-attach.
 
NAME
    Set-Volume
     
SYNOPSIS
    Sets or changes the file system label of an existing volume.
     
    EXAMPLE 1
     
    PS C:\> Set-Volume -FileSystemLabel "Test" -NewFileSystemLabel "TestData"
     
     
    This example changes the file system label from test to TestData.
    EXAMPLE 2
     
    PS C:\> Format-Volume -InputObject $PartitionObject -FileSystem NTFS -NewFileSystemLabel "TestData" -ClusterSize 
    (8K) -ShortFileNameSupport $False
     
     
    This example uses the specified Partition object as an input to format the volume on this partition with the NTFS 
    file system, using the file system label testdata with a cluster size of 8K, and with short filename support 
    disabled.
 
NAME
    Set-VolumeScrubPolicy
     
SYNOPSIS
     
     
     
     
    PS C:\>
     
     
     
     
     
    PS C:\>
     
     
     
 
NAME
    Show-VirtualDisk
     
SYNOPSIS
    Makes a virtual disk available to a host.
     
    Example 1: Make a virtual disk available to the local computer
     
    PS C:\> $initaddress = (Get-InitiatorPort)
     
     
    PS C:\> $tarport = (Get-TargetPort)
     
     
    PS C:\> Show-VirtualDisk -FriendlyName "SQLData_27a"  -TargetPortAddresses $tarport.NodeAddress -InitiatorAddress 
    $initaddress.NodeAddress
     
     
    This example makes the "SQLData_27a"  virtual disk available to all initiators and target ports of the local 
    computer.
 
NAME
    Update-Disk
     
SYNOPSIS
    Updates cached information about the specified Disk object only
     
    EXAMPLE 1
     
    PS C:\> Update-Disk –Number 0
     
     
    This example refreshes cached information about the specified disk.
 
NAME
    Update-HostStorageCache
     
SYNOPSIS
    Initiates an update on the host storage cache to reflect the current status of storage.
     
    EXAMPLE 1
     
    PS C:\> Update-HostStorageCache
     
     
    This example updates the host-side storage cache. This includes the Disk, Partition, and Volume objects and any 
    child-items. This cmdlet is equivalent to a VDS Rescan.
 
NAME
    Update-StorageProviderCache
     
SYNOPSIS
    Updates the cache of the service for a particular provider and associated child objects.
     
    Example 1: Perform a Full update of all objects
     
    PS C:\> Update-StorageProviderCache -DiscoveryLevel Full
     
     
    This example performs a Full update of the storage provider cache on all accessible storage providers, rescanning 
    all associated physical disks and reporting the state. This operation can be extremely time intensive in large or 
    enterprise environments; instead use parameters to scope the update.
    Example 2: Update PhysicalDisk objects for a particular storage provider
     
    PS C:\> Update-StorageProviderCache -StorageSubSystem (Get-StorageSubSystem -FriendlyName "StorageArray*") 
    -DiscoveryLevel Level3
     
     
    This example uses the StorageSubsystem parameter in association with the Get-StorageSubSystem cmdlet to get a 
    particular storage subsystem and then perform a Level3 update on its associated storage provider, discovering all 
    associated PhysicalDisk objects.
    Example 3: Update all objects for a specific storage pool
     
    PS C:\> Update-StorageProviderCache -Name "StorageArray"  -RootObject ([ref](Get-StoragePool "Storage pool"))
     
     
    This example uses the Name parameter to specify the storage provider to update, and uses the RootObject parameter 
    to specify the specific storage pool for which to update objects. Because RootObject takes PSReference objects as 
    input, you need to prepend the object call with [ref] to get a reference to the object instead of the object 
    itself.