Created
November 27, 2024 03:20
-
-
Save cuongitl/a7805a03c08dda5146285cc2b46e0a31 to your computer and use it in GitHub Desktop.
Veeam: Powershell get Backup Repository Information: Returns a list of backup repositories.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Veeam: Powershell get Backup Repository Information: Returns a list of backup repositories. | |
| # Get-VBRBackupRepository | Format-List * | |
| #Get-VBRBackupRepository | | |
| # Select-Object Name, Id, Type, @{Name="Path";Expression={$_.Path.ToString()}}, Description | | |
| # ConvertTo-Json -Depth 3 | |
| Get-VBRBackupRepository | | |
| Select-Object Name, | |
| Id, | |
| @{Name="Type"; Expression={ | |
| $typeValue = $_.Type | |
| # Check if the Type is an enum and get its string value | |
| if ($typeValue -is [Enum]) { | |
| $typeValue.ToString() | |
| } elseif ($typeValue -is [int]) { | |
| switch ($typeValue) { | |
| 0 { "LocalRepository" } | |
| 1 { "CloudRepository" } | |
| 2 { "NetworkRepository" } | |
| 3 { "BackupRepository" } | |
| default { "Unknown" } | |
| } | |
| } else { | |
| # If it's an unknown type | |
| "Unknown ($typeValue)" | |
| } | |
| }}, | |
| @{Name="Path"; Expression={$_.Path.ToString()}}, | |
| Description | | |
| ConvertTo-Json -Depth 3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment