[pr-fix] get-* fetchers: start Windows PowerShell without the caller's PSModulePath #90

Manually merged
TrustNo1 merged 1 commit from dutchmega/Darner:powershell-module-path into main 2026-12-03 20:19:37 +00:00
Contributor

What it changes

darner get-fsr started from PowerShell 7 failed at every file:

Get-FileHash : The term 'Get-FileHash' is not recognized

darner.exe passes its environment to powershell.exe. PowerShell 7's PSModulePath lists 7's modules first, so Windows PowerShell loads 7's Microsoft.PowerShell.Utility, which it cannot use, and Get-FileHash is missing. (pwsh clears the variable itself when it starts powershell.exe directly; darner.exe in between does not.)

  • apps/darner/src/play.rs: new run_fetcher starts powershell.exe without PSModulePath, so Windows PowerShell builds its own. The NVIDIA, AMD FSR, MFG Unlocker and D3D12 fetchers all use it.

How it was tested

  • Tested revision: 73faa80
  • Commands and results:
    • From pwsh 7.6 through cmd: Get-Command Get-FileHash fails in powershell.exe with the inherited PSModulePath, and works without it.
    • darner get-fsr from pwsh with this build: checks all three DLLs and fetches the licence.
    • Keeps working from cmd
  • Gameplay, when relevant: not relevant (fetchers only).
  • Coverage gaps: get-dlss, get-mfg and get-d3d12 not run separately; they use the same run_fetcher.

Checklist

  • This PR contains one change based on main.
  • The diff follows docs/asset-policy.md.
  • I recorded this PR's dependencies below.
    • Depends on: none

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches.
  • Related PRs: none found.

Contributor role (optional)

  • Fluxer ID: 1575942915249680389
## What it changes `darner get-fsr` started from PowerShell 7 failed at every file: ``` Get-FileHash : The term 'Get-FileHash' is not recognized ``` darner.exe passes its environment to `powershell.exe`. PowerShell 7's `PSModulePath` lists 7's modules first, so Windows PowerShell loads 7's `Microsoft.PowerShell.Utility`, which it cannot use, and `Get-FileHash` is missing. (pwsh clears the variable itself when it starts `powershell.exe` directly; darner.exe in between does not.) - `apps/darner/src/play.rs`: new `run_fetcher` starts `powershell.exe` without `PSModulePath`, so Windows PowerShell builds its own. The NVIDIA, AMD FSR, MFG Unlocker and D3D12 fetchers all use it. ## How it was tested - Tested revision: 73faa80 - Commands and results: - From pwsh 7.6 through cmd: `Get-Command Get-FileHash` fails in `powershell.exe` with the inherited `PSModulePath`, and works without it. - `darner get-fsr` from pwsh with this build: checks all three DLLs and fetches the licence. - Keeps working from cmd - Gameplay, when relevant: not relevant (fetchers only). - Coverage gaps: `get-dlss`, `get-mfg` and `get-d3d12` not run separately; they use the same `run_fetcher`. ## Checklist - [x] This PR contains one change based on `main`. - [x] The diff follows `docs/asset-policy.md`. - [x] I recorded this PR's dependencies below. - Depends on: none ## Checked for overlap - [ ] I searched the open pull requests for the same issue and for the files this touches. - Related PRs: none found. ## Contributor role (optional) - Fluxer ID: 1575942915249680389
`darner get-fsr` started from PowerShell 7 failed at every file:
"Get-FileHash : The term 'Get-FileHash' is not recognized". darner.exe
passes its environment on, and PowerShell 7's PSModulePath names 7's
modules first: Windows PowerShell loads 7's Microsoft.PowerShell.Utility,
which it cannot use, so Get-FileHash is missing. (pwsh clears the variable
itself when it starts powershell.exe; darner.exe in between does not.)

- apps/darner/src/play.rs: `run_fetcher` starts powershell.exe with the
  variable removed (Windows PowerShell then builds its own); the NVIDIA,
  AMD FSR, MFG Unlocker and D3D12 fetchers go through it.

Reproduced from pwsh 7.6 through cmd: Get-Command Get-FileHash is $false
with the inherited PSModulePath and $true without it. `darner get-fsr` from
pwsh with this build checks all three DLLs and fetches the licence.
TrustNo1 manually merged commit bd0de0cec2 into main 2026-12-03 20:19:37 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
TrustNo1/Darner!90
No description provided.