Skip to content

Instantly share code, notes, and snippets.

@Elyorbe
Last active November 16, 2021 00:33
Show Gist options
  • Save Elyorbe/914fd53636f2087ff0c99cda8ed96cda to your computer and use it in GitHub Desktop.
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
<#
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