-
Notifications
You must be signed in to change notification settings - Fork 22
Description
I started testing Package Factory and i already like it, good job guys.
But I noticed several issues in the code that i wanted to let you know about, along with some observations.
-
Why do you have PSEdition=Desktop as a hard requirement? I had to remove it before i was able to even test on Powershell v7.
packagefactory/New-Win32Package.ps1
Line 1 in 8e2672a
#Requires -PSEdition Desktop
#Requires -PSEdition Desktop -
I was having issues with cert authentication when using a self-signed cert in Powershell 5.1, but not in v7. I understand it's out of your scope though, as described in this issue of MSAL.PS:
Get-MsalToken with Client Certificate fails on Windows PowerShell 5.1 AzureAD/MSAL.PS#15 -
In the documentation you're saying that "Path" parameter of
New-Win32Package.ps1"defaults to the same directory as where New-Win32Package.ps1 is located". However in the code you have a different default.
packagefactory/New-Win32Package.ps1
Line 84 in 8e2672a
[System.String] $Path = "E:\projects\packagefactory\packages", -
New-Win32Package.ps1doesn't honour "WorkingPath" parameter in all cases, specificallyCreate-Win32App.ps1is downloading an icon into the script root (which was a problem for me when i tested inside Windows Sandbox and the folder was readonly).
$OutFile = [System.IO.Path]::Combine($PSScriptRoot, $(Split-Path -Path $AppData.PackageInformation.IconFile -Leaf)) -
When using PSAppDeployToolkit, copying of Deploy-Application.ps1 to the Files folder (because $SourcePath points to Files at that point) of PSADT is completely unnecessary.
Exclude = "Deploy-Application.ps1"should do.
packagefactory/New-Win32Package.ps1
Lines 230 to 237 in 8e2672a
$params = @{ Path = "$([System.IO.Path]::Combine($AppPath, "Source"))\*" Destination = $SourcePath Recurse = $true Force = $true ErrorAction = "Stop" } Copy-Item @params -
When the Factory picks up the presence of Deploy-Application.ps1 and includes PSADT into intunewin package, the Install and Uninstall commands are written as if Install.ps1 script was used.
-
Lack of consistency between msg and the code here
packagefactory/New-Win32Package.ps1
Lines 351 to 352 in 8e2672a
Write-Msg -Msg "Copy downloaded intunewin file to: '$Path\output'" Copy-Item -Path $Result.FullName -Destination $OutputPath -Force
and here
packagefactory/New-Win32Package.ps1
Lines 355 to 362 in 8e2672a
Write-Msg -Msg "Create intunewin package in: '$Path\output'" $params = @{ SourceFolder = $SourcePath SetupFile = $Manifest.PackageInformation.SetupFile OutputFolder = $OutputPath Force = $true } $IntuneWinPackage = New-IntuneWin32AppPackage @params -
It works in Powershell v7 with no issues so far.
What i didn't like
-
Test-IntuneWin32App takes 3 mins to complete which was annoying when testing, I had to just disable it.
-
Unfortunately PSADT integration is lacking, I'd expect the Factory to be able to automatically produce Deploy-Application.ps1 based on app json data. I already have the code that can do that and that I'm using elsewhere if you're interested.