PowerShell/Scripts/my-profile.ps1

31 lines
863 B
PowerShell
Raw Normal View History

2021-04-03 15:24:18 +02:00
# My PowerShell Profile
# =====================
2021-04-03 15:46:30 +02:00
# Welcome to 'my-profile.ps1' - this file defines the look&feel of PowerShell for the user.
2021-04-03 15:24:18 +02:00
# Simply comment/uncomment/adapt the following lines.
#
#
# My Command Prompt
# -----------------
2021-02-27 11:19:57 +01:00
2021-04-03 15:24:18 +02:00
# function prompt {$null} # result is: PS>
2021-02-25 11:57:02 +01:00
2021-04-03 15:24:18 +02:00
# function prompt { "$ " } # result is: $
2021-02-25 11:57:02 +01:00
2021-03-15 16:21:59 +01:00
function prompt {
2021-04-03 15:24:18 +02:00
if ($IsLinux) { $Username = $(whoami) } else { $Username = $env:USERNAME }
$host.ui.RawUI.WindowTitle = "$Username @ $(hostname)"
2021-03-15 16:21:59 +01:00
write-host -foregroundColor blue -noNewLine "$(Get-Location)"
return "> "
2021-04-03 15:24:18 +02:00
} # result is: C:\>
2021-02-27 11:19:57 +01:00
2021-04-03 15:24:18 +02:00
# My Alias Names
# --------------
2021-03-15 16:05:50 +01:00
set-alias -name lsf -value get-childitem # lsf means list directory formatted
2021-04-03 15:46:30 +02:00
# My Welcome Message
# ------------------
2021-04-03 16:14:28 +02:00
clear-host
write-host "Welcome to PowerShell $($PSVersionTable.PSVersion) at $(hostname), it's $(Get-date)"
write-host ""