Skip to content

Conversation

@andre-sicking
Copy link

When 'curl.exe' is not available, $WebClient cannot be assigned a new object [System.Net.WebClient] as it is already defined as [System.Management.Automation.SwitchParameter] in the param section. So for downloading updates successfully without 'curl.exe' I just renamed the variable to make sure the object can be created.

The If-Statement in Update-MyWindowsImage delivers the wrong registry field when reporting the found version.

$global:GetWSUSXML = Get-WSUSXML -Catalog Windows -Silent | Sort-Object UpdateGroup -Descending

if ($global:GetRegCurrentVersion.ReleaseId -gt 0) {
if ($global:GetRegCurrentVersion.DisplayVersion -gt 0) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DisplayVersion may not always be an int. If you are looking for the minor version (revision) check out GetRegCurrentVersion.UBR.

@Simsi1986
Copy link

Please be aware, that some values for GetRegCurrentVersion should be used with caution for Windows 11.

Just check Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion on a Windows 11 client.
I recommend CurrentBuild(Number) and UBR to recognize the correct OS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants