fix(powershell): execution policy check breaks when run in pwsh
When topgrade is run from within pwsh, the execution policy check breaks for the Windows Update and Windows Store steps, because they use normal powershell and the inherited PSModulePath environment variable breaks the Microsoft.PowerShell.Security module import. So we unset that variable to fix the issue, but also allow for those steps to use pwsh as neither step actually requires PowerShell 5. Co-authored-by: nistee <52573120+niStee@users.noreply.github.com>
This commit is contained in:
@@ -464,7 +464,7 @@ impl Step {
|
||||
Pnpm => runner.execute(*self, "pnpm", || node::run_pnpm_upgrade(ctx))?,
|
||||
Poetry => runner.execute(*self, "Poetry", || generic::run_poetry(ctx))?,
|
||||
Powershell => {
|
||||
let powershell = powershell::Powershell::new();
|
||||
let powershell = ctx.powershell();
|
||||
if powershell.is_available() {
|
||||
runner.execute(Powershell, "Powershell Modules Update", || {
|
||||
powershell.update_modules(ctx)
|
||||
|
||||
Reference in New Issue
Block a user