Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug report - Find/Install-ADTWinGetPackage & msstore #2

Closed
msellar-inst opened this issue Jan 1, 2025 · 5 comments
Closed

Bug report - Find/Install-ADTWinGetPackage & msstore #2

msellar-inst opened this issue Jan 1, 2025 · 5 comments
Labels
bug Something isn't working

Comments

@msellar-inst
Copy link

Expected Behavior

Find and install commands should work with source: msstore.
In the example below 9NHKF5NVCG00 = MS Forms.

Current Behavior

Find only works if you omit the -Id parameter. Eg:
Find-ADTWinGetPackage 9NHKF5NVCG00 <-- Works
Find-ADTWinGetPackage -id 9NHKF5NVCG00 <-- Fails "No packages matched the given input criteria"

Install commands don't work - with or without -Id. Eg:
Install-ADTWinGetPackage 9NHKF5NVCG00 <-- Fails "Failed to generate proxies for remote module 'Appx'. The runspace state is not valid for this operation"
Install-ADTWinGetPackage 9NHKF5NVCG00 -Source msstore <-- Fails "Failed to generate proxies for remote module 'Appx'. The runspace state is not valid for this operation"

Install-ADTWinGetPackage -id 9NHKF5NVCG00 <-- Fails "No packages matched the given input criteria"
Install-ADTWinGetPackage -id 9NHKF5NVCG00 -Source msstore <-- Fails "No packages matched the given input criteria"

Find/install should work - prob with or without the -Id parameter

Possible Solution

Steps to Reproduce

Run commands shown above

Context (Environment)

Development PC: Win10, VScode, PS7

get-installedModule -name psapp*

Version Name Repository Description


4.0.4 PSAppDeployToolkit PSGallery Enterprise App Deployment, Simplified.
1.0.0 PSAppDeployToolkit.WinGet PSGallery A PSAppDeployToolkit v4 extension module for WinGet.

Detailed Description

@msellar-inst msellar-inst added the bug Something isn't working label Jan 1, 2025
@mjr4077au
Copy link
Owner

mjr4077au commented Jan 1, 2025

Do you mind getting screenshots of the exact error, and potentially the output of $Error[0].ScriptStackTrace? It's interesting to see an Appx error here, but Appx in PowerShell 7 is average due to PowerShell/PowerShell#13138.

Hopefully I can make it work with some more info, otherwise I'll have to gate the module to just PowerShell Desktop and forbid Core usage.

@msellar-inst
Copy link
Author

msellar-inst commented Jan 2, 2025

I think maybe the Appx message is spurious, I think it happens if you try .\Invoke-AppDeployToolkit.ps1 two times in the same PS session. The first time, it returns that it can't find the package, so I think that is the error - the find command can find the package, but the install command can't. Sorry for the f'd up headings below.

PS7 Errors below (1ST Run):

[2025-01-02 14:38:01.089] [Pre-Install] [Repair-ADTWinGetPackageManager] [Info] :: Successfully confirmed that [Microsoft.DesktopAppInstaller] is installed on system.
[2025-01-02 14:38:01.091] [Pre-Install] [Repair-ADTWinGetPackageManager] [Info] :: Testing whether [Microsoft Visual C++ 2015-2022 Runtime] is installed, please wait...
[2025-01-02 14:38:01.229] [Pre-Install] [Repair-ADTWinGetPackageManager] [Info] :: Successfully confirmed that [Microsoft Visual C++ 2015-2022 Runtime] is installed on system.
[2025-01-02 14:38:01.233] [Pre-Install] [Repair-ADTWinGetPackageManager] [Info] :: Testing whether the installed WinGet is version [1.7.10582] or higher, please wait...
[2025-01-02 14:38:01.360] [Pre-Install] [Repair-ADTWinGetPackageManager] [Info] :: Successfully confirmed WinGet version [1.9.25200] is installed on system.
[2025-01-02 14:38:01.837] [Install] [Install-ADTWinGetPackage] [Error] :: Failed to install the specified WinGet package.
Error Record:

Message : Please specify a package by Id, Name, or Moniker.

FullyQualifiedErrorId : WinGetInstallFilterError,Install-ADTWinGetPackage
ScriptStackTrace : at Invoke-ADTWinGetDeploymentOperation, D:\psadt\Microsoft Forms\PSAppDeployToolkit.WinGet\PSAppDeployToolkit.WinGet.psm1: line 1708
at Install-ADTWinGetPackage, D:\psadt\Microsoft Forms\PSAppDeployToolkit.WinGet\PSAppDeployToolkit.WinGet.psm1: line 2964
at Install-ADTDeployment, D:\psadt\Microsoft Forms\Invoke-AppDeployToolkit.ps1: line 149
at , D:\psadt\Microsoft Forms\Invoke-AppDeployToolkit.ps1: line 299
at , : line 1

PositionMessage : At D:\psadt\Microsoft Forms\Invoke-AppDeployToolkit.ps1:149 char:5
+ Install-ADTWinGetPackage 9NHKF5NVCG00 -Source msstore
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[2025-01-02 14:38:01.877] [Install] [Invoke-AppDeployToolkit.ps1] [Error] :: Error Record:

Message : Please specify a package by Id, Name, or Moniker.

FullyQualifiedErrorId : WinGetInstallFilterError,Install-ADTWinGetPackage
ScriptStackTrace : at Invoke-ADTWinGetDeploymentOperation, D:\psadt\Microsoft Forms\PSAppDeployToolkit.WinGet\PSAppDeployToolkit.WinGet.psm1: line 1708
at Install-ADTWinGetPackage, D:\psadt\Microsoft Forms\PSAppDeployToolkit.WinGet\PSAppDeployToolkit.WinGet.psm1: line 2964
at Install-ADTDeployment, D:\psadt\Microsoft Forms\Invoke-AppDeployToolkit.ps1: line 149
at , D:\psadt\Microsoft Forms\Invoke-AppDeployToolkit.ps1: line 299
at , : line 1

PositionMessage : At D:\psadt\Microsoft Forms\Invoke-AppDeployToolkit.ps1:149 char:5
+ Install-ADTWinGetPackage 9NHKF5NVCG00 -Source msstore
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[2025-01-02 14:38:01.907] [Install] [Show-ADTDialogBox] [Info] :: Displaying Dialog Box with message: Error Record:

Message : Please specify a package by Id, Name, or Moniker.

FullyQualifiedErrorId : WinGetInstallFilterError,Install-ADTWinGetPackage
ScriptStackTrace : at Invoke-ADTWinGetDeploymentOperation, D:\psadt\Microsoft Forms\PSAppDeployToolkit.WinGet\PSAppDeployToolkit.WinGet.psm1: line 1708
at Install-ADTWinGetPackage, D:\psadt\Microsoft Forms\PSAppDeployToolkit.WinGet\PSAppDeployToolkit.WinGet.psm1: line 2964
at Install-ADTDeployment, D:\psadt\Microsoft Forms\Invoke-AppDeployToolkit.ps1: line 149
at , D:\psadt\Microsoft Forms\Invoke-AppDeployToolkit.ps1: line 299
at , : line 1

PositionMessage : At D:\psadt\Microsoft Forms\Invoke-AppDeployToolkit.ps1:149 char:5
+ Install-ADTWinGetPackage 9NHKF5NVCG00 -Source msstore
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
[2025-01-02 14:38:04.439] [Install] [Show-ADTDialogBox] [Info] :: Dialog Box Response: OK
[2025-01-02 14:38:04.471] [Finalization] [Close-ADTInstallationProgressFluent] [Info] :: Closing the installation progress dialog.
[2025-01-02 14:38:04.499] [Finalization] [Close-ADTSession] [Error] :: [Microsoft_MicrosoftForms_msstore_x64_EN_01] install completed with exit code [60001].
[2025-01-02 14:38:04.501] [Finalization] [Close-ADTSession] [Info] :: *******************************************************************************

PS D:\psadt\Microsoft Forms> $Error[0].ScriptStackTrace

at Invoke-ADTWinGetDeploymentOperation, D:\psadt\Microsoft Forms\PSAppDeployToolkit.WinGet\PSAppDeployToolkit.WinGet.psm1: line 1708
at Install-ADTWinGetPackage, D:\psadt\Microsoft Forms\PSAppDeployToolkit.WinGet\PSAppDeployToolkit.WinGet.psm1: line 2964
at Install-ADTDeployment, D:\psadt\Microsoft Forms\Invoke-AppDeployToolkit.ps1: line 149
at , D:\psadt\Microsoft Forms\Invoke-AppDeployToolkit.ps1: line 299
at , : line 1

### PS5 Below

[2025-01-02 14:40:49.329] [Pre-Install] [Repair-ADTWinGetPackageManager] [Info] :: Testing whether [Microsoft Visual C++ 2015-2022 Runtime] is installed, please wait...
[2025-01-02 14:40:49.465] [Pre-Install] [Repair-ADTWinGetPackageManager] [Info] :: Successfully confirmed that [Microsoft Visual C++ 2015-2022 Runtime] is installed on system.
[2025-01-02 14:40:49.470] [Pre-Install] [Repair-ADTWinGetPackageManager] [Info] :: Testing whether the installed WinGet is version [1.7.10582] or higher, please wait...
[2025-01-02 14:40:49.588] [Pre-Install] [Repair-ADTWinGetPackageManager] [Info] :: Successfully confirmed WinGet version [1.9.25200] is installed on system.
[2025-01-02 14:40:50.020] [Install] [Install-ADTWinGetPackage] [Error] :: Failed to install the specified WinGet package.
Error Record:

Message : Please specify a package by Id, Name, or Moniker.

FullyQualifiedErrorId : WinGetInstallFilterError,Install-ADTWinGetPackage
ScriptStackTrace : at Invoke-ADTWinGetDeploymentOperation, D:\psadt\Microsoft Forms\PSAppDeployToolkit.WinGet\PSAppDeployToolkit.WinGet.psm1: line 1708
at Install-ADTWinGetPackage, D:\psadt\Microsoft Forms\PSAppDeployToolkit.WinGet\PSAppDeployToolkit.WinGet.psm1: line 2964
at Install-ADTDeployment, D:\psadt\Microsoft Forms\Invoke-AppDeployToolkit.ps1: line 149
at , D:\psadt\Microsoft Forms\Invoke-AppDeployToolkit.ps1: line 299
at , : line 1

PositionMessage : At D:\psadt\Microsoft Forms\Invoke-AppDeployToolkit.ps1:149 char:5
+ Install-ADTWinGetPackage 9NHKF5NVCG00 -Source msstore
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[2025-01-02 14:40:50.061] [Install] [Invoke-AppDeployToolkit.ps1] [Error] :: Error Record:

Message : Please specify a package by Id, Name, or Moniker.

FullyQualifiedErrorId : WinGetInstallFilterError,Install-ADTWinGetPackage
ScriptStackTrace : at Invoke-ADTWinGetDeploymentOperation, D:\psadt\Microsoft Forms\PSAppDeployToolkit.WinGet\PSAppDeployToolkit.WinGet.psm1: line 1708
at Install-ADTWinGetPackage, D:\psadt\Microsoft Forms\PSAppDeployToolkit.WinGet\PSAppDeployToolkit.WinGet.psm1: line 2964
at Install-ADTDeployment, D:\psadt\Microsoft Forms\Invoke-AppDeployToolkit.ps1: line 149
at , D:\psadt\Microsoft Forms\Invoke-AppDeployToolkit.ps1: line 299
at , : line 1

PositionMessage : At D:\psadt\Microsoft Forms\Invoke-AppDeployToolkit.ps1:149 char:5
+ Install-ADTWinGetPackage 9NHKF5NVCG00 -Source msstore
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[2025-01-02 14:40:50.081] [Install] [Show-ADTDialogBox] [Info] :: Displaying Dialog Box with message: Error Record:

Message : Please specify a package by Id, Name, or Moniker.

FullyQualifiedErrorId : WinGetInstallFilterError,Install-ADTWinGetPackage
ScriptStackTrace : at Invoke-ADTWinGetDeploymentOperation, D:\psadt\Microsoft Forms\PSAppDeployToolkit.WinGet\PSAppDeployToolkit.WinGet.psm1: line 1708
at Install-ADTWinGetPackage, D:\psadt\Microsoft Forms\PSAppDeployToolkit.WinGet\PSAppDeployToolkit.WinGet.psm1: line 2964
at Install-ADTDeployment, D:\psadt\Microsoft Forms\Invoke-AppDeployToolkit.ps1: line 149
at , D:\psadt\Microsoft Forms\Invoke-AppDeployToolkit.ps1: line 299
at , : line 1

PositionMessage : At D:\psadt\Microsoft Forms\Invoke-AppDeployToolkit.ps1:149 char:5
+ Install-ADTWinGetPackage 9NHKF5NVCG00 -Source msstore
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
[2025-01-02 14:40:51.481] [Install] [Show-ADTDialogBox] [Info] :: Dialog Box Response: OK
[2025-01-02 14:40:51.529] [Finalization] [Close-ADTInstallationProgressFluent] [Info] :: Closing the installation progress dialog.
[2025-01-02 14:40:51.573] [Finalization] [Close-ADTSession] [Error] :: [Microsoft_MicrosoftForms_msstore_x64_EN_01] install completed with exit code [60001].
[2025-01-02 14:40:51.578] [Finalization] [Close-ADTSession] [Info] :: *******************************************************************************

@mjr4077au
Copy link
Owner

Thanks for all this extra info, I'll take a good look when I'm home from lunch!

@mjr4077au
Copy link
Owner

Find only works if you omit the -Id parameter. Eg:
Find-ADTWinGetPackage 9NHKF5NVCG00 <-- Works
Find-ADTWinGetPackage -id 9NHKF5NVCG00 <-- Fails "No packages matched the given input criteria"

With this first one, it doesn't work because it doesn't work via winget search as can be seen below.

image

To get around this, I'm enforcing --exact when an msstore id is passed through as that makes it work under all circumstances. The commit in question is 69577a8.

I've reported this bug to the WinGet team, it's being tracked via microsoft/winget-cli#5104. Hopefully they come back with something there as I'm limited to what the command line gives me.

You can download a pre-release copy of PSAppDeployToolkit.WinGet here, it will contain the fixes: https://github.com/mjr4077au/PSAppDeployToolkit.WinGet/actions/runs/12578381392. If there's any further issues, please raise a new case. I'll wait until the end of the week before releasing 1.0.1 to see if any further reports come through.

Thank you for using my module! I hope it works great for you within your environment 🤘

@mjr4077au
Copy link
Owner

@msellar-inst I've addressed your bug that occurs when running Invoke-AppDeployToolkit.ps1 twice within the same PowerShell 7 session here: fd923f7. This should cover all bases and make 1.0.1 quite formidable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants