aaronparker / packagefactory

A packaging factory for Microsoft Intune using Evergreen, VcRedist, and IntuneWin32App
https://stealthpuppy.com/packagefactory/
MIT License
62 stars 19 forks source link

A Collection of minor issues encountered #56

Open obuolinis opened 2 months ago

obuolinis commented 2 months ago

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.

  1. 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. https://github.com/aaronparker/packagefactory/blob/8e2672a89a471d79e14cb5e0c2ca9738a4d7fccd/New-Win32Package.ps1#L1 https://github.com/aaronparker/packagefactory/blob/8e2672a89a471d79e14cb5e0c2ca9738a4d7fccd/scripts/Create-Win32App.ps1#L1

  2. 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: https://github.com/AzureAD/MSAL.PS/issues/15

  3. 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. https://github.com/aaronparker/packagefactory/blob/8e2672a89a471d79e14cb5e0c2ca9738a4d7fccd/New-Win32Package.ps1#L84

  4. New-Win32Package.ps1 doesn't honour "WorkingPath" parameter in all cases, specifically Create-Win32App.ps1 is downloading an icon into the script root (which was a problem for me when i tested inside Windows Sandbox and the folder was readonly). https://github.com/aaronparker/packagefactory/blob/8e2672a89a471d79e14cb5e0c2ca9738a4d7fccd/scripts/Create-Win32App.ps1#L54

  5. 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. https://github.com/aaronparker/packagefactory/blob/8e2672a89a471d79e14cb5e0c2ca9738a4d7fccd/New-Win32Package.ps1#L230-L237

  6. 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.

  7. Lack of consistency between msg and the code here https://github.com/aaronparker/packagefactory/blob/8e2672a89a471d79e14cb5e0c2ca9738a4d7fccd/New-Win32Package.ps1#L351-L352 and here https://github.com/aaronparker/packagefactory/blob/8e2672a89a471d79e14cb5e0c2ca9738a4d7fccd/New-Win32Package.ps1#L355-L362

  8. It works in Powershell v7 with no issues so far.

What i didn't like

  1. Test-IntuneWin32App takes 3 mins to complete which was annoying when testing, I had to just disable it.

  2. 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.