Src/Private/Get-AbrWinFOClusterResource.ps1
function Get-AbrWinFOClusterResource { <# .SYNOPSIS Used by As Built Report to retrieve Microsoft FailOver Cluster Resource .DESCRIPTION Documents the configuration of Microsoft Windows Server in Word/HTML/Text formats using PScribo. .NOTES Version: 0.5.2 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux Credits: Iain Brighton (@iainbrighton) - PScribo module .LINK https://github.com/AsBuiltReport/AsBuiltReport.Microsoft.Windows #> [CmdletBinding()] param ( ) begin { Write-PScriboMessage "FailOverCluster InfoLevel set at $($InfoLevel.FailOverCluster)." Write-PScriboMessage "Collecting Host FailOver Cluster Resource information." } process { try { $Settings = Invoke-Command -Session $TempPssSession { Get-ClusterResource | Select-Object -Property * } | Sort-Object -Property Name if ($Settings) { Section -Style Heading3 "Resource" { $OutObj = @() foreach ($Setting in $Settings) { try { $inObj = [ordered] @{ 'Name' = $Setting.Name 'Owner Group' = $Setting.OwnerGroup 'Resource Type' = $Setting.ResourceType 'State' = $Setting.State } $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) } catch { Write-PScriboMessage -IsWarning $_.Exception.Message } } if ($HealthCheck.FailOverCluster.Network) { $OutObj | Where-Object { $_.'State' -notlike 'Online' } | Set-Style -Style Warning -Property 'State' } $TableParams = @{ Name = "Resource - $($Cluster)" List = $false ColumnWidths = 25, 25, 35, 15 } if ($Report.ShowTableCaptions) { $TableParams['Caption'] = "- $($TableParams.Name)" } $OutObj | Table @TableParams } } } catch { Write-PScriboMessage -IsWarning $_.Exception.Message } } end {} } |