VMware Cloud Community
Zsoldier
Expert
Expert

Update Manager Snapin and Checks

Does anyone know if it's possible to check for update manager version w/o the update manager powercli snapin?  Also, are their plans to keep powercli snapins for update manager backward compatible?

I'm trying to design a check in a configuration script that I'm building to make sure the user running it has the proper tools on their system to continue.  Update Manager is not making it easy.  I'm running under the assumption that Update Manager needs to be the same version as the vCenter server it services.  Here is what I have so far:

$Snapins

= Get-PSSnapin -Name vmware.vumautomation -ErrorAction:SilentlyContinue -ErrorVariable +ErrorLog

[

decimal]$SnapinVersion = "$($Snapins.version.Major).$($Snapins.version.minor)"

If

($VIServer.Version -ne $SnapinVersion){

Write-Host

"This script requires PowerCLI for update manager related to vcenter version $VIServer.Version" -ForegroundColor Red

Write-Host

"PowerCLI for Update Manager Version $($Snapins.version.Major).$($Snapins.version.Minor).$($Snapins.version.Build).$($Snapins.version.revision) was detected."

Write-Host

"Please search google and download version that matches vCenter version $VIServer.Version"

Write-Host

"Press any key to exit script ..."

$ErrorLog

| Out-File $LogPath

$x

= $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")

Exit

}

If

($Snapins -eq $null){Add-PSSnapin vmware.vumautomation}

Chris Nakagaki (中垣浩一)
Blog: https://tech.zsoldier.com
Twitter: @zsoldier
Tags (2)
Reply
0 Kudos
3 Replies
LucD
Leadership
Leadership

Provided you are running this on a platform that supports the Win32_Product class, you could do

Get-WmiObject -Class "Win32_Product"

and check the Name and Version properties.

Or you could check the registry branch HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall, find the "vCenter Update Manager PowerCLI" entry and look in the DisplayVersion key.

On backward compatibility and PowerCLI version dependencies, a VMW source should be able to make a statement.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
Zsoldier
Expert
Expert

     Sorry Luc, I don't think I've stated my issue correctly.  I'm able to find out the local vCenter Update Manager PowerCLI version.  What I'm trying to figure out is the version of Update Manager the target vCenter version uses, w/o the VUM cmdlets.  What you have stated would work for next step if I knew the target Update Manager server name, assuming it's installed on another system that is not vCenter.

I am playing a little more w/ the VUM cmdlets and they do return errors on their compatiblity status, so I think I might go down that route to determine whether the local system that script is being run from is correct.

Chris Nakagaki (中垣浩一)
Blog: https://tech.zsoldier.com
Twitter: @zsoldier
Reply
0 Kudos
LucD
Leadership
Leadership

Ok, now I get it.

I think your assumption is correct. The Release Notes state that Update Manager 5.0 (the snapin) only works with Update Manager 5.0 (the service).


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos