From f0c2faeeafe055fa61c2233db2770f3b74af8733 Mon Sep 17 00:00:00 2001 From: Markus Kraus Date: Wed, 8 Mar 2023 19:56:43 +0100 Subject: [PATCH] remove more pre 11 code --- Veeam/PRTG-VeeamBRStats-v3.ps1 | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/Veeam/PRTG-VeeamBRStats-v3.ps1 b/Veeam/PRTG-VeeamBRStats-v3.ps1 index 32385e5..f2d10e2 100644 --- a/Veeam/PRTG-VeeamBRStats-v3.ps1 +++ b/Veeam/PRTG-VeeamBRStats-v3.ps1 @@ -595,12 +595,7 @@ if ($includeEP) { #endregion: #region: Repository -if ($VbrVersion -ge 11) { - $RepoData = $repoList | Get-vPCRepoInfo -} -else { - $RepoData = $repoList | Get-vPCRepoInfoPre11 -} +$RepoData = $repoList | Get-vPCRepoInfo $RepoReport = @() ForEach ($RawRepo in $RepoData){ If ($RawRepo.FreePercentage -lt $repoCritical) {$Status = "Critical"} @@ -631,12 +626,7 @@ if ($CloudRepos) { $CloudRepo = $CloudRepos | Where-Object {($_.CloudProvider.HostName -eq $CloudProvider.DNSName) -and ($_.Name -eq $CloudProviderRessource.RepositoryName)} $totalSpaceGb = [Math]::Round([Decimal]$CloudProviderRessource.RepositoryAllocatedSpace/1KB,2) #$totalUsedGb = [Math]::Round([Decimal]([Veeam.Backup.Core.CBackupRepository]::GetRepositoryBackupsSize($CloudRepo.Id.Guid))/1GB,2) - if ($VbrVersion -ge 10) { - $totalUsedGb = [Math]::Round([Decimal]([Veeam.Backup.Core.CBackupRepository]::GetRepositoryBackupsSize($CloudRepo.Id.Guid))/1GB,2) - } - else { - $totalUsedGb = [Math]::Round([Decimal]([Veeam.Backup.Core.CBackupRepository]::GetRepositoryStoragesSize($CloudRepo.Id.Guid))/1GB,2) - } + $totalUsedGb = [Math]::Round([Decimal]([Veeam.Backup.Core.CBackupRepository]::GetRepositoryBackupsSize($CloudRepo.Id.Guid))/1GB,2) $totalFreeGb = [Math]::Round($totalSpaceGb - $totalUsedGb,2) $freePercentage = [Math]::Round(($totalFreeGb/$totalSpaceGb)*100) If ($freePercentage -lt $repoCritical) {$Status = "Critical"}