[X] I have verified this is the correct repository for opening this issue.
[X] I have verified no other issues exist related to my problem.
[X] I have verified this is not an issue for a specific package.
[X] I have verified this issue is not security related.
[X] I confirm I am using official, and not unofficial, or modified, Chocolatey products.
What You Are Seeing?
With the release of Chocolatey.Cake.Recipe 0.26.0, the ability to use PSScriptAnalyzer was added. The way that this is done is by installing the PowerShell modules needed if they can't be found. Unfortunately the default Windows PowerShell configuration has an older PSGet module, and it defaults to installing to the AllUsers Scope. This means that it can't install modules if you're not running as administrator.
What is Expected?
Should install modules to the CurrentUser scope if the AllUsers scope is unavailable.
How Did You Get This To Happen?
Running the build script for licensing-services, got the error:
System Details
Operating System: Windows 10 22H2
Windows PowerShell version: 5.1
Chocolatey CLI Version: 2.2.2
Chocolatey Licensed Extension version: N/A
Chocolatey License type: N/A
Terminal/Emulator: ConHost
Installed Packages
N/A
Output Log
See above screenshot.
Additional Context
Some other things we might want to account for (These may be good to split to other issues, mostly just dumping thoughts here for now):
On a fresh system, the Install-Module will want to install the NuGet Package Provider.
The install of the module could be done always to CurrentUser, or we could try AllUsers, then do CurrentUser if that fails.
There might be some weirdness if you launch the build script from pwsh.exe
Checklist
What You Are Seeing?
With the release of Chocolatey.Cake.Recipe 0.26.0, the ability to use PSScriptAnalyzer was added. The way that this is done is by installing the PowerShell modules needed if they can't be found. Unfortunately the default Windows PowerShell configuration has an older PSGet module, and it defaults to installing to the AllUsers Scope. This means that it can't install modules if you're not running as administrator.
What is Expected?
Should install modules to the CurrentUser scope if the AllUsers scope is unavailable.
How Did You Get This To Happen?
Running the build script for licensing-services, got the error:
System Details
Installed Packages
Output Log
Additional Context
Some other things we might want to account for (These may be good to split to other issues, mostly just dumping thoughts here for now):
pwsh.exe