From
SS64:
To support configurations for multiple users on the same machine, there are 4 locations where you can store a Profile.ps1 file:
1. "All users" profile "<Installation Directory>\profile.ps1"
2. "All users," host-specific profile "<Installation Directory>\Microsoft.PowerShell_profile.ps1"
3. Current user profile "<My Documents>\WindowsPowerShell\profile.ps1"
4. Current User, host-specific profile"<My Documents>\WindowsPowerShell\Microsoft.PowerShell_profile.ps1"
To see the Powershell profiles on my system;
Code:
pshell /s "$profile | Get-Member -Type NoteProperty"
Code:
TypeName: System.String
Name MemberType Definition
---- ---------- ----------
AllUsersAllHosts NoteProperty string AllUsersAllHosts=C:\WINDOWS\system32\WindowsPowerShell\v1.0\profile.ps1
AllUsersCurrentHost NoteProperty string AllUsersCurrentHost=C:\WINDOWS\system32\WindowsPowerShell\v1.0\Microsoft.P...
CurrentUserAllHosts NoteProperty string CurrentUserAllHosts=e:\Documents\WindowsPowershell\profile.ps1
CurrentUserCurrentHost NoteProperty string CurrentUserCurrentHost=e:\Documents\WindowsPowershell\Microsoft.PowerShell...
On my system;
Code:
pshell /s "test-path -path $Profile"
...returns True.
On my system;
Code:
pshell /s "test-path -path $Profile.AllUsersCurrentHost"
...returns False.
WAD, as
$Profile is just a pointer to the profile file name.
Joe
Ref:
about_Profiles
Ref:
$Profile