Skip to content

Instantly share code, notes, and snippets.

@bobalob
Created November 2, 2016 20:33
Show Gist options
  • Save bobalob/413234eb963bbc5610f582bfd2d6c482 to your computer and use it in GitHub Desktop.
Save bobalob/413234eb963bbc5610f582bfd2d6c482 to your computer and use it in GitHub Desktop.
Simple Wrapper for EMC VNX Pool Details
Function Get-PoolDetails {
Param(
[Parameter(Mandatory=$true)]$StorageProc
)
$PoolInfo = naviseccli -h $StorageProc storagepool -list
$poolLine1TAG = "Pool Name"
$poolLine2TAG = "Pool ID"
$poolLine3TAG = "LUNs"
$poolLine4TAG = "User Capacity \(GBs\)"
$poolLine5TAG = "Available Capacity \(GBs\)"
$OutTable = @()
foreach ($Line in $PoolInfo) {
#Iterate through each pool returned and create a PS object for it
if ($Line -match $poolLine1TAG) {
#Start of new pool, Create new object
$OutObject = "" | Select PoolName, PoolID, LUNs, CapGB, FreeGB
$OutObject.PoolName = $Line.Split(":",2)[1].Trim()
} elseif ($Line -match $poolLine2TAG) {
$OutObject.PoolID = $Line.Split(":",2)[1].Trim()
} elseif ($Line -match $poolLine3TAG) {
$OutObject.LUNs = $Line.Split(":",2)[1].Trim()
} elseif ($Line -match $poolLine4TAG) {
$OutObject.CapGB = $Line.Split(":",2)[1].Trim()
} elseif ($Line -match $poolLine5TAG) {
$OutObject.FreeGB = $Line.Split(":",2)[1].Trim()
#End of pool info line, add object to table as it's about to be overwritten
$OutTable += $OutObject
}
}
Return $OutTable
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment