Public/Get-HPCacheDiskInformation.ps1

Function Get-HPCacheDiskInformation {
    <#
        .SYNOPSIS
            Reports HP Cache's behavior for all disks
        .DESCRIPTION
            Reports HP Cache's behavior for all disks
        .OUTPUTS
            HPWriteManager.DiskCache.Information
        .LINK
            about_functions_advanced
        .LINK
            about_CommonParameters
        .LINK
            http://h10032.www1.hp.com/ctg/Manual/c06173592
    #>

    [CmdletBinding()]
    [OutputType('HPWriteManager.DiskCache.Information')]
    Param()

    Begin {
    }
    Process {
        If ($null -ne $HPDCI) {
            foreach ($Item in $HPDCI) {
                $HPCacheDiskInfo = [PSCustomObject]@{
                    DiskID                 = $Item.DiskId
                    DiskNumber             = $Item.DiskNumber
                    CachingEnabled         = $Item.CachingEnabled
                    AllocationPolicy       = $Item.AllocationPolicy
                    MaximumCacheSize       = $Item.MaximumCacheSize
                    CurrentCacheUsage      = $Item.CurrentCacheUsage
                    CurrentCacheAllocation = $Item.CurrentCacheAllocation
                    FlushTimeInterval      = $Item.FlushTimeInterval
                    FlushCount             = $Item.FlushCount
                }
                $HPCacheDiskInfo.PSObject.TypeNames.Insert(0, 'HPWriteManager.DiskCache.Information')
            }
        }
    }
    End {
        If ($HPCacheDiskInfo) {
            Return $HPCacheDiskInfo
        }
    }
}