You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows
PS C:\Users\olav.birkeland>$env:PSModulePath.Split(';')
C:\Users\olav.birkeland\scoop\modules
C:\Users\olav.birkeland\AppData\Local\Microsoft\PowerShell\Modules
C:\Users\olav.birkeland\OneDrive - Innovasjon Norge\Documents\PowerShell\Modules
C:\Program Files\WindowsPowerShell\Modules
C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
PS C:\Users\olav.birkeland>
I then found following package on PowerShell Gallery:
That's correct. Windows PowerShell doesn't support powershell.config.json. That's why the about_PowerShell_Config article doesn't exist in the 5.1 documentation. You were looking at the documentation for PowerShell 7.4.
Type of issue
Other (describe below)
Feedback
I tested using
powershell.config.json
for overriding PSModulePath like described here:I created the file this resolves to in both pwsh.exe and powershell.exe:
With following content:
I then loaded
pwsh.exe -NoProfile
:But with
powershell.exe
it does not seem to work:I then found following package on PowerShell Gallery:
It has a check that throws and error if not PowerShell Core:
So, it seems to me Windows PowerShell / powershell.exe does not support powershell.config.json? 🤔
Page URL
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_powershell_config?view=powershell-7.4#psmodulepath
Content source URL
https://github.com/MicrosoftDocs/PowerShell-Docs/blob/main/reference/7.4/Microsoft.PowerShell.Core/About/about_PowerShell_Config.md
Author
@sdwheeler
Document Id
91d350cb-6ac3-5a2e-b959-a9c8c1629c12
The text was updated successfully, but these errors were encountered: