PowerShell/Scripts/my-profile.ps1

31 lines
998 B
PowerShell
Raw Normal View History

2021-09-27 10:38:12 +02:00
# My PowerShell Profile
2021-05-29 18:56:48 +02:00
# =====================
2021-12-09 07:19:20 +01:00
# This file defines the look & feel of PowerShell - adapt the following lines to your needs, please.
2021-12-09 07:19:20 +01:00
# The Welcome Message
# -------------------
"Welcome to PowerShell at $(hostname) in 📂$(get-location)"
# The Window Title
# ----------------
2021-04-17 13:12:27 +02:00
if ($IsLinux) { $Username = $(whoami) } else { $Username = $env:USERNAME }
2021-05-29 18:56:48 +02:00
$host.ui.RawUI.WindowTitle = "$Username @ $(hostname)"
2021-12-09 07:19:20 +01:00
# The Command Prompt
# ------------------
2021-05-29 18:56:48 +02:00
function prompt { write-host -noNewline -foregroundColor yellow "`n"; return " " }
2021-02-27 11:19:57 +01:00
2021-04-03 15:24:18 +02:00
2021-12-09 07:19:20 +01:00
# Supported Alias Names
# ---------------------
2021-05-04 20:08:38 +02:00
del alias:pwd -force -errorAction SilentlyContinue
2021-04-20 16:47:44 +02:00
set-alias -name pwd -value list-workdir.ps1 # pwd = print working directory
set-alias -name ll -value get-childitem # ll = list long
2021-05-04 20:08:38 +02:00
del alias:ls -force -errorAction SilentlyContinue
2021-10-10 10:25:48 +02:00
set-alias -name ls -value list-folder.ps1
2021-04-25 10:25:03 +02:00
set-alias -name .. -value cd-up.ps1 # 1 dir level up
set-alias -name ... -value cd-up2.ps1 # 2 dir levels up