Created
August 26, 2024 20:06
-
-
Save SuppliedOrange/b832a485d32bff14302eb01d63d91566 to your computer and use it in GitHub Desktop.
Powershell Directory Username Masker
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
<# | |
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