Last active
September 14, 2018 17:55
-
-
Save techthoughts2/776bbc21c7b4e7fed6dc23def0c47eac to your computer and use it in GitHub Desktop.
Adds a greeting to the CurrentUserAllHosts PowerShell profile that will greet you every time you open a PowerShell instance.
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
# create profile if it does not yet exist | |
$exists = Test-Path -Path $Profile.CurrentUserAllHosts | |
if (!$exists){ | |
New-Item -Path $Profile.CurrentUserAllHosts -ItemType File -Force | Out-Null | |
} | |
# add code to profile | |
$greetings = | |
'Hello there!', | |
'Glad to see you!', | |
'Welcome Back!', | |
'Happy coding!', | |
'Have a great day!', | |
'Be one with the Snover', | |
'May the PowerShell be with you!' | |
Write-Host -ForegroundColor Cyan ($greetings | Get-Random) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment