microsoft / microsoft/winget-cli
Error installing PowerShell module using PSResourceGet
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 26.4k
- Forks
- 1.8k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 15
Description
Brief description of your issue
Error occurs when installing the module using install-psresource.
Steps to reproduce
install-psresource Microsoft.WinGet.Client -TrustRepository
Expected behavior
Install module without error (as is the case for PowerShellGet/Install-Module).
Actual behavior
Install-PSResource: At line:69 char:21
- NestedModules = if ($env:PROCESSOR_ARCHITECTURE -like 'x86')
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~
A variable that cannot be referenced in restricted language mode or a Data section is being referenced. Variables that can be referenced include the following: $PSCulture, $PSUICulture, $true, $false, $null, $PSEdition, $PSScriptRoot.
Environment
Pwsh7.4p4
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce Install-PSResource Microsoft.WinGet.Client -TrustRepository under Pwsh7.4p4 and start with the module code corresponding to the reported line 69, where $env:PROCESSOR_ARCHITECTURE is referenced. Done means the module installs without the restricted-language-mode error, matching the expected PowerShellGet behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100