PowerShell/docs/my-profile.md

43 lines
1.2 KiB
Markdown
Raw Normal View History

2024-11-08 12:38:20 +01:00
The *my-profile.ps1* Script
===========================
2022-11-17 20:02:26 +01:00
my-profile.ps1
2021-10-17 14:33:27 +02:00
2023-07-29 10:04:38 +02:00
Parameters
----------
2021-10-17 14:33:27 +02:00
```powershell
[<CommonParameters>]
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
```
2023-07-29 10:04:38 +02:00
Script Content
--------------
2022-11-17 20:05:34 +01:00
```powershell
2025-01-17 08:31:53 +01:00
# POWERSHELL PROFILE TO DEFINE THE LOOK & FEEL
2022-11-17 20:02:26 +01:00
# WINDOW TITLE
2024-08-15 09:51:46 +02:00
if ($IsLinux) { $username = $(whoami) } else { $username = $env:USERNAME }
$host.ui.RawUI.WindowTitle = "$username @ $(hostname)"
2022-11-17 20:02:26 +01:00
2024-05-19 10:25:56 +02:00
# GREETING
2025-01-17 08:31:53 +01:00
Write-Host "✨ Welcome $username to $(hostname)'s PowerShell - type 'FAQ' for help." -foregroundColor green
2024-05-19 10:25:56 +02:00
2024-11-08 12:35:11 +01:00
# PROMPT
2024-05-19 10:25:56 +02:00
function prompt { Write-Host "`n➤ " -noNewline -foregroundColor yellow; return " " }
2022-11-17 20:02:26 +01:00
2024-11-08 12:35:11 +01:00
# ALIASES
2025-01-17 08:31:53 +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
2022-11-17 20:05:34 +01:00
```
2022-11-17 20:02:26 +01:00
2025-01-17 08:37:30 +01:00
*(page generated by convert-ps2md.ps1 as of 01/17/2025 08:37:10)*