ageEnclosure -FriendlyName $StorageEnclosureFriendlyName -CimSession $CimSession -ErrorAction Stop; break; }
        }

        if (-not $AsJob)
        {
            Write-Progress -Activity "Get-StorageFirmwareInformation" -PercentComplete 0 -CurrentOperation "Validating parameters" -Status "0/2"
        }

        # Would use a closure here, but jobs are run in their own session state.
        $methodblock = {
            param($session, $asjob, $inputobject)

            # Start-Job serializes/deserializes the CimSession,
            # which means it shows up here as having type Deserialized.CimSession.
            # Must recreate or cast the object in order to pass it to Get-CimInstance.
            if ($asjob)
            {
                $session = $session | New-CimSession
            }

            $errorObject = $null

            if (-not $asjob)
            {
                Write-Progress -Activity "Get-StorageFirmwareInformation" -PercentComplete 30 -CurrentOperation "Getting storage firmware information" -Status "1/2"
            }

            try
            {
                $progressPreference = "silentlyContinue"

                $output = Invoke-CimMethod -CimSession $session -InputObject $inputobject -MethodName GetFirmwareInformation -ErrorAction Stop

                $progressPreference = "Continue"

                $firmwareInformation = [pscustomobject]@{
                    Object                = $inputobject;
                    SupportsUpdate        = $output.SupportsUpdate;
                    NumberOfSlots         = $output.NumberOfSlots;
                    ActiveSlotNumber      = $output.ActiveSlotNumber;
                    SlotNumber            = $output.SlotNumber;
                    IsSlotWritable        = $output.IsSlotWritable;
                    FirmwareVersionInSlot = $output.FirmwareVersionInSlot;
                }

                $psCmdlet.WriteObject($firmwareInformation);
            }
            catch
            {
                $progressPreference = "Continue"

                $errorObject = CreateErrorRecord -ErrorId $_.FullyQualifiedErrorId `
                                                 -ErrorMessage $null `
                                                 -ErrorCategory $_.CategoryInfo.Category `
                                                 -Exception $_.Exception `
                                                 -TargetObject $_.TargetObject

                $psCmdlet.WriteError($errorObject)
            }

            if (-not $asjob)
            {
                Write-Progress -Activity "Get-StorageFirmwareInformation" -Completed -Status "2/2"
            }
        }

        if ($asjob)
        {
            $p = $true

            if ($PhysicalDiskInstance)
            {
                Start-Job -Name GetStorageFirmwareInformation -ScriptBlock $methodblock -ArgumentList @($CimSession, $p, $PhysicalDiskInstance)
            }
            elseif ($StorageEnclosureInstance)
            {
                Start-Job -Name GetStorageFirmwareInformation -ScriptBlock $methodblock -ArgumentList @($CimSession, $p, $StorageEnclosureInstance)
            }
        }
        else
        {
            if ($PhysicalDiskInstance)
            {
                &$methodblock $CimSession $p $PhysicalDiskInstance
            }
            elseif ($StorageEnclosureInstance)
            {
                &$methodblock $CimSession $p $StorageEnclosureInstance
            }
        }
    }
}


function Update-StorageFirmware
{
    [CmdletBinding( DefaultParameterSetName = "ByPhysicalDiskFriendlyName", ConfirmImpact="Medium" )]
    Param
    (
        #### -------------------- Parameter sets -------------------------------------####

        [System.String]
        [Parameter(
            ParameterSetName  = 'ByPhysicalDiskUniqueId',
            ValueFromPipeline = $true,
            Mandatory         = $true)]
        [ValidateNotNullOrEmpty()]
        [Alias("Id")]
        [Alias("PhysicalDiskUniqueId")]
        $UniqueId,

        [System.String]
        [Parameter(
            ParameterSetName  = 'ByPhysicalDiskFriendlyName',
            ValueFromPipeline = $true,
            Mandatory         = $true,
            Position          = 0)]
        [ValidateNotNullOrEmpty()]
        [Alias("PhysicalDiskFriendlyName")]
        $FriendlyName,

        [Microsoft.Management.Infrastructure.CimInstance]
        [PSTypeName("Microsoft.Management.Infrastructure.CimInstance#ROOT/Microsoft/Windows/Storage/MSFT_PhysicalDisk")]
        [Parameter(
            ParameterSetName  = 'ByPhysicalDisk',
            ValueFromPipeline = $true,
            Mandatory         = $true)]
        [ValidateNotNullOrEmpty()]
        [Alias("PhysicalDisk")]
        $InputObject,

        [System.String]
        [Parameter(
            ParameterSetName  = 'ByStorageEnclosureUniqueId',
            Mandatory         = $true)]
        [ValidateNotNullOrEmpty()]
        $StorageEnclosureUniqueId,

        [System.String]
        [Parameter(
            ParameterSetName  = 'ByStorageEnclosureFriendlyName',
            Mandatory         = $true,
            Position          = 0)]
        [ValidateNotNullOrEmpty()]
        $StorageEnclosureFriendlyName,

        [Microsoft.Management.Infrastructure.CimInstance]
        [PSTypeName("Microsoft.Management.Infrastructure.CimInstance#ROOT/Microsoft/Windows/Storage/MSFT_StorageEnclosure")]
        [Parameter(
            ParameterSetName  = 'ByStorageEnclosure',
            ValueFromPipeline = $true,
            Mandatory         = $true)]
        [ValidateNotNullOrEmpty()]
        $StorageEnclosure,

        #### ------------------------- Common method parameters ----------------------####

        [System.String]
        [Parameter(
            ParameterSetName = 'ByPhysicalDiskUniqueId',
            Mandatory        = $false)]
        [Parameter(
            ParameterSetName = 'ByPhysicalDiskFriendlyName',
            Mandatory        = $false)]
        [Parameter(
            ParameterSetName = 'ByPhysicalDisk',
            Mandatory        = $false)]
        [Parameter(
            ParameterSetName = 'ByStorageEnclosureUniqueId',
            Mandatory        = $false)]
        [Parameter(
            ParameterSetName = 'ByStorageEnclosureFriendlyName',
            Mandatory        = $false)]
        [Parameter(
            ParameterSetName = 'ByStorageEnclosure',
            Mandatory        = $false)]
        $ImagePath,

        [System.UInt16]
        [Parameter(
            ParameterSetName = 'ByPhysicalDiskUniqueId',
            Mandatory        = $false)]
        [Parameter(
            ParameterSetName = 'ByPhysicalDiskFriendlyName',
            Mandatory        = $false)]
        [Parameter(
            ParameterSetName = 'ByPhysicalDisk',
            Mandatory        = $false)]
        [Parameter(
            ParameterSetName = 'ByStorageEnclosureUniqueId',
            Mandatory        = $false)]
        [Parameter(
            ParameterSetName = 'ByStorageEnclosureFriendlyName',
            Mandatory        = $false)]
        [Parameter(
            ParameterSetName = 'ByStorageEnclosure',
            Mandatory        = $false)]
        $SlotNumber,

        #### -------------------- Powershell parameters ------------------------------####

        [Microsoft.Management.Infrastructure.CimSession]
        $CimSession,

        # Provided for compatibility with CDXML cmdlets, not actually used.
        [Int32]
        $ThrottleLimit,

        [Switch]
        $AsJob
    )

    Begin
    {
        $SourceCaller = "Microsoft.PowerShell"
    }

    Process
    {
        $info = $resources.info
        $p = $null

        if (-not $CimSession)
        {
            $CimSession = New-CimSession
        }

        ## Gather the instance object

        switch ($psCmdlet.ParameterSetName)
        {
            "ByPhysicalDisk"                 { $PhysicalDiskInstance = $InputObject; break; }
            "ByPhysicalDiskUniqueId"         { $PhysicalDiskInstance = Get-PhysicalDisk -UniqueId $UniqueId -CimSession $CimSession -ErrorAction Stop; break; }
            "ByPhysicalDiskFriendlyName"     { $PhysicalDiskInstance = Get-PhysicalDisk -FriendlyName $FriendlyName -CimSession $CimSession -ErrorAction Stop; break; }

            "ByStorageEnclosure"             { $StorageEnclosureInstance = $StorageEnclosure; break; }
            "ByStorageEnclosureUniqueId"     { $StorageEnclosureInstance = Get-StorageEnclosure -UniqueId $StorageEnclosureUniqueId -CimSession $CimSession -ErrorAction Stop; break; }
            "ByStorageEnclosureFriendlyName" { $StorageEnclosureInstance = Get-StorageEnclosure -FriendlyName $StorageEnclosureFriendlyName -CimSession $CimSession -ErrorAction Stop; break; }
        }

        if (-not $AsJob)
        {
            Write-Progress -Activity "Update-StorageFirmware" -PercentComplete 0 -CurrentOperation "Validating parameters" -Status "0/2"
        }

        ## Populate arguments list

        $arguments = @{}

        if ($PSBoundParameters.ContainsKey("ImagePath"))
        {
            $arguments.Add("ImagePath", $ImagePath)
        }

        if ($PSBoundParameters.ContainsKey("SlotNumber"))
        {
            $arguments.Add("SlotNumber", $SlotNumber)
        }

        # Would use a closure here, but jobs are run in their own session state.
        $methodblock = {
            param($session, $asjob, $inputobject, $arguments)

            # Start-Job serializes/deserializes the CimSession,
            # which means it shows up here as having type Deserialized.CimSession.
            # Must recreate or cast the object in order to pass it to Get-CimInstance.
            if ($asjob)
            {
                $session = $session | New-CimSession
            }

            $errorObject = $null

            if (-not $asjob)
            {
                Write-Progress -Activity "Update-StorageFirmware" -PercentComplete 30 -CurrentOperation "Updating storage firmware" -Status "1/2"
            }

            try
            {
                $progressPreference = "silentlyContinue"

                $output = Invoke-CimMethod -CimSession $session -InputObject $inputobject -MethodName UpdateFirmware -Arguments $arguments -ErrorAction Stop

                $progressPreference = "Continue"
            }
            catch
            {
                $progressPreference = "Continue"

                $errorObject = CreateErrorRecord -ErrorId $_.FullyQualifiedErrorId `
                                                 -ErrorMessage $null `
                                                 -ErrorCategory $_.CategoryInfo.Category `
                                                 -Exception $_.Exception `
                                                 -TargetObject $_.TargetObject

                $psCmdlet.WriteError($errorObject)
            }

            if (-not $asjob)
            {
                Write-Progress -Activity "Update-StorageFirmware" -Completed -Status "2/2"
            }
        }

        if ($asjob)
        {
            $p = $true

            if ($PhysicalDiskInstance)
            {
                Start-Job -Name UpdateStorageFirmware -ScriptBlock $methodblock -ArgumentList @($CimSession, $p, $PhysicalDiskInstance, $arguments)
            }
            elseif ($StorageEnclosureInstance)
            {
                Start-Job -Name UpdateStorageFirmware -ScriptBlock $methodblock -ArgumentList @($CimSession, $p, $StorageEnclosureInstance, $arguments)
            }
        }
        else
        {
            if ($PhysicalDiskInstance)
            {
                &$methodblock $CimSession $p $PhysicalDiskInstance $arguments
            }
            elseif ($StorageEnclosureInstance)
            {
                &$methodblock $CimSession $p $StorageEnclosureInstance $arguments
            }
        }
    }
}


function Get-PhysicalDiskStorageNodeView
{
    [CmdletBinding()]
    Param
    (
        [Microsoft.Management.Infrastructure.CimInstance]
        [PSTypeName("Microsoft.Management.Infrastructure.CimInstance#ROOT/Microsoft/Windows/Storage/MSFT_StorageNode")]
        [Parameter(
            ValueFromPipeline = $true)]
        $StorageNode,

        [Microsoft.Management.Infrastructure.CimInstance]
        [PSTypeName("Microsoft.Management.Infrastructure.CimInstance#ROOT/Microsoft/Windows/Storage/MSFT_PhysicalDisk")]
        [Parameter(
            ValueFromPipeline = $true)]
        $PhysicalDisk,

        [Microsoft.Management.Infrastructure.CimSession]
        $CimSession
    )

    Process
    {
        if (-not $CimSession)
        {
            $CimSession = New-CimSession
        }

        ## Gather the association objects
        $options = New-Object Microsoft.Management.Infrastructure.Options.CimOperationOptions

        if ($PSBoundParameters.ContainsKey("StorageNode"))
        {
            $options.SetCustomOption("InputClassName", "MSFT_StorageNode", $false)
            $options.SetCustomOption("InputObjectId", $StorageNode.ObjectId, $false)
        }
        elseif ($PSBoundParameters.ContainsKey("PhysicalDisk"))
        {
            $options.SetCustomOption("InputClassName", "MSFT_PhysicalDisk", $false)
            $options.SetCustomOption("InputObjectId", $PhysicalDisk.ObjectId, $false)
        }

        $results = $CimSession.EnumerateInstances($StorageNamespace,
                                                  "MSFT_StorageNodeToPhysicalDisk",
                                                  $options
                                                  )

        $enumerator = $results.GetEnumerator()
        $instances  = @()

        while ($enumerator.MoveNext())
        {
            $instance = $enumerator.Current

            if ($PSBoundParameters.ContainsKey("StorageNode"))
            {
                if ($instance.StorageNodeObjectId -ne $StorageNode.ObjectId)
                {
                    continue
                }
            }
            elseif ($PSBoundParameters.ContainsKey("PhysicalDisk"))
            {
                if ($instance.PhysicalDiskObjectId -ne $PhysicalDisk.ObjectId)
                {
                    continue
                }
            }

            $instances += $instance
        }

        $instances
    }
}


function Get-DiskStorageNodeView
{
    [CmdletBinding()]
    Param
    (
        [Microsoft.Management.Infrastructure.CimInstance]
        [PSTypeName("Microsoft.Management.Infrastructure.CimInstance#ROOT/Microsoft/Windows/Storage/MSFT_StorageNode")]
        [Parameter(
            ValueFromPipeline = $true)]
        $StorageNode,

        [Microsoft.Management.Infrastructure.CimInstance]
        [PSTypeName("Microsoft.Management.Infrastructure.CimInstance#ROOT/Microsoft/Windows/Storage/MSFT_Disk")]
        [Parameter(
            ValueFromPipeline = $true)]
        $Disk,

        [Microsoft.Management.Infrastructure.CimSession]
        $CimSession
    )

    Process
    {
        if (-not $CimSession)
        {
            $CimSession = New-CimSession
        }

        ## Gather the association objects
        $options = New-Object Microsoft.Management.Infrastructure.Options.CimOperationOptions

        if ($PSBoundParameters.ContainsKey("StorageNode"))
        {
            $options.SetCustomOption("InputClassName", "MSFT_StorageNode", $false)
            $options.SetCustomOption("InputObjectId", $StorageNode.ObjectId, $false)
        }
        elseif ($PSBoundParameters.ContainsKey("Disk"))
        {
            $options.SetCustomOption("InputClassName", "MSFT_Disk", $false)
            $options.SetCustomOption("InputObjectId", $Disk.ObjectId, $false)
        }

        $results = $CimSession.EnumerateInstances($StorageNamespace,
                                                  "MSFT_StorageNodeToDisk",
                                                  $options
                                                  )

        $enumerator = $results.GetEnumerator()
        $instances  = @()

        while ($enumerator.MoveNext())
        {
            $instance = $enumerator.Current

            if ($PSBoundParameters.ContainsKey("StorageNode"))
            {
                if ($instance.StorageNodeObjectId -ne $StorageNode.ObjectId)
                {
                    continue
                }
            }
            elseif ($PSBoundParameters.ContainsKey("Disk"))
            {
                if ($instance.DiskObjectId -ne $Disk.ObjectId)
                {
                    continue
                }
            }

            $instances += $instance
        }

        $instances
    }
}


function Get-StorageEnclosureStorageNodeView
{
    [CmdletBinding()]
    Param
    (
        [Microsoft.Management.Infrastructure.CimInstance]
        [PSTypeName("Microsoft.Management.Infrastructure.CimInstance#ROOT/Microsoft/Windows/Storage/MSFT_StorageNode")]
        [Parameter(
            ValueFromPipeline = $true)]
        $StorageNode,

        [Microsoft.Management.Infrastructure.CimInstance]
        [PSTypeName("Microsoft.Management.Infrastructure.CimInstance#ROOT/Microsoft/Windows/Storage/MSFT_StorageEnclosure")]
        [Parameter(
            ValueFromPipeline = $true)]
        $StorageEnclosure,

        [Microsoft.Management.Infrastructure.CimSession]
        $CimSession
    )

    Process
    {
        if (-not $CimSession)
        {
            $CimSession = New-CimSession
        }

        ## Gather the association objects
        $options = New-Object Microsoft.Management.Infrastructure.Options.CimOperationOptions

        if ($PSBoundParameters.ContainsKey("StorageNode"))
        {
            $options.SetCustomOption("InputClassName", "MSFT_StorageNode", $false)
            $options.SetCustomOption("InputObjectId", $StorageNode.ObjectId, $false)
        }
        elseif ($PSBoundParameters.ContainsKey("StorageEnclosure"))
        {
            $options.SetCustomOption("InputClassName", "MSFT_StorageEnclosure", $false)
            $options.SetCustomOption("InputObjectId", $StorageEnclosure.ObjectId, $false)
        }

        $results = $CimSession.EnumerateInstances($StorageNamespace,
                                                  "MSFT_StorageNodeToStorageEnclosure",
                                                  $options
                                                  )

        $enumerator = $results.GetEnumerator()
        $instances  = @()

        while ($enumerator.MoveNext())
        {
            $instance = $enumerator.Current

            if ($PSBoundParameters.ContainsKey("StorageNode"))
            {
                if ($instance.StorageNodeObjectId -ne $StorageNode.ObjectId)
                {
                    continue
                }
            }
            elseif ($PSBoundParameters.ContainsKey("StorageEnclosure"))
            {
                if ($instance.StorageEnclosureObjectId -ne $StorageEnclosure.ObjectId)
                {
                    continue
                }
            }

            $instances += $instance
        }

        $instances
    }
}


function Get-StorageHealthAction
{
    [CmdletBinding()]
    Param
    (
        [string[]]
        [Parameter(
            Mandatory         = $true,
            ValueFromPipeline = $true,
            ParameterSetName  = "ByUniqueId")]
         $UniqueId,

        [CimInstance]
        [Parameter(
            Mandatory         = $false,
            ValueFromPipeline = $true,
            ParameterSetName  = "InputObject")]
        $InputObject,

        [Microsoft.Management.Infrastructure.CimSession]
        $CimSession,

        # Provided for compatibility with CDXML cmdlets, not actually used.
        [Int32]
        $ThrottleLimit,

        [Switch]
        $AsJob
    )

    Begin{}

    Process
    {
        $info = $resources.info
        $p = $null
        $methodName = "GetActions"

        if (-not $CimSession)
        {
            $CimSession = New-CimSession
        }

        if ($UniqueId)
        {
            # Would use a closure here, but jobs are run in their own session state.
            $block = {
                param($session, $asjob, $ns, $id)

                # Start-Job serializes/deserializes the CimSession,
                # which means it shows up here as having type Deserialized.CimSession.
                # Must recreate or cast the object in order to pass it to Get-CimInstance.
                if ($asjob)
                {
                    $session = $session | New-CimSession
                }

                Get-CimInstance -CimSession $session -Query "Select * From MSFT_HealthAction Where UniqueId='$id'" -Namespace $ns

            }

            if ($asjob)
            {
                $p = $true
                Start-Job -ScriptBlock $block -ArgumentList @($CimSession, $p, $StorageNamespace, $UniqueId)
            }
            else
            {
                if ($pscmdlet.ShouldProcess($info, $resources.warning, $info))
                {
                    &$block $CimSession $p $StorageNamespace $UniqueId
                }
            }
        }
        elseif ($InputObject.CimClass.CimClassName -eq "MSFT_HealthAction")
        {
            # Would use a closure here, but jobs are run in their own session state.
            $block = {
                param($session, $asjob, $io)

                # Start-Job serializes/deserializes the CimSession,
                # which means it shows up here as having type Deserialized.CimSession.
                # Must recreate or cast the object in order to pass it to Get-CimInstance.
                if ($asjob)
                {
                    $session = $session | New-CimSession
                }

                $io | Get-CimInstance -CimSession $session

            }

            if ($asjob)
            {
                $p = $true
                Start-Job -ScriptBlock $block -ArgumentList @($CimSession, $p, $InputObject)
            }
            else
            {
                if ($pscmdlet.ShouldProcess($info, $resources.warning, $info))
                {
                    &$block $CimSession $p $InputObject
                }
            }
        }
        elseif (-not $InputObject -or ( $InputObject.CimClass.CimClassName -eq "MSFT_StorageHealth" ))
        {
            $className = "MSFT_HealthAction"
            $block = {
                param($session, $ns, $asjob, $cn)

                # Start-Job serializes/deserializes the CimSession,
                # which means it shows up here as having type Deserialized.CimSession.
                # Must recreate or cast the object in order to pass it to Get-CimInstance.
                if ($asjob)
                {
                    $session = $session | New-CimSession
                }

                Get-CimInstance -CimSession $session -Namespace $ns -ClassName $cn
            }

            if ($asjob)
            {
                $p = $true
                Start-Job -ScriptBlock $block -ArgumentList @($CimSession, $StorageNamespace, $p, $className)
            }
            else
            {
                if ($pscmdlet.ShouldProcess($info, $resources.warning, $info))
                {
                    &$block $CimSession $StorageNamespace $p $className
                }
            }
        }
        else
        {
            # Would use a closure here, but jobs are run in their own session state.
            $block = {
                param($session, $ns, $asjob, $mn, $io)

                # Start-Job serializes/deserializes the CimSession,
                # which means it shows up here as having type Deserialized.CimSession.
                # Must recreate or cast the object in order to pass it to Get-CimInstance.
                if ($asjob)
                {
                    $session = $session | New-CimSession
                }

                $r = Invoke-CimMethod -CimSession $session -InputObject $io -MethodName $mn -Confirm:$false

                for($i = 0; $i -lt $r.Count - 1; $i++)
                {
                    $r[$i].ItemValue
                }
            }

            if ($asjob)
            {
                $p = $true
                Start-Job -ScriptBlock $block -ArgumentList @($CimSession, $StorageNamespace, $p, $methodName, $InputObject)
            }
            else
            {
                if ($pscmdlet.ShouldProcess($info, $resources.warning, $info))
                {
                    &$block $CimSession $StorageNamespace $p $methodName $InputObject
                }
            }
        }
    }
}


function Get-StorageFaultDomain
{
    [CmdletBinding( DefaultParameterSetName = "EnumerateFaultDomains" )]
    Param
    (
        #### -------------------- Parameter sets -------------------------------------####

        [Microsoft.Management.Infrastructure.CimInstance]
        [PSTypeName("Microsoft.Management.Infrastructure.CimInstance#ROOT/Microsoft/Windows/Storage/MSFT_StorageSubsystem")]
        [Parameter(
            ParameterSetName  = 'ByStorageSubsystem',
            ValueFromPipeline = $true,
            Mandatory         = $true)]
        [ValidateNotNullOrEmpty()]
        $StorageSubsystem,

        [Microsoft.Management.Infrastructure.CimInstance]
        [PSTypeName("Microsoft.Management.Infrastructure.CimInstance#ROOT/Microsoft/Windows/Storage/MSFT_StorageFaultDomain")]
        [Parameter(
            ParameterSetName  = 'ByStorageFaultDomain',
            ValueFromPipeline = $true,
            Mandatory         = $true)]
        [ValidateNotNullOrEmpty()]
        $StorageFaultDomain,

        [Microsoft.Management.Infrastructure.CimInstance]
        [PSTypeName("Microsoft.Management.Infrastructure.CimInstance#ROOT/Microsoft/Windows/Storage/MSFT_VirtualDisk")]
        [Parameter(
            ParameterSetName  = 'ByVirtualDisk',
            ValueFromPipeline = $true,
            Mandatory         = $true)]
        [ValidateNotNullOrEmpty()]
        $VirtualDisk,

        #### ------------------------- Common parameters -----------------------------####

        [System.String]
        [Parameter(
            ParameterSetName = 'EnumerateFaultDomains',
            Mandatory        = $false)]
        [Parameter(
            ParameterSetName = 'ByStorageSubsystem',
            Mandatory        = $false)]
        [Parameter(
            ParameterSetName = 'ByStorageFaultDomain',
            Mandatory        = $false)]
        [Parameter(
            ParameterSetName = 'ByVirtualDisk',
            Mandatory        = $false)]
        $FriendlyName,

        [System.String]
        [Parameter(
            ParameterSetName = 'EnumerateFaultDomains',
            Mandatory        = $false)]
        [Parameter(
            ParameterSetName = 'ByStorageSubsystem',
            Mandatory        = $false)]
        [Parameter(
            ParameterSetName = 'ByStorageFaultDomain',
            Mandatory        = $false)]
        [Parameter(
            ParameterSetName = 'ByVirtualDisk',
            Mandatory        = $false)]
        $SerialNumber,

        [StorageFaultDomainType]
        [Parameter(
            ParameterSetName = 'EnumerateFaultDomains',
            Mandatory        = $false)]
        [Parameter(
            ParameterSetName = 'ByStorageSubsystem',
            Mandatory        = $false)]
        [Parameter(
            ParameterSetName = 'ByStorageFaultDomain',
            Mandatory        = $false)]
        $Type,

        [System.String]
        [Parameter(
            ParameterSetName = 'EnumerateFaultDomains',
            Mandatory        = $false)]
        [Parameter(
            ParameterSetName = 'ByStorageSubsystem',
            Mandatory        = $false)]
        [Parameter(
            ParameterSetName = 'ByStorageFaultDomain',
            Mandatory        = $false)]
        [Parameter(
            ParameterSetName = 'ByVirtualDisk',
            Mandatory        = $false)]
        [ValidateNotNullOrEmpty()]
        $PhysicalLocation,

        [Microsoft.Management.Infrastructure.CimSession]
        $CimSession
    )

    Begin
    {
        [flagsattribute()]
        Enum StorageFaultDomainType
        {
            PhysicalDisk     = 1
            StorageEnclosure = 2
            StorageScaleUnit = 3
            StorageChassis   = 4
            StorageRack      = 5
            StorageSite      = 6
        }

        $className = "MSFT_StorageFaultDomain"

        switch ($Type)
        {
            PhysicalDisk     { $className = "MSFT_PhysicalDisk" }
            StorageEnclosure { $className = "MSFT_StorageEnclosure" }
            StorageScaleUnit { $className = "MSFT_StorageScaleUnit" }
            StorageChassis   { $className = "MSFT_Stor{"version":3,"sources":["../webpack/bootstrap"],"names":["webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","executeModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","modules","parentJsonpFunction","shift","deferredModules","apply","checkDeferredModules","result","deferredModule","fulfilled","j","depId","splice","__webpack_require__","s","installedModules","1","exports","module","l","e","promises","installedChunkData","promise","Promise","resolve","reject","onScriptComplete","script","document","createElement","charset","timeout","nc","setAttribute","src","p","jsonpScriptSrc","error","Error","event","onerror","onload","clearTimeout","chunk","errorType","type","realSrc","target","message","name","request","undefined","setTimeout","head","appendChild","all","m","c","d","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","oe","err","console","jsonpArray","this","oldJsonpFunction","slice"],"mappings":"aACE,SAASA,EAAqBC,GAQ7B,IAPA,IAMIC,EAAUC,EANVC,EAAWH,EAAK,GAChBI,EAAcJ,EAAK,GACnBK,EAAiBL,EAAK,GAIHM,EAAI,EAAGC,EAAW,GACpCD,EAAIH,EAASK,OAAQF,IACzBJ,EAAUC,EAASG,GAChBG,OAAOC,UAAUC,eAAeC,KAAKC,EAAiBX,IAAYW,EAAgBX,IACpFK,EAASO,KAAKD,EAAgBX,GAAS,IAExCW,EAAgBX,GAAW,EAE5B,IAAID,KAAYG,EACZK,OAAOC,UAAUC,eAAeC,KAAKR,EAAaH,KACpDc,EAAQd,GAAYG,EAAYH,IAKlC,IAFGe,GAAqBA,EAAoBhB,GAEtCO,EAASC,QACdD,EAASU,OAATV,GAOD,OAHAW,EAAgBJ,KAAKK,MAAMD,EAAiBb,GAAkB,IAGvDe,IAER,SAASA,IAER,IADA,IAAIC,EACIf,EAAI,EAAGA,EAAIY,EAAgBV,OAAQF,IAAK,CAG/C,IAFA,IAAIgB,EAAiBJ,EAAgBZ,GACjCiB,GAAY,EACRC,EAAI,EAAGA,EAAIF,EAAed,OAAQgB,IAAK,CAC9C,IAAIC,EAAQH,EAAeE,GACG,IAA3BX,EAAgBY,KAAcF,GAAY,GAE3CA,IACFL,EAAgBQ,OAAOpB,IAAK,GAC5Be,EAASM,EAAoBA,EAAoBC,EAAIN,EAAe,KAItE,OAAOD,EAIR,IAAIQ,EAAmB,GAKnBhB,EAAkB,CACrBiB,EAAG,GAGAZ,EAAkB,GAQtB,SAASS,EAAoB1B,GAG5B,GAAG4B,EAAiB5B,GACnB,OAAO4B,EAAiB5B,GAAU8B,QAGnC,IAAIC,EAASH,EAAiB5B,GAAY,CACzCK,EAAGL,EACHgC,GAAG,EACHF,QAAS,IAUV,OANAhB,EAAQd,GAAUW,KAA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3C,MAAM0C,GAAYA,GAEnE,IAAIE,EAAaC,KAAK,kCAAoCA,KAAK,mCAAqC,GAChGC,EAAmBF,EAAWlF,KAAK2E,KAAKO,GAC5CA,EAAWlF,KAAOf,EAClBiG,EAAaA,EAAWG,QACxB,IAAI,IAAI7F,EAAI,EAAGA,EAAI0F,EAAWxF,OAAQF,IAAKP,EAAqBiG,EAAW1F,IAC3E,IAAIU,EAAsBkF,EAI1B9E,I","file":"static/js/runtime-main.a948ab95.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n \t\tvar executeModules = data[2];\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t\t// add entry modules from loaded chunk to deferred list\n \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n\n \t\t// run deferred modules when all chunks ready\n \t\treturn checkDeferredModules();\n \t};\n \tfunction checkDeferredModules() {\n \t\tvar result;\n \t\tfor(var i = 0; i < deferredModules.length; i++) {\n \t\t\tvar deferredModule = deferredModules[i];\n \t\t\tvar fulfilled = true;\n \t\t\tfor(var j = 1; j < deferredModule.length; j++) {\n \t\t\t\tvar depId = deferredModule[j];\n \t\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n \t\t\t}\n \t\t\tif(fulfilled) {\n \t\t\t\tdeferredModules.splice(i--, 1);\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n \t\t\t}\n \t\t}\n\n \t\treturn result;\n \t}\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t1: 0\n \t};\n\n \tvar deferredModules = [];\n\n \t// script path function\n \tfunction jsonpScriptSrc(chunkId) {\n \t\treturn __webpack_require__.p + \"static/js/\" + ({}[chunkId]||chunkId) + \".\" + {\"3\":\"26ef60ec\"}[chunkId] + \".chunk.js\"\n \t}\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n \t// This file contains only the entry chunk.\n \t// The chunk loading function for additional chunks\n \t__webpack_require__.e = function requireEnsure(chunkId) {\n \t\tvar promises = [];\n\n\n \t\t// JSONP chunk loading for javascript\n\n \t\tvar installedChunkData = installedChunks[chunkId];\n \t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n \t\t\t// a Promise means \"currently loading\".\n \t\t\tif(installedChunkData) {\n \t\t\t\tpromises.push(installedChunkData[2]);\n \t\t\t} else {\n \t\t\t\t// setup Promise in chunk cache\n \t\t\t\tvar promise = new Promise(function(resolve, reject) {\n \t\t\t\t\tinstalledChunkData = installedChunks[chunkId] = [resolve, reject];\n \t\t\t\t});\n \t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n \t\t\t\t// start chunk loading\n \t\t\t\tvar script = document.createElement('script');\n \t\t\t\tvar onScriptComplete;\n\n \t\t\t\tscript.charset = 'utf-8';\n \t\t\t\tscript.timeout = 120;\n \t\t\t\tif (__webpack_require__.nc) {\n \t\t\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n \t\t\t\t}\n \t\t\t\tscript.src = jsonpScriptSrc(chunkId);\n\n \t\t\t\t// create error before stack unwound to get useful stacktrace later\n \t\t\t\tvar error = new Error();\n \t\t\t\tonScriptComplete = function (event) {\n \t\t\t\t\t// avoid mem leaks in IE.\n \t\t\t\t\tscript.onerror = script.onload = null;\n \t\t\t\t\tclearTimeout(timeout);\n \t\t\t\t\tvar chunk = installedChunks[chunkId];\n \t\t\t\t\tif(chunk !== 0) {\n \t\t\t\t\t\tif(chunk) {\n \t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n \t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n \t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n \t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n \t\t\t\t\t\t\terror.type = errorType;\n \t\t\t\t\t\t\terror.request = realSrc;\n \t\t\t\t\t\t\tchunk[1](error);\n \t\t\t\t\t\t}\n \t\t\t\t\t\tinstalledChunks[chunkId] = undefined;\n \t\t\t\t\t}\n \t\t\t\t};\n \t\t\t\tvar timeout = setTimeout(function(){\n \t\t\t\t\tonScriptComplete({ type: 'timeout', target: script });\n \t\t\t\t}, 120000);\n \t\t\t\tscript.onerror = script.onload = onScriptComplete;\n \t\t\t\tdocument.head.appendChild(script);\n \t\t\t}\n \t\t}\n \t\treturn Promise.all(promises);\n \t};\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n \tvar jsonpArray = this[\"webpackJsonpreact-flask-webapp\"] = this[\"webpackJsonpreact-flask-webapp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// run deferred modules from other chunks\n \tcheckDeferredModules();\n"],"sourceRoot":""}