Powershell error positional paramater cannot be found when trying trying to get .net version and update if needed

Jared Unger 0 Reputation points
2023-04-11T16:32:09.88+00:00

I am trying to run a powershell to get the version of .net and update if needed. When ran I get a positional parameter error. User's image

Windows for business | Windows Server | User experience | PowerShell
{count} votes

1 answer

Sort by: Most helpful
  1. Rich Matheisen 47,901 Reputation points
    2023-04-11T21:20:53.7+00:00

    Looking at this: https://learn.microsoft.com/en-us/windows/win32/api/wuapi/nf-wuapi-iupdatesearcher-search, I don't see any "Title" in the "Criterion" section of the table in the Remarks section.

    However, there is a "Title" property in the COMObjects returned from the search if you remove the 'and Title='Microsoft .NET Framework 4.8' string from the criteria string. You can iterate over the results of the search and find what you're looking for.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.