Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
48 lines (42 sloc) 1.85 KB
Function Get-VMApplicationInfo {
.DESCRIPTION Retrieves discovered applications running inside of a VM
.NOTES Author: William Lam
.NOTES Site:
.NOTES Reference:
VM Object
CSV or JSON output file
Get-VMApplicationInfo -VM (Get-VM "DC-01")
Get-VMApplicationInfo -VM (Get-VM "DC-01") -Output CSV
Get-VMApplicationInfo -VM (Get-VM "DC-01") -Output JSON
$appInfoValue = (Get-AdvancedSetting -Entity $VM -Name "guestinfo.appInfo").Value
if($appInfoValue -eq $null) {
Write-Host "Application Discovery has not been enabled for this VM"
} else {
$appInfo = $appInfoValue | ConvertFrom-Json
$appUpdateVersion = $appInfo.updateCounter
$results = $appInfo.applications | Sort-Object -Property a | FT @{Name="Application";e={$_.a}},@{Name="Version";e={$_.v}}
Write-host -ForegroundColor Green "Application Discovery Time: $($appInfo.publishTime)"
if($Output -eq "CSV") {
$fileOutputName = "$($$($appUpdateVersion)-apps.csv"
Write-Host "`tSaving output to $fileOutputName"
($appInfo.applications) | ConvertTo-Csv | Out-File -FilePath "$fileOutputName"
} elseif ($Output -eq "JSON") {
$fileOutputName = "$($$($appUpdateVersion)-apps.json"
Write-Host "`tSaving output to $fileOutputName"
($appInfo.applications) | ConvertTo-Json | Out-File -FilePath "$fileOutputName"
} else {
You can’t perform that action at this time.