From 2684b25b1fb720ed00e5ad869094dbb1bb14c825 Mon Sep 17 00:00:00 2001 From: blue Date: Tue, 7 May 2019 21:28:37 +0100 Subject: [PATCH] Choose desired client version based on ccmsetup Enable using the ccmsetup.exe that would be used to install the client as the desired client version for upgrading, rather than manually specifying by setting the desired client version to 'auto'. --- ConfigMgrClientHealth.ps1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ConfigMgrClientHealth.ps1 b/ConfigMgrClientHealth.ps1 index dc0bafd..d54a9b6 100644 --- a/ConfigMgrClientHealth.ps1 +++ b/ConfigMgrClientHealth.ps1 @@ -1615,7 +1615,7 @@ Begin { Start-Sleep -Seconds 360 } - + } else { @@ -2523,6 +2523,10 @@ Begin { Function Get-XMLConfigClientVersion { if ($config) { $obj = $Xml.Configuration.Client | Where-Object {$_.Name -like 'Version'} | Select-Object -ExpandProperty '#text' + if ($obj.ToLower() -eq 'auto') { + $ClientShare = Get-XMLConfigClientShare + $obj = (Get-Item (Join-Path $ClientShare 'ccmsetup.exe')).VersionInfo.ProductVersion + } } Write-Output $obj