From b9fa7540c02e38bea23182ca6b8a4d0cad3af447 Mon Sep 17 00:00:00 2001 From: JacobMizraji Date: Mon, 20 Oct 2025 15:40:04 -0400 Subject: [PATCH 1/5] Changes to make CreateAndUploadWinGetApp work --- IntuneWin32App.psd1 | 2 + Public/Convert-ImageToBase64.ps1 | 30 +++++++ Public/Extract-Icon.ps1 | 74 ++++++++++++++++ Public/Set-IntuneWin32App.ps1 | 144 ++++++++++++++++++++++++++++--- 4 files changed, 240 insertions(+), 10 deletions(-) create mode 100644 Public/Convert-ImageToBase64.ps1 create mode 100644 Public/Extract-Icon.ps1 diff --git a/IntuneWin32App.psd1 b/IntuneWin32App.psd1 index 7f4ef7e..1a386cb 100644 --- a/IntuneWin32App.psd1 +++ b/IntuneWin32App.psd1 @@ -75,7 +75,9 @@ FunctionsToExport = @("Add-IntuneWin32App", "Add-IntuneWin32AppDependency", "Add-IntuneWin32AppSupersedence" "Connect-MSIntuneGraph", + "Convert-ImageToBase64", "Expand-IntuneWin32AppPackage", + "Get-Icon", "Get-IntuneWin32App", "Get-IntuneWin32AppAssignment", "Get-IntuneWin32AppCategory", diff --git a/Public/Convert-ImageToBase64.ps1 b/Public/Convert-ImageToBase64.ps1 new file mode 100644 index 0000000..da71a8d --- /dev/null +++ b/Public/Convert-ImageToBase64.ps1 @@ -0,0 +1,30 @@ +function Convert-ImageToBase64 { + param ( + [Parameter(Mandatory=$true)] + [string]$ImagePath + ) + + # Check if the file exists + if (-Not (Test-Path $ImagePath)) { + Write-Error "File not found: $ImagePath" + return + } + + # Get the file extension + $extension = [System.IO.Path]::GetExtension($ImagePath).ToLower() + + # Check if the file extension is valid + if ($extension -notin '.png', '.jpg', '.jpeg') { + Write-Error "Invalid file type: $extension. Only PNG, JPG, and JPEG are supported." + return + } + + # Read the image file as a byte array + $imageBytes = [System.IO.File]::ReadAllBytes($ImagePath) + + # Convert the byte array to a Base64 string + $base64String = [System.Convert]::ToBase64String($imageBytes) + + # Output the Base64 string + return $base64String +} \ No newline at end of file diff --git a/Public/Extract-Icon.ps1 b/Public/Extract-Icon.ps1 new file mode 100644 index 0000000..7024a1c --- /dev/null +++ b/Public/Extract-Icon.ps1 @@ -0,0 +1,74 @@ +# requires -version 5.1 + +# copied from https://jdhitsolutions.com/blog/powershell/7931/extracting-icons-with-powershell/ +function Extract-Icon { + [CmdletBinding(SupportsShouldProcess)] + Param( + [Parameter(Position = 0, Mandatory, HelpMessage = "Specify the path to the file.")] + [ValidateScript({ Test-Path $_ })] + [string]$Path, + + [Parameter(HelpMessage = "Specify the folder to save the file.")] + [ValidateScript({ Test-Path $_ })] + [string]$Destination = ".", + + [parameter(HelpMessage = "Specify an alternate base name for the new image file. Otherwise, the source name will be used.")] + [ValidateNotNullOrEmpty()] + [string]$Name, + + [Parameter(HelpMessage = "What format do you want to use? The default is png.")] + [ValidateSet("ico", "bmp", "png", "jpg", "gif")] + [string]$Format = "png" + ) + + Write-Verbose "Starting $($MyInvocation.MyCommand)" + + Try { + Add-Type -AssemblyName System.Drawing -ErrorAction Stop + } + Catch { + Write-Warning "Failed to import System.Drawing" + Throw $_ + } + + Switch ($format) { + "ico" { $ImageFormat = "icon" } + "bmp" { $ImageFormat = "Bmp" } + "png" { $ImageFormat = "Png" } + "jpg" { $ImageFormat = "Jpeg" } + "gif" { $ImageFormat = "Gif" } + } + + $file = Get-Item $path + Write-Verbose "Processing $($file.fullname)" + #convert destination to file system path + $Destination = Convert-Path -path $Destination + + if ($Name) { + $base = $Name + } + else { + $base = $file.BaseName + } + + #construct the image file name + $out = Join-Path -Path $Destination -ChildPath "$base.$format" + + Write-Verbose "Extracting $ImageFormat image to $out" + $ico = [System.Drawing.Icon]::ExtractAssociatedIcon($file.FullName) + + if ($ico) { + #WhatIf (target, action) + if ($PSCmdlet.ShouldProcess($out, "Extract icon")) { + $ico.ToBitmap().Save($Out, $Imageformat) + $imageFile = Get-Item -path $out + } + } + else { + #this should probably never get called + Write-Warning "No associated icon image found in $($file.fullname)" + } + + Write-Verbose "Ending $($MyInvocation.MyCommand)" + return $imageFile +} \ No newline at end of file diff --git a/Public/Set-IntuneWin32App.ps1 b/Public/Set-IntuneWin32App.ps1 index 8a78f1b..dfbc32b 100644 --- a/Public/Set-IntuneWin32App.ps1 +++ b/Public/Set-IntuneWin32App.ps1 @@ -39,6 +39,9 @@ function Set-IntuneWin32App { .PARAMETER CompanyPortalFeaturedApp Specify whether to have the Win32 application featured in Company Portal or not. + .PARAMETER DetectionRule + Provide an array of a single or multiple OrderedDictionary objects as detection rules to override the current detection rules for the Win32 application. + .NOTES Author: Nickolaj Andersen Contact: @NickolajA @@ -49,6 +52,7 @@ function Set-IntuneWin32App { 1.0.0 - (2023-01-25) Function created 1.0.1 - (2023-03-17) Added AllowAvailableUninstall parameter switch. 1.0.2 - (2023-09-04) Updated with Test-AccessToken function + 1.0.3 - (2025-10-20) Added additional parameters and improved error handling #> [CmdletBinding(SupportsShouldProcess = $true)] param( @@ -72,6 +76,22 @@ function Set-IntuneWin32App { [ValidateNotNullOrEmpty()] [string]$AppVersion, + [parameter(Mandatory = $false, HelpMessage = "Specify the name of either a single or an array of category names for the Win32 application.")] + [ValidateNotNullOrEmpty()] + [string[]]$CategoryName, + + [parameter(Mandatory = $false, HelpMessage = "Specify whether to have the Win32 application featured in Company Portal or not.")] + [bool]$CompanyPortalFeaturedApp, + + [parameter(Mandatory = $false, HelpMessage = "Specify a new information URL for the Win32 application.")] + [ValidatePattern("(http[s]?|[s]?ftp[s]?)(:\/\/)([^\s,]+)")] + [string]$InformationURL, + + [parameter(Mandatory = $false, HelpMessage = "Specify a new privacy URL for the Win32 application.")] + [ValidatePattern("(http[s]?|[s]?ftp[s]?)(:\/\/)([^\s,]+)")] + [string]$PrivacyURL, + + [parameter(Mandatory = $false, HelpMessage = "Specify a new developer name for the Win32 application.")] [ValidateNotNullOrEmpty()] [string]$Developer, @@ -84,19 +104,46 @@ function Set-IntuneWin32App { [ValidateNotNullOrEmpty()] [string]$Notes, - [parameter(Mandatory = $false, HelpMessage = "Specify a new information URL for the Win32 application.")] - [ValidatePattern("(http[s]?|[s]?ftp[s]?)(:\/\/)([^\s,]+)")] - [string]$InformationURL, + [parameter(Mandatory = $false, HelpMessage = "Provide a Base64 encoded string of the PNG/JPG/JPEG file.")] + [ValidateNotNullOrEmpty()] + [string]$Icon, - [parameter(Mandatory = $false, HelpMessage = "Specify a new privacy URL for the Win32 application.")] - [ValidatePattern("(http[s]?|[s]?ftp[s]?)(:\/\/)([^\s,]+)")] - [string]$PrivacyURL, + [parameter(Mandatory = $false, HelpMessage = "Specify the install command line for the Win32 application.")] + [ValidateNotNullOrEmpty()] + [string]$InstallCommandLine, - [parameter(Mandatory = $false, HelpMessage = "Specify whether to have the Win32 application featured in Company Portal or not.")] - [bool]$CompanyPortalFeaturedApp, + [parameter(Mandatory = $false, HelpMessage = "Specify the uninstall command line for the Win32 application.")] + [ValidateNotNullOrEmpty()] + [string]$UninstallCommandLine, + + [parameter(Mandatory = $false, HelpMessage = "Specify the maximum installation time in minutes for the Win32 application (default is 60 minutes).")] + [ValidateNotNullOrEmpty()] + [ValidateRange(1, 1440)] + [int]$MaximumInstallationTimeInMinutes = 60, [parameter(Mandatory = $false, HelpMessage = "Specify whether to allow the Win32 application to be uninstalled from the Company Portal app when assigned as available.")] - [bool]$AllowAvailableUninstall + [bool]$AllowAvailableUninstall, + + [parameter(Mandatory = $false, HelpMessage = "Specify the restart behavior for the Win32 application. Supported values are: allow, basedOnReturnCode, suppress or force.")] + [ValidateNotNullOrEmpty()] + [ValidateSet("allow", "basedOnReturnCode", "suppress", "force")] + [string]$RestartBehavior, + + [parameter(Mandatory = $false, HelpMessage = "Provide an array of a single or multiple hash-tables for the Win32 application with return code information.")] + [ValidateNotNullOrEmpty()] + [System.Collections.Hashtable[]]$ReturnCode, + + [parameter(Mandatory = $false, HelpMessage = "Provide an OrderedDictionary object as requirement rule that will be used for the Win32 application.")] + [ValidateNotNullOrEmpty()] + [System.Collections.Specialized.OrderedDictionary]$RequirementRule, + + [parameter(Mandatory = $false, HelpMessage = "Provide an array of OrderedDictionary objects as additional requirement rule, e.g. for file, registry or script rules, that will be used for the Win32 application.")] + [ValidateNotNullOrEmpty()] + [System.Collections.Specialized.OrderedDictionary[]]$AdditionalRequirementRule, + + [parameter(Mandatory = $false, HelpMessage = "Provide an array of a single or multiple OrderedDictionary objects as detection rules to override the current detection rules for the Win32 application.")] + [ValidateNotNullOrEmpty()] + [System.Collections.Specialized.OrderedDictionary[]]$DetectionRule ) Begin { # Ensure required authentication header variable exists @@ -150,14 +197,91 @@ function Set-IntuneWin32App { $Win32AppBody.Add("informationUrl", $InformationURL) } if ($PSBoundParameters["PrivacyURL"]) { - $Win32AppBody.Add("privacyInformationUrl", $PrivacyURL) + $Win32AppBody.Add("privacyUrl", $PrivacyURL) } if ($PSBoundParameters["CompanyPortalFeaturedApp"]) { $Win32AppBody.Add("isFeatured", $CompanyPortalFeaturedApp) } + if ($PSBoundParameters["CategoryName"]) { + $CategoryList = New-Object -TypeName "System.Collections.ArrayList" + foreach ($CategoryNameItem in $CategoryName) { + # Ensure category exist by given name from parameter input + Write-Verbose -Message "Querying for specified Category: $($CategoryNameItem)" + $Category = (Invoke-IntuneGraphRequest -APIVersion "Beta" -Resource "mobileAppCategories?`$filter=displayName eq '$([System.Web.HttpUtility]::UrlEncode($CategoryNameItem))'" -Method "GET" -ErrorAction "Stop").value + if ($Category -ne $null) { + $PSObject = [PSCustomObject]@{ + id = $Category.id + displayName = $Category.displayName + } + $CategoryList.Add($PSObject) | Out-Null + } + else { + Write-Warning -Message "Could not find category with name '$($CategoryNameItem)' or provided name resulted in multiple matches which is not supported" + } + } + + if ($CategoryList.Count -ge 1) { + $Win32AppBody.Add("CategoryList", $CategoryList) + } + } + if ($PSBoundParameters["InstallCommandLine"]) { + $Win32AppBody.Add("installCommandLine", $InstallCommandLine) + } + if ($PSBoundParameters["UninstallCommandLine"]) { + $Win32AppBody.Add("uninstallCommandLine", $UninstallCommandLine) + } + if ($PSBoundParameters["RestartBehavior"]) { + $Win32AppBody.Add("restartBehavior", $RestartBehavior) + } + if ($PSBoundParameters["MaximumInstallationTimeInMinutes"]) { + $Win32AppBody.Add("maximumRunTimeInMinutes", $MaximumInstallationTimeInMinutes) + } + if ($PSBoundParameters["RequirementRule"]) { + $Win32AppBody.Add("requirementRule", @($RequirementRule)) + } + if ($PSBoundParameters["AdditionalRequirementRule"]) { + if ($Win32AppBody.ContainsKey("requirementRules")) { + $Win32AppBody["requirementRules"] += $AdditionalRequirementRule + } + else { + $Win32AppBody.Add("requirementRules", $AdditionalRequirementRule) + } + } + if ($PSBoundParameters["ReturnCode"]) { + # Retrieve the default return codes for a Win32 app + Write-Verbose -Message "Retrieving default set of return codes for Win32 app body construction" + $DefaultReturnCodes = Get-IntuneWin32AppDefaultReturnCode + + # Add custom return codes from parameter input to default set of objects + Write-Verbose -Message "Additional return codes where passed as command line input, adding to array of default return codes" + foreach ($ReturnCodeItem in $ReturnCode) { + $DefaultReturnCodes += $ReturnCodeItem + } + + # Add return codes to Win32 app body object + Write-Verbose -Message "Adding array of return codes to Win32 app body construction" + $Win32AppBody.Add("returnCodes", $DefaultReturnCodes) + } + if ($PSBoundParameters["Icon"]) { + $Win32AppBody.Add("largeIcon", @{ + "@odata.type" = "#microsoft.graph.mimeContent" + "type" = "image/png" + "value" = $Icon + }) + } if ($PSBoundParameters["AllowAvailableUninstall"]) { $Win32AppBody.Add("allowAvailableUninstall", $AllowAvailableUninstall) } + if ($PSBoundParameters["DetectionRule"]) { + # Validate that correct detection rules have been passed on command line, only 1 PowerShell script based detection rule is allowed + if (($DetectionRule.'@odata.type' -contains "#microsoft.graph.win32LobAppPowerShellScriptDetection") -and (@($DetectionRule).'@odata.type'.Count -gt 1)) { + Write-Warning -Message "Multiple PowerShell Script detection rules were detected, this is not a supported configuration"; break + } + + # Add detection rules to Win32 app body object + Write-Verbose -Message "Detection rule objects passed validation checks, attempting to add to existing Win32 app body" + $Win32AppBody.Add("detectionRules", $DetectionRule) + } try { # Attempt to call Graph and update Win32 app From fce9c12e75041c4bf5ad32cb468b773a9c13e4d0 Mon Sep 17 00:00:00 2001 From: JacobMizraji Date: Thu, 23 Oct 2025 16:54:34 -0400 Subject: [PATCH 2/5] Added intro comments --- Public/Set-IntuneWin32App.ps1 | 52 ++++++++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 4 deletions(-) diff --git a/Public/Set-IntuneWin32App.ps1 b/Public/Set-IntuneWin32App.ps1 index dfbc32b..5a1df00 100644 --- a/Public/Set-IntuneWin32App.ps1 +++ b/Public/Set-IntuneWin32App.ps1 @@ -39,8 +39,53 @@ function Set-IntuneWin32App { .PARAMETER CompanyPortalFeaturedApp Specify whether to have the Win32 application featured in Company Portal or not. + .PARAMETER CategoryName + Specify the name of either a single or an array of category names for the Win32 application. + + .PARAMETER InstallCommandLine + Specify the install command line for the Win32 application. + + .PARAMETER UninstallCommandLine + Specify the uninstall command line for the Win32 application. + + .PARAMETER RestartBehavior + Specify the restart behavior for the Win32 application. Supported values are: allow, basedOnReturnCode, suppress or force. + + .PARAMETER MaximumInstallationTimeInMinutes + Specify the maximum installation time in minutes for the Win32 application (default is 60 minutes). + + .PARAMETER AllowAvailableUninstall + Specify whether to allow the Win32 application to be uninstalled from the Company Portal app when assigned as available. + .PARAMETER DetectionRule - Provide an array of a single or multiple OrderedDictionary objects as detection rules to override the current detection rules for the Win32 application. + Provide an array of a single or multiple OrderedDictionary objects as detection rules that will be used for the Win32 application. + + .PARAMETER RequirementRule + Provide an OrderedDictionary object as requirement rule that will be used for the Win32 application. + + .PARAMETER AdditionalRequirementRule + Provide an array of OrderedDictionary objects as additional requirement rule, e.g. for file, registry or script rules, that will be used for the Win32 application. + + .PARAMETER ReturnCode + Provide an array of a single or multiple hash-tables for the Win32 application with return code information. + + .PARAMETER Icon + Provide a Base64 encoded string of the PNG/JPG/JPEG file. + + .PARAMETER ScopeTagName + Specify the name of either a single or an array of Scope Tag names to be set instead of the Default tag. + + .PARAMETER UseAzCopy + Specify the UseAzCopy parameter switch when adding an application with source files larger than 500MB. + + .PARAMETER AzCopyWindowStyle + Specify whether the AzCopy content transfer progress should use -WindowStyle Hidden or -NoNewWindow parameters for Start-Process. NoNewWindow will show transfer output, Hidden will not show progress but will support multi-threaded jobs. + + .PARAMETER UnattendedInstall + Specify to enforce the MSI installer to run silently, with /quiet added to the install command line of the Win32 application. + + .PARAMETER UnattendedUninstall + Specify to enforce the MSI installer to run silently, with /quiet added to the uninstall command line of the Win32 application. .NOTES Author: Nickolaj Andersen @@ -76,11 +121,11 @@ function Set-IntuneWin32App { [ValidateNotNullOrEmpty()] [string]$AppVersion, - [parameter(Mandatory = $false, HelpMessage = "Specify the name of either a single or an array of category names for the Win32 application.")] + [parameter(Mandatory = $false, HelpMessage = "Specify the name of either a single or an array of category names for the Win32 application.")] [ValidateNotNullOrEmpty()] [string[]]$CategoryName, - [parameter(Mandatory = $false, HelpMessage = "Specify whether to have the Win32 application featured in Company Portal or not.")] + [parameter(Mandatory = $false, HelpMessage = "Specify whether to have the Win32 application featured in Company Portal or not.")] [bool]$CompanyPortalFeaturedApp, [parameter(Mandatory = $false, HelpMessage = "Specify a new information URL for the Win32 application.")] @@ -91,7 +136,6 @@ function Set-IntuneWin32App { [ValidatePattern("(http[s]?|[s]?ftp[s]?)(:\/\/)([^\s,]+)")] [string]$PrivacyURL, - [parameter(Mandatory = $false, HelpMessage = "Specify a new developer name for the Win32 application.")] [ValidateNotNullOrEmpty()] [string]$Developer, From 7a44fbe44441f9baee7c27e4209944d4f25cff59 Mon Sep 17 00:00:00 2001 From: JacobMizraji Date: Thu, 23 Oct 2025 17:02:53 -0400 Subject: [PATCH 3/5] Rolling back Icon changes to put them somewhere else --- IntuneWin32App.psd1 | 2 - Public/Convert-ImageToBase64.ps1 | 30 ------------- Public/Extract-Icon.ps1 | 74 -------------------------------- 3 files changed, 106 deletions(-) delete mode 100644 Public/Convert-ImageToBase64.ps1 delete mode 100644 Public/Extract-Icon.ps1 diff --git a/IntuneWin32App.psd1 b/IntuneWin32App.psd1 index 1a386cb..7f4ef7e 100644 --- a/IntuneWin32App.psd1 +++ b/IntuneWin32App.psd1 @@ -75,9 +75,7 @@ FunctionsToExport = @("Add-IntuneWin32App", "Add-IntuneWin32AppDependency", "Add-IntuneWin32AppSupersedence" "Connect-MSIntuneGraph", - "Convert-ImageToBase64", "Expand-IntuneWin32AppPackage", - "Get-Icon", "Get-IntuneWin32App", "Get-IntuneWin32AppAssignment", "Get-IntuneWin32AppCategory", diff --git a/Public/Convert-ImageToBase64.ps1 b/Public/Convert-ImageToBase64.ps1 deleted file mode 100644 index da71a8d..0000000 --- a/Public/Convert-ImageToBase64.ps1 +++ /dev/null @@ -1,30 +0,0 @@ -function Convert-ImageToBase64 { - param ( - [Parameter(Mandatory=$true)] - [string]$ImagePath - ) - - # Check if the file exists - if (-Not (Test-Path $ImagePath)) { - Write-Error "File not found: $ImagePath" - return - } - - # Get the file extension - $extension = [System.IO.Path]::GetExtension($ImagePath).ToLower() - - # Check if the file extension is valid - if ($extension -notin '.png', '.jpg', '.jpeg') { - Write-Error "Invalid file type: $extension. Only PNG, JPG, and JPEG are supported." - return - } - - # Read the image file as a byte array - $imageBytes = [System.IO.File]::ReadAllBytes($ImagePath) - - # Convert the byte array to a Base64 string - $base64String = [System.Convert]::ToBase64String($imageBytes) - - # Output the Base64 string - return $base64String -} \ No newline at end of file diff --git a/Public/Extract-Icon.ps1 b/Public/Extract-Icon.ps1 deleted file mode 100644 index 7024a1c..0000000 --- a/Public/Extract-Icon.ps1 +++ /dev/null @@ -1,74 +0,0 @@ -# requires -version 5.1 - -# copied from https://jdhitsolutions.com/blog/powershell/7931/extracting-icons-with-powershell/ -function Extract-Icon { - [CmdletBinding(SupportsShouldProcess)] - Param( - [Parameter(Position = 0, Mandatory, HelpMessage = "Specify the path to the file.")] - [ValidateScript({ Test-Path $_ })] - [string]$Path, - - [Parameter(HelpMessage = "Specify the folder to save the file.")] - [ValidateScript({ Test-Path $_ })] - [string]$Destination = ".", - - [parameter(HelpMessage = "Specify an alternate base name for the new image file. Otherwise, the source name will be used.")] - [ValidateNotNullOrEmpty()] - [string]$Name, - - [Parameter(HelpMessage = "What format do you want to use? The default is png.")] - [ValidateSet("ico", "bmp", "png", "jpg", "gif")] - [string]$Format = "png" - ) - - Write-Verbose "Starting $($MyInvocation.MyCommand)" - - Try { - Add-Type -AssemblyName System.Drawing -ErrorAction Stop - } - Catch { - Write-Warning "Failed to import System.Drawing" - Throw $_ - } - - Switch ($format) { - "ico" { $ImageFormat = "icon" } - "bmp" { $ImageFormat = "Bmp" } - "png" { $ImageFormat = "Png" } - "jpg" { $ImageFormat = "Jpeg" } - "gif" { $ImageFormat = "Gif" } - } - - $file = Get-Item $path - Write-Verbose "Processing $($file.fullname)" - #convert destination to file system path - $Destination = Convert-Path -path $Destination - - if ($Name) { - $base = $Name - } - else { - $base = $file.BaseName - } - - #construct the image file name - $out = Join-Path -Path $Destination -ChildPath "$base.$format" - - Write-Verbose "Extracting $ImageFormat image to $out" - $ico = [System.Drawing.Icon]::ExtractAssociatedIcon($file.FullName) - - if ($ico) { - #WhatIf (target, action) - if ($PSCmdlet.ShouldProcess($out, "Extract icon")) { - $ico.ToBitmap().Save($Out, $Imageformat) - $imageFile = Get-Item -path $out - } - } - else { - #this should probably never get called - Write-Warning "No associated icon image found in $($file.fullname)" - } - - Write-Verbose "Ending $($MyInvocation.MyCommand)" - return $imageFile -} \ No newline at end of file From fd34f7b87777006db7d0390f02bd6ad53480f71f Mon Sep 17 00:00:00 2001 From: JacobMizraji Date: Thu, 23 Oct 2025 17:09:49 -0400 Subject: [PATCH 4/5] change PrivacyURL to privacyInformationURL --- Public/Set-IntuneWin32App.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Public/Set-IntuneWin32App.ps1 b/Public/Set-IntuneWin32App.ps1 index 5a1df00..d019cd6 100644 --- a/Public/Set-IntuneWin32App.ps1 +++ b/Public/Set-IntuneWin32App.ps1 @@ -241,7 +241,7 @@ function Set-IntuneWin32App { $Win32AppBody.Add("informationUrl", $InformationURL) } if ($PSBoundParameters["PrivacyURL"]) { - $Win32AppBody.Add("privacyUrl", $PrivacyURL) + $Win32AppBody.Add("privacyInformationUrl", $PrivacyURL) } if ($PSBoundParameters["CompanyPortalFeaturedApp"]) { $Win32AppBody.Add("isFeatured", $CompanyPortalFeaturedApp) From 8a46eef5ff9dfe01d2247d407abdb84146509d46 Mon Sep 17 00:00:00 2001 From: JacobMizraji Date: Thu, 23 Oct 2025 17:25:34 -0400 Subject: [PATCH 5/5] Ordering of parameters in description --- Public/Set-IntuneWin32App.ps1 | 63 +++++++++++++---------------------- 1 file changed, 24 insertions(+), 39 deletions(-) diff --git a/Public/Set-IntuneWin32App.ps1 b/Public/Set-IntuneWin32App.ps1 index d019cd6..5c63e1a 100644 --- a/Public/Set-IntuneWin32App.ps1 +++ b/Public/Set-IntuneWin32App.ps1 @@ -21,14 +21,11 @@ function Set-IntuneWin32App { .PARAMETER AppVersion Specify a new app version for the Win32 application. - .PARAMETER Developer - Specify a new developer name for the Win32 application. - - .PARAMETER Owner - Specify a new owner property for the Win32 application. + .PARAMETER CategoryName + Specify the name of either a single or an array of category names for the Win32 application. - .PARAMETER Notes - Specify a new notes property for the Win32 application. + .PARAMETER CompanyPortalFeaturedApp + Specify whether to have the Win32 application featured in Company Portal or not. .PARAMETER InformationURL Specify a new information URL for the Win32 application. @@ -36,56 +33,44 @@ function Set-IntuneWin32App { .PARAMETER PrivacyURL Specify a new privacy URL for the Win32 application. - .PARAMETER CompanyPortalFeaturedApp - Specify whether to have the Win32 application featured in Company Portal or not. + .PARAMETER Developer + Specify a new developer name for the Win32 application. - .PARAMETER CategoryName - Specify the name of either a single or an array of category names for the Win32 application. + .PARAMETER Owner + Specify a new owner property for the Win32 application. + + .PARAMETER Notes + Specify a new notes property for the Win32 application. + + .PARAMETER Icon + Provide a Base64 encoded string of the PNG/JPG/JPEG file. .PARAMETER InstallCommandLine Specify the install command line for the Win32 application. .PARAMETER UninstallCommandLine Specify the uninstall command line for the Win32 application. - - .PARAMETER RestartBehavior - Specify the restart behavior for the Win32 application. Supported values are: allow, basedOnReturnCode, suppress or force. .PARAMETER MaximumInstallationTimeInMinutes Specify the maximum installation time in minutes for the Win32 application (default is 60 minutes). .PARAMETER AllowAvailableUninstall - Specify whether to allow the Win32 application to be uninstalled from the Company Portal app when assigned as available. - - .PARAMETER DetectionRule - Provide an array of a single or multiple OrderedDictionary objects as detection rules that will be used for the Win32 application. + Specify whether to allow the Win32 application to be uninstalled from the Company Portal app when assigned as available. - .PARAMETER RequirementRule - Provide an OrderedDictionary object as requirement rule that will be used for the Win32 application. - - .PARAMETER AdditionalRequirementRule - Provide an array of OrderedDictionary objects as additional requirement rule, e.g. for file, registry or script rules, that will be used for the Win32 application. + .PARAMETER RestartBehavior + Specify the restart behavior for the Win32 application. Supported values are: allow, basedOnReturnCode, suppress or force. .PARAMETER ReturnCode Provide an array of a single or multiple hash-tables for the Win32 application with return code information. - .PARAMETER Icon - Provide a Base64 encoded string of the PNG/JPG/JPEG file. - - .PARAMETER ScopeTagName - Specify the name of either a single or an array of Scope Tag names to be set instead of the Default tag. - - .PARAMETER UseAzCopy - Specify the UseAzCopy parameter switch when adding an application with source files larger than 500MB. - - .PARAMETER AzCopyWindowStyle - Specify whether the AzCopy content transfer progress should use -WindowStyle Hidden or -NoNewWindow parameters for Start-Process. NoNewWindow will show transfer output, Hidden will not show progress but will support multi-threaded jobs. + .PARAMETER RequirementRule + Provide an OrderedDictionary object as requirement rule that will be used for the Win32 application. - .PARAMETER UnattendedInstall - Specify to enforce the MSI installer to run silently, with /quiet added to the install command line of the Win32 application. + .PARAMETER AdditionalRequirementRule + Provide an array of OrderedDictionary objects as additional requirement rule, e.g. for file, registry or script rules, that will be used for the Win32 application. - .PARAMETER UnattendedUninstall - Specify to enforce the MSI installer to run silently, with /quiet added to the uninstall command line of the Win32 application. + .PARAMETER DetectionRule + Provide an array of a single or multiple OrderedDictionary objects as detection rules that will be used for the Win32 application. .NOTES Author: Nickolaj Andersen @@ -97,7 +82,7 @@ function Set-IntuneWin32App { 1.0.0 - (2023-01-25) Function created 1.0.1 - (2023-03-17) Added AllowAvailableUninstall parameter switch. 1.0.2 - (2023-09-04) Updated with Test-AccessToken function - 1.0.3 - (2025-10-20) Added additional parameters and improved error handling + 1.0.3 - (2025-10-20) Added additional parameters #> [CmdletBinding(SupportsShouldProcess = $true)] param(