Open gknutson1 opened 1 year ago
We're actively working on the PowerShell Module:
This is very much in a preview state.
@denelon Any progress on making the module work on PS 5.1?
Any progress on making the module work on PS 5.1?
It could be a notable change in installing application updates remotely with command prompt...
George J.
Since the current preview version does not work on PowerShell 5.1, is it possible to mark it as PowerShell 7.x compatible only?
We're working on Repair-WinGetPackageManager currently so it can be used in Windows PowerShell to install the client. Once that's released, we'll start looking at the other cmdlets. We didn't want to block Windows PowerShell users from being able to leverage the repair cmdlet.
What's the update for PS 7
Brief description of your issue
On new Windows 11 installs, after updating Winget and installing dependencies, Several of the PowerShell commands do not work and will throw
Exception has been thrown by the target of an invocation.
Currently, all theWinGetPackage
commands (Get-WingetPackage
,Uninstall-WingetPackage
, etc.) throw the error.Adding
-Verbose
and-Debug
does not give any additional output.Get-WingetVersion
works as expected (returnsv1.4.10173
). The other commands (the variousWingetSetting
andWingetSource
commands) do not throw this error either.The
Winget
command itself works fine - I can search, list, and install like normal.The above behavior occurs when using Powershell v7.3.1. Using the Windows built in Powershell (v5.1.22621.963 for me), I cannot even import the module. running
import-module .\Microsoft.WinGet.Client.psd1 -Verbose
there gives the following output:Steps to reproduce
Get-WingetPackage
Expected behavior
Get-WingetPackage
returns a list of all installed packagesActual behavior
Get-WingetPackage
returnsGet-WinGetPackage: Exception has been thrown by the target of an invocation.
Environment