-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added automatic download for IntuneWinAppUtil (from GitHub) * Added Intune direct upload as new feature (only for packages with MSI installer) * Fixed issue with selecting folder by the clicking on the folder icon
- Loading branch information
Showing
5 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@echo off | ||
powershell.exe -NoProfile -NoLogo -ExecutionPolicy ByPass -File "%~dp0Intune.ps1" -Tenant "%~1" -IntuneWinFile "%~2" -DisplayName "%~3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Parameters | ||
Param( | ||
[Parameter(Mandatory)] | ||
[string]$Tenant, | ||
|
||
[Parameter(Mandatory)] | ||
[string]$IntuneWinFile, | ||
|
||
[Parameter(Mandatory)] | ||
[string]$DisplayName | ||
) | ||
|
||
# Set Execution Policy | ||
Set-ExecutionPolicy ByPass -Scope CurrentUser | ||
|
||
# Connect to Intune | ||
# Install-Module -Name "IntuneWin32App" | ||
Connect-MSIntuneGraph -TenantID $Tenant | Out-Null | ||
|
||
# Get MSI meta data from .intunewin file | ||
$IntuneWinMetaData = Get-IntuneWin32AppMetaData -FilePath $IntuneWinFile | ||
|
||
If ($IntuneWinMetaData.ApplicationInfo.MsiInfo) | ||
{ | ||
# Create requirement rule for all platforms and Windows 11 | ||
$RequirementRule = New-IntuneWin32AppRequirementRule -Architecture "All" -MinimumSupportedWindowsRelease "W11_22H2" | ||
|
||
# Create PowerShell script detection rule | ||
$DetectionRule = New-IntuneWin32AppDetectionRuleMSI -ProductCode $IntuneWinMetaData.ApplicationInfo.MsiInfo.MsiProductCode -ProductVersionOperator "greaterThanOrEqual" -ProductVersion $IntuneWinMetaData.ApplicationInfo.MsiInfo.MsiProductVersion | ||
|
||
# Create custom return code | ||
$ReturnCode = New-IntuneWin32AppReturnCode -ReturnCode 1337 -Type "retry" | ||
|
||
# Add new EXE Win32 app | ||
$InstallCommandLine = 'msiexec /i "' + $($IntuneWinMetaData.ApplicationInfo.SetupFile) + '" /qn' | ||
$UninstallCommandLine = 'msiexec /x "' + $($IntuneWinMetaData.ApplicationInfo.MsiInfo.MsiProductCode) + '" /qn' | ||
|
||
Add-IntuneWin32App -FilePath $IntuneWinFile -DisplayName $DisplayName -Description "Imported with Setup Packager for Intune - by TUGI" -Publisher "SetupPackager" -InstallExperience "system" -RestartBehavior "suppress" -DetectionRule $DetectionRule -RequirementRule $RequirementRule -ReturnCode $ReturnCode -InstallCommandLine $InstallCommandLine -UninstallCommandLine $UninstallCommandLine -Verbose | ||
Exit 0 | ||
} | ||
Else | ||
{ | ||
CLS | ||
Write-Host "Upload failed: Sorry, MSI only supported." | ||
Exit 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
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 |
Binary file not shown.