PowerShell Profiles

  • PowerShell profile is text file which is automatically loaded every time PowerShell is started.
  • PowerShell profile extension is .ps1
  • PowerShell profiles are used to persist certain customizations like functions, aliases, variables.
  • PowerShell profiles are like window user profiles.
  • By default, there is no profile. We have to create it.

To create PowerShell profile:–
Create a text file with specified name in specified location based on type of the profile want to use. Please go through How to create PowerShell Profiles

Types of profiles in PowerShell:
1. AllUsersAllHosts: This applies to all users and all shells. Profile located at %windir%\windows\System32\WindowsPowerShell\v1.0\profile.ps1
2. AllUsersCurrentHost: This all users but only the Microsoft Powershell. Profile located at %windir%\windows\System32\WindowsPowerShell\v1.0\Microsoft.PowerShell_profile.ps1
3. CurrentUserAllHosts: This applies to the current user and all shells. Profile located at %UserProfile%/My Documents/WindowsPowerShell/profile.ps1
4. CurrentUserCurrentHost: This applies to only current user and the Microsoft PowerShell shell. Profile located at %UserProfile%/My Documents/WindowsPowerShell/Microsoft.PowerShell_profile.ps1

Powered by k2schools