Skip to content

Instantly share code, notes, and snippets.

@techthoughts2
Last active September 14, 2018 17:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save techthoughts2/776bbc21c7b4e7fed6dc23def0c47eac to your computer and use it in GitHub Desktop.
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.
# 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