Powershell: Profile locations

Hi,

if you want to customize your environment powershell has ability to load or execute some scripts at startup.

There are 4 files where you can define functions, aliases … The AllHosts variables does not mean Computers. Allhosts is relating to Programs with has an Interface to Powershell, for example Powershell itself, Powershell ISE and so on. While currenthost means a specfic program. The currenthost variables differ from Powershell to Powershell ISE.

PS C:\> $Profile.AllUsersAllHosts
C:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1
PS C:\> $Profile.AllUsersCurrentHost
C:\Windows\System32\WindowsPowerShell\v1.0\Microsoft.PowerShell_profile.ps1
PS C:\> $Profile.CurrentUserAllHosts
C:\Users\CurrentUser\Documents\WindowsPowerShell\profile.ps1
PS C:\> $Profile.CurrentUserCurrentHost
C:\Users\CurrentUser\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1

Michael

Leave a Reply