From 7a95abaf921f2768167d721489ad3d3269461444 Mon Sep 17 00:00:00 2001 From: Tomasz Kostrzewa Date: Tue, 5 Mar 2024 20:57:59 +0100 Subject: [PATCH] modified: RdzeN-Profile.ps1 new file: functions/prompt.ps1 --- RdzeN-Profile.ps1 | 9 +++++---- functions/prompt.ps1 | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 functions/prompt.ps1 diff --git a/RdzeN-Profile.ps1 b/RdzeN-Profile.ps1 index 94af08d..9a14e03 100644 --- a/RdzeN-Profile.ps1 +++ b/RdzeN-Profile.ps1 @@ -45,9 +45,10 @@ Get-ChildItem $path_gitea_powershell_profile_functions | ForEach-Object { . $_.FullName } -# 97. Test Profile +# 4. Test Profile Test-Profile -# 98. Override Profile +# 5. Override Profile Override-Profile -# 99. Reload Profile -Reload-Profile \ No newline at end of file +# 6. Reload Profile +Reload-Profile + diff --git a/functions/prompt.ps1 b/functions/prompt.ps1 new file mode 100644 index 0000000..7e93658 --- /dev/null +++ b/functions/prompt.ps1 @@ -0,0 +1,32 @@ +function prompt +{ + Write-Host "[" -NoNewline -ForegroundColor Blue + Write-Host "PS" -NoNewline -ForegroundColor Cyan + Write-Host "]" -NoNewline -ForegroundColor Blue + Write-Host " " -NoNewline -ForegroundColor Black + Write-Host "[" -NoNewline -ForegroundColor Blue + Write-Host "$(get-date -Format "yyyy-MM-dd HH:mm:ss")" -NoNewline -ForegroundColor Cyan + Write-Host "]" -NoNewline -ForegroundColor Blue + Write-Host " " -NoNewline -ForegroundColor Black + Write-Host "[" -NoNewline -ForegroundColor Blue + Write-Host "$Env:USERNAME" -NoNewline -ForegroundColor Cyan + Write-Host "@" -NoNewline -ForegroundColor Blue + Write-Host "$env:COMPUTERNAME" -NoNewline -ForegroundColor Cyan + Write-Host "]" -NoNewline -ForegroundColor Blue + Write-Host " " -NoNewline -ForegroundColor Black + Write-Host "[" -NoNewline -ForegroundColor Blue + Write-Host "$($PWD)" -NoNewline -ForegroundColor Cyan + Write-Host "]" -NoNewline -ForegroundColor Blue + Write-Host "" + + Write-Host "[" -NoNewline -ForegroundColor Blue + Write-Host "PS" -NoNewline -ForegroundColor Cyan + Write-Host "]" -NoNewline -ForegroundColor Blue + + Write-Host " " -NoNewline -ForegroundColor Black + Write-Host "$('>' * ($nestedPromptLevel + 1))" -NoNewline -ForegroundColor Cyan + + # .Link + # https://go.microsoft.com/fwlink/?LinkID=225750 + # .ExternalHelp System.Management.Automation.dll-help.xml +} \ No newline at end of file