Situatie
# 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
Solutie
Pasi de urmat
# 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
Leave A Comment?