PowerShell/scripts/my-profile.ps1

21 lines
840 B
PowerShell
Raw Normal View History

2024-11-22 11:35:30 +01:00
# POWERSHELL PROFILE TO DEFINE THE LOOK & FEEL
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-22 11:35:30 +01:00
Write-Host "👋 Welcome $username to $(hostname)'s PowerShell - type 'FAQ' for 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-22 11:35:30 +01:00
Set-Alias -name enter -value enter-host.ps1
Set-Alias -name FAQ -value write-help.ps1
Set-Alias -name ll -value Get-ChildItem # ll = list folder (long format)
Del alias:ls -force -errorAction SilentlyContinue
Set-Alias -name ls -value list-folder.ps1 # ls = list folder (short format)
Del alias:pwd -force -errorAction SilentlyContinue
Set-Alias -name pwd -value list-workdir.ps1 # pwd = print working directory