Last active
July 16, 2016 11:13
-
-
Save adamrushuk/ca8f5d4ab7f29cb7d6b0288beb3480db to your computer and use it in GitHub Desktop.
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
# Author: Adam Rush | |
# Created on: 2016-05-28 | |
# Finds all upgradeable vShield Edges and exports CSV file to Desktop | |
$reportPath = "$HOME\Desktop\upgradable-VSEs.csv" | |
$report = @() | |
Write-Host "Searching for all vShield Edges..." -ForegroundColor Yellow | |
$edges = Get-View -ViewType virtualmachine -Property Name,Config -Filter @{'Config.VAppConfig.Product[0].Name'='vShield Edge'} | % { | |
$edge = '' | Select 'Name','Version' | |
$edge.Name = $_.Name | |
$edge.Version = $_.config.vappconfig.product[0].version | |
$report += $edge | |
} | |
$highestVersion = ($report | Sort version -Descending)[0].version | |
Write-Host "Highest vShield Edge version: $highestVersion" -ForegroundColor Yellow | |
Write-Host "Exporting upgradeable vShield Edges..." -ForegroundColor Yellow | |
$upgradableVSEs = $report | Where {$_.version -lt $highestVersion} | |
Write-Host "Saving file to: $reportPath" -ForegroundColor Yellow | |
$upgradableVSEs | Export-Csv -NoTypeInformation -UseCulture -Path $reportPath |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment