PowerShell/scripts/my-profile.ps1

21 lines
869 B
PowerShell
Raw Normal View History

2024-10-01 15:11:03 +02:00
# MY POWERSHELL PROFILE - it defines the look & feel of PowerShell.
2022-04-07 08:32:52 +02:00
# WINDOW TITLE
if ($IsLinux) { $username = $(whoami) } else { $username = $env:USERNAME }
$host.ui.RawUI.WindowTitle = "$username @ $(hostname)"
# GREETING
2024-11-03 10:06:13 +01:00
Write-Host "👋 Welcome $username to $(hostname)'s PowerShell - type 'hlp' if you need help." -foregroundColor green
2024-09-16 19:56:50 +02:00
# PROMPT
function prompt { Write-Host "`n" -noNewline -foregroundColor yellow; return " " }
2021-02-27 11:19:57 +01:00
2024-09-16 19:56:50 +02:00
# ALIASES
2024-11-07 14:39:30 +01:00
set-alias -name enter -value enter-host.ps1
2024-09-03 15:03:15 +02:00
set-alias -name hlp -value write-help.ps1
2024-11-07 14:39:30 +01:00
set-alias -name ll -value Get-ChildItem # ll = list folder (long format)
2022-04-07 08:32:52 +02:00
del alias:ls -force -errorAction SilentlyContinue
set-alias -name ls -value list-folder.ps1 # ls = list folder (short format)
2024-11-07 14:39:30 +01:00
del alias:pwd -force -errorAction SilentlyContinue
set-alias -name pwd -value list-workdir.ps1 # pwd = print working directory