SorenLundt / WinGet-Wrapper

PowerShell Scripts to bulk import WinGet packages to InTune including all package metadata.
GNU General Public License v3.0
95 stars 15 forks source link

Cannot validate argument on parameter 'MinimumSupportedWindowsRelease'. The argument "W10_20H2" does not belong to the set "1607,1703,1709,1803,1809,1903,1909,2004,20H2,21H1" specified by the ValidateSet attribute. #4

Closed flotpg closed 1 year ago

flotpg commented 1 year ago

Hi, I tried to deploy my first package using the supplied example CSV CleanShot 2023-11-06 at 10 05 25@2x

IMPORTED:Failed PackageID:VideoLAN.VLC AppID: TargetVersion: Context:Machine UpdateOnly: True AcceptNewerVersion: True ErrorText: Unknown Error: Cannot validate argument on parameter 'MinimumSupportedWindowsRelease'. The argument "W10_20H2" does not belong to the set "1607,1703,1709,1803,1809,1903,1909,2004,20H2,21H1" specified by the ValidateSet attribute. Supply an argument that is in the set and then try the command again..Exception.Message

Is this caused by https://github.com/SorenLundt/WinGet-Wrapper/blob/f4fb938823506ec3d3eae3db3bda9a86e8dafc59/WinGet-WrapperImportFromCSV.ps1#L601 ?

Thanks a lot for the hard work and best regards, Flo.

flotpg commented 1 year ago

Changing to 20H2 only works. Now I get this at the end. What permissions are needed for the uploading user?

WARNING: Failed to upload chunk to Azure Storage blob. Error message: The remote server returned an error: (403) Forbidden.
WARNING: Failed to finalize Azure Storage blob upload. Error message: The remote server returned an error: (400) Bad Request.
WARNING: Intune service request for operation 'CommitFile' failed
WARNING: Request to https://graph.microsoft.com/Beta/deviceAppManagement/mobileApps/3e0c0b69-3394-47d9-8ebd-4709ea657dfd failed with HTTP Status BadRequest and description: Bad Request
 (Machine)  (WinGet)' to InTuneell by @DimitriPapadopoulos in nextcloud/desktop#5763
WARNING: Request to https://graph.microsoft.com/Beta/deviceAppManagement/mobileApps/3e0c0b69-3394-47d9-8ebd-4709ea657dfd/assignments failed with HTTP Status BadRequest and description: Bad Request
Deployed AppID:3e0c0b69-3394-47d9-8ebd-4709ea657dfd to d3f6aca1-504a-4752-8176-1ada983d83eb
---- RESULTS Package Creation ----
SorenLundt commented 1 year ago

Hi, Just ran a test import and found no issues using: W10_20H2 What OS options do you see in InTune?

Also make sure that these modules are updated:

Install-Module -Name "IntuneWin32App" -Force
Install-Module -Name "Microsoft.Graph.Intune" -Force
#RequirementRule Base
$RequirementRule = New-IntuneWin32AppRequirementRule -Architecture "All" -MinimumSupportedWindowsRelease "W10_20H2"

Deployed AppID:XXXX to XXXXX ---- RESULTS Package Creation ----

IMPORTED:Success PackageID:OBSProject.OBSStudio AppID:XXXX TargetVersion: Context:Machine UpdateOnly: True AcceptNewerVersion: True ErrorText:

DEPLOYED:OBSProject.OBSStudio AppID:XXXX ----> GroupID:XXXX InstallIntent:Required Notification:showAll

Looks like this in InTune image

SorenLundt commented 1 year ago

Changing to 20H2 only works. Now I get this at the end. What permissions are needed for the uploading user?

WARNING: Failed to upload chunk to Azure Storage blob. Error message: The remote server returned an error: (403) Forbidden.
WARNING: Failed to finalize Azure Storage blob upload. Error message: The remote server returned an error: (400) Bad Request.
WARNING: Intune service request for operation 'CommitFile' failed
WARNING: Request to https://graph.microsoft.com/Beta/deviceAppManagement/mobileApps/3e0c0b69-3394-47d9-8ebd-4709ea657dfd failed with HTTP Status BadRequest and description: Bad Request
 (Machine)  (WinGet)' to InTuneell by @DimitriPapadopoulos in nextcloud/desktop#5763
WARNING: Request to https://graph.microsoft.com/Beta/deviceAppManagement/mobileApps/3e0c0b69-3394-47d9-8ebd-4709ea657dfd/assignments failed with HTTP Status BadRequest and description: Bad Request
Deployed AppID:3e0c0b69-3394-47d9-8ebd-4709ea657dfd to d3f6aca1-504a-4752-8176-1ada983d83eb
---- RESULTS Package Creation ----

You need to have the "InTune Administrator" role

flotpg commented 1 year ago

HI, thanks for the fast repsonse. In Intune it looks like this. CleanShot 2023-11-06 at 11 14 49@2x

CleanShot 2023-11-06 at 11 15 59@2x

After running...

Install-Module -Name "IntuneWin32App" -Force
Install-Module -Name "Microsoft.Graph.Intune" -Force

and setting it from "20H2" back to "W10_20H2" doesn't work. Machine is running Windows 11 22H2 with latest updates...

Regarding Intune Administrator role: Do you you know the exact permissions required? We have a dedicated user for app uploads which has a custom Intune role...

SorenLundt commented 1 year ago

Hi, Welcome! I am not sure why it requires 20H2 for you, for me W10_20H2 works perfectly. How would it know that its minimum requirement OS Win10 and not Win11 when the target only includes the version and not OS release?

I tried changing to 20H2 and importing a package and got the following error. image

The argument "20H2" does not belong to the set "W10_1607,W10_1703,W10_1709,W10_1803,W10_1809,W10_1903,W10_1909,W10_2004,W10_20H2,W10_21H1,W10_21H2, W10_22H2,W11_21H2,W11_22H2

Regarding the permissions, I am not entirely sure which exact permissions is required tbh. Intune Administrator works

EDIT: Searching around I found this: This is release notes for RockMyPrinters which seems to use win32LobApp too.

Microsoft recently changed the way Windows Minimum Supported WindowsRelease for Win32 App requirements are set. The tool will now set “W10_20H2” as the minimum supported Windows release instead of “20H2”.

Maybe you are "stuck" on an older InTune release ?

https://learn.microsoft.com/en-us/graph/api/intune-apps-win32lobapp-update?view=graph-rest-1.0&tabs=http

flotpg commented 1 year ago

Strange :)

SorenLundt commented 1 year ago

Strange :)

See my EDIT above