Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor bug fixing #46

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

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.

@@ -91,7 +91,7 @@ function Update-MyWindowsImage {
#=================================================
$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