Skip to content

Instantly share code, notes, and snippets.

@SuppliedOrange
Created August 26, 2024 20:06
Show Gist options
  • Save SuppliedOrange/b832a485d32bff14302eb01d63d91566 to your computer and use it in GitHub Desktop.
Save SuppliedOrange/b832a485d32bff14302eb01d63d91566 to your computer and use it in GitHub Desktop.
Powershell Directory Username Masker
<#
What this does is replaces a certain word in your directory path with another.
I use this to mask my username.
C:\Users\MyUserName\Documents\WindowsPowerShell becomes C:\Users\MyFakeName\Documents\WindowsPowerShell
Put this in > Documents/WindowsPowerShell/Microsoft.PowerShell_profile.ps1
#>
function prompt {
$currentPath = (Get-Location).Path
$maskedPath = $currentPath -replace "MyUserName", 'MyFakeName'
"$maskedPath> "
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment