Src/Private/Get-AbrOntapVserverNonMappedLun.ps1
|
function Get-AbrOntapVserverNonMappedLun { <# .SYNOPSIS Used by As Built Report to retrieve NetApp ONTAP ISCSI/FCP Non Mapped Lun information from the Cluster Management Network .DESCRIPTION .NOTES Version: 0.6.12 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux .EXAMPLE .LINK #> param ( [Parameter ( Position = 0, Mandatory)] [string] $Vserver ) begin { Write-PScriboMessage 'Collecting ONTAP ISCSI/FCP Non Mapped Lun information.' } process { try { $LunFilter = Get-NcLun -VserverContext $Vserver -Controller $Array | Where-Object { $_.Mapped -ne 'True' } $OutObj = @() if ($LunFilter) { foreach ($Item in $LunFilter) { try { $inObj = [ordered] @{ 'Volume Name' = $Item.Volume 'Lun Name' = ($Item.Path).split('/')[3] 'Online' = $Item.Online 'Mapped' = $Item.Mapped 'Lun Format' = $Item.Protocol } $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) } catch { Write-PScriboMessage -IsWarning $_.Exception.Message } } if ($Healthcheck.Vserver.Status) { $OutObj | Set-Style -Style Warning } $TableParams = @{ Name = "HealthCheck - Non-Mapped Lun - $($Vserver)" List = $false ColumnWidths = 30, 30, 10, 10, 20 } if ($Report.ShowTableCaptions) { $TableParams['Caption'] = "- $($TableParams.Name)" } $OutObj | Table @TableParams if ($Healthcheck.Vserver.Status -and ($OutObj)) { Paragraph 'Health Check:' -Bold -Underline BlankLine Paragraph { Text 'Best Practice:' -Bold Text 'Review non-mapped LUNs to determine if they are still required or can be removed to optimize storage resources.' } BlankLine } } } catch { Write-PScriboMessage -IsWarning $_.Exception.Message } } end {} } |