FolderRisk: Do not touch
WindowsPowerShell\v1.0 C:\Windows\System32\WindowsPowerShell\v1.0
Windows PowerShell 5.1 installation folder ($PSHOME): powershell.exe, powershell_ise.exe, built-in modules, all-users profiles; the "1.0" is historical.
What it’s for
Folder of Windows PowerShell 5.1, the version built into Windows; the $PSHOME variable points to it. The “v1.0” dates from the first release and never changed, which surprises people on 5.1. PowerShell 7 is a separate installation in C:\Program Files\PowerShell\7, with its own $PSHOME.
What it contains
powershell.exeandpowershell_ise.exe, the type and format files (*.types.ps1xml,*.format.ps1xml) and the help.- The
Modulessubfolder: built-in modules and those of roles and features (ActiveDirectory, Hyper-V, DnsServer, DhcpServer…). - The all-users profiles:
profile.ps1(all hosts) andMicrosoft.PowerShell_profile.ps1(console host). They do not exist by default; this is where you create them for every user of the machine.
Risks and best practices
- The files belong to TrustedInstaller and are serviced by Windows Update: do not modify them, a script copied there gets overwritten by an update.
- A global
profile.ps1runs for every account, scheduled tasks included: an error in it breaks jobs elsewhere. For customization, prefer the user profile ($PROFILE) or a module. - To install your own modules, use
C:\Program Files\WindowsPowerShell\Modules, not theModulesfolder here. $env:PSModulePathcombines three default folders: the user profile, Program Files and$PSHOME\Modules.
Useful commands
# Install folder and version of the running engine$PSHOME$PSVersionTable.PSVersion
# Profile paths (existing or not)$PROFILE | Select-Object *
# Module folders in effect$env:PSModulePath -split ';'