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

Microsoft.WinGet.Client- Get-WinGetPackage : This cmdlet is not supported in Windows PowerShell in Systemcontext #4820

Open
langermi opened this issue Sep 19, 2024 · 3 comments
Labels
Context-System Related to system context (nt authority/session 0) PowerShell Issue related to WinGet PowerShell Module or cmdlet

Comments

@langermi
Copy link

Brief description of your issue

After installing the current version (1.9.2411) of the Microsoft.WinGet.Client package from PSGallery many of the commands throw following errors:
Get-WinGetPackage : This cmdlet is not supported in Windows PowerShell.
Find-WinGetPackage : This cmdlet is not supported in Windows PowerShell.
get-WinGetPackage : This cmdlet is not supported in Windows PowerShell.
Install-WinGetPackage : This cmdlet is not supported in Windows PowerShell.

Psversion in System context:
`$PSVersionTable

Name Value


PSVersion 5.1.22621.4111
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.22621.4111
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1`

Steps to reproduce

Open PS in System Context

Install-Module Microsoft.WinGet.Client -Repository PSGallery -Scope AllUsers -Force
Import-Module Microsoft.WinGet.Client

Find-WinGetPackage HeidiSQL.HeidiSQL

Expected behavior

`Find-WinGetPackage HeidiSQL.HeidiSQL

Name Id Version Source


HeidiSQL HeidiSQL.HeidiSQL 12.8 winget`

Actual behavior

Get-WinGetPackage : This cmdlet is not supported in Windows PowerShell.
Find-WinGetPackage : This cmdlet is not supported in Windows PowerShell.
get-WinGetPackage : This cmdlet is not supported in Windows PowerShell.
Install-WinGetPackage : This cmdlet is not supported in Windows PowerShell.

Environment

Windows: Windows.Desktop v10.0.22631.4169
Systemarchitektur: X64
Paket: Microsoft.DesktopAppInstaller v1.23.1911.0

PSVersion 5.1.22621.4111

Microsoft.WinGet.Client 1.9.2411 from PSGallery

Windows 11 22631.4169
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Triage Issue need to be triaged label Sep 19, 2024
@stephengillie
Copy link

I'm not entirely sure, but I believe this might work on PowerShell, which despite the similar naming, has some differences from Windows Powershell. Would it be possible to install that CLI to test?

@microsoft-github-policy-service microsoft-github-policy-service bot added Context-System Related to system context (nt authority/session 0) and removed Needs-Triage Issue need to be triaged labels Sep 19, 2024
@langermi
Copy link
Author

Hi,

In Powershell 7 everything works as expected. But as i understand, this module should be compatible with powershell 5.1 as stated in PSgallery.
Since we want to use some of this Modules functionality in Intune/ConfigMgr, Powershell 7 is sadly out of the picture.

Thanks

@denelon denelon added the PowerShell Issue related to WinGet PowerShell Module or cmdlet label Sep 23, 2024
@jonygomes06
Copy link

jonygomes06 commented Sep 24, 2024

Hey, im actually having similar problem.
Using terminal and this path for powershell: C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe. Totaly works.

But if i run it using rust programming language and using the same path it gives this error: Get-WinGetPackage : This cmdlet is not supported in Windows PowerShell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Context-System Related to system context (nt authority/session 0) PowerShell Issue related to WinGet PowerShell Module or cmdlet
Projects
None yet
Development

No branches or pull requests

4 participants