modified: RdzeN-Profile.ps1

new file:   functions/prompt.ps1
This commit is contained in:
Tomasz Kostrzewa 2024-03-05 20:57:59 +01:00
parent 83836cebf9
commit 7a95abaf92
2 changed files with 37 additions and 4 deletions

View File

@ -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
# 6. Reload Profile
Reload-Profile

32
functions/prompt.ps1 Normal file
View File

@ -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
}