Last active
November 16, 2021 00:33
-
-
Save Elyorbe/914fd53636f2087ff0c99cda8ed96cda to your computer and use it in GitHub Desktop.
Change the prompt shell to show without current folder only without full path
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
1. Add following function to your powershell profile. | |
If doesn't exist create under $ENV:USERPROFILE\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 | |
#> | |
function prompt { | |
$p = Split-Path -leaf -path (Get-Location) | |
"$p> " | |
} | |
<# | |
2. Save the profile and restart PowerShell | |
3. (Optional) If you get the error message that says you are not allowed to run the scripts, | |
Run following command and restart the Powershell again. | |
#> | |
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment