Src/Private/Get-AbrOntapVserverNonMappedNamespace.ps1
|
function Get-AbrOntapVserverNonMappedNamespace { <# .SYNOPSIS Used by As Built Report to retrieve NetApp ONTAP NVMW Non Mapped amespace 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 NVME Non Mapped Namespace information.' } process { try { $NamespaceFilter = Get-NcNvmeNamespace -VserverContext $Vserver -Controller $Array | Where-Object { -not $_.Subsystem } $OutObj = @() if ($NamespaceFilter) { foreach ($Item in $NamespaceFilter) { try { $inObj = [ordered] @{ 'Volume Name' = $Item.Volume 'Namespace Name' = ($Item.Path).split('/')[3] 'Type' = $Item.Ostype 'Mapped' = 'No' 'State' = $Item.State } $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 Namespace - $($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 Namespaces to determine if they are still required or can be removed to optimize storage resources.' } BlankLine } } } catch { Write-PScriboMessage -IsWarning $_.Exception.Message } } end {} } |