mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-02-15 09:19:24 +01:00
1.2 KiB
1.2 KiB
The my-profile.ps1 Script
my-profile.ps1
Parameters
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
Script Content
# POWERSHELL PROFILE TO DEFINE THE LOOK & FEEL
# WINDOW TITLE
if ($IsLinux) { $username = $(whoami) } else { $username = $env:USERNAME }
$host.ui.RawUI.WindowTitle = "$username @ $(hostname)"
# GREETING
Write-Host "✨ Welcome $username to $(hostname)'s PowerShell - type 'FAQ' for help." -foregroundColor green
# PROMPT
function prompt { Write-Host "`n➤ " -noNewline -foregroundColor yellow; return " " }
# ALIASES
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
(page generated by convert-ps2md.ps1 as of 01/17/2025 08:37:10)