Skip to content

Commit

Permalink
Update New-Win32Package.ps1
Browse files Browse the repository at this point in the history
Add support for installers already in intunewin format
  • Loading branch information
aaronparker committed Sep 22, 2024
1 parent 7b7b98a commit 1312530
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions New-Win32Package.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -388,16 +388,22 @@ process {
}

# Create the intunewin package
$params = @{
SourceFolder = $SourcePath
SetupFile = $IntuneWinSetupFile
OutputFolder = $OutputPath
Force = $true
if ($Result.FullName -match "\.intunewin$") {
Write-Msg -Msg "Copy downloaded intunewin file to: '$Path\output'"
Copy-Item -Path $Result.FullName -Destination $OutputPath -Force
}
else {
$params = @{
SourceFolder = $SourcePath
SetupFile = $IntuneWinSetupFile
OutputFolder = $OutputPath
Force = $true
}
Write-Msg -Msg "Create intunewin package in: '$OutputPath'"
Write-Msg -Msg "Source folder: '$SourcePath'"
Write-Msg -Msg "Setup file: '$IntuneWinSetupFile'"
$IntuneWinPackage = New-IntuneWin32AppPackage @params
}
Write-Msg -Msg "Create intunewin package in: '$OutputPath'"
Write-Msg -Msg "Source folder: '$SourcePath'"
Write-Msg -Msg "Setup file: '$IntuneWinSetupFile'"
$IntuneWinPackage = New-IntuneWin32AppPackage @params

# Get the package file
$PackageFile = Get-ChildItem -Path $OutputPath -Recurse -Include "*.intunewin" -ErrorAction "SilentlyContinue"
Expand Down

0 comments on commit 1312530

Please sign in to comment.