Src/Private/Report/Get-AbrVbrLocation.ps1
|
function Get-AbrVbrLocation { <# .SYNOPSIS Used by As Built Report to returns geographical locations created in Veeam Backup & Replication. .DESCRIPTION Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo. .NOTES Version: 1.0.0 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux Credits: Iain Brighton (@iainbrighton) - PScribo module .LINK https://github.com/AsBuiltReport/AsBuiltReport.Veeam.VBR #> [CmdletBinding()] param ( ) begin { Write-PScriboMessage "Discovering Veeam VBR locations information from $System." $LocalizedData = $reportTranslate.GetAbrVbrLocation Show-AbrDebugExecutionTime -Start -TitleMessage 'Geographical Locations' } process { try { if ($Locations = Get-VBRLocation) { Section -Style Heading3 $LocalizedData.Heading { Paragraph $LocalizedData.Paragraph BlankLine try { $OutObj = @() foreach ($Location in $Locations) { try { $inObj = [ordered] @{ $LocalizedData.Name = $Location.Name $LocalizedData.Id = $Location.id } $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) } catch { Write-PScriboMessage -IsWarning "Geographical Locations $($Location.Name) Section: $($_.Exception.Message)" } } $TableParams = @{ Name = "$($LocalizedData.TableHeading) - $VeeamBackupServer" List = $false ColumnWidths = 50, 50 } if ($Report.ShowTableCaptions) { $TableParams['Caption'] = "- $($TableParams.Name)" } $OutObj | Sort-Object -Property Name | Table @TableParams } catch { Write-PScriboMessage -IsWarning "Geographical Locations Section: $($_.Exception.Message)" } } } } catch { Write-PScriboMessage -IsWarning "Geographical Locations Section: $($_.Exception.Message)" } } end { Show-AbrDebugExecutionTime -End -TitleMessage 'Geographical Locations' } } |