Tip: The automatic variable $PROFILE refers to Powershell profiles.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# Check if a profile exists Test-Path -Path $PROFILE # Current User,Current Host Test-Path -Path $PROFILE.CurrentUserCurrentHost # Current User,Current Host Test-Path -Path $PROFILE.CurrentUserAllHosts # Current User,All Hosts Test-Path -Path $PROFILE.AllUsersCurrentHost # All Users, Current Host Test-Path -Path $PROFILE.AllUsersAllHosts # All Users, All Hosts # Create a new profile for current user New-Item -ItemType File -Force $PROFILE # CurrentUserCurrentHost New-Item -ItemType File -Force $PROFILE.CurrentUserCurrentHost New-Item -ItemType File -Force $PROFILE.CurrentUserAllHosts # Edit psEdit $PROFILE (only for ISE) ise $PROFILE (only for ISE) notepad.exe $PROFILE # Reload (without restarting Powershell) & $PROFILE .$PROFILE # List profiles $PROFILE | Format-List * -Force |
Note: A Powershell profile is just a ps1 file.