modified: functions/prompt.ps1
This commit is contained in:
parent
f0805aa6a6
commit
0b2e31d373
@ -1,35 +1,10 @@
|
|||||||
# gitea.RdzeN.net
|
# gitea.RdzeN.net
|
||||||
#
|
#
|
||||||
# custom prompt for PS.
|
# custom prompt for PS.
|
||||||
function prompt
|
function Prompt {
|
||||||
{
|
$currentTime = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
|
||||||
Write-Host "[" -NoNewline -ForegroundColor Blue
|
$userName = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name
|
||||||
Write-Host "PS" -NoNewline -ForegroundColor Cyan
|
$hostName = $env:COMPUTERNAME
|
||||||
Write-Host "]" -NoNewline -ForegroundColor Blue
|
$currentLocation = Get-Location
|
||||||
Write-Host " " -NoNewline -ForegroundColor Black
|
"[PS] [$currentTime] [$userName@$hostName] [$currentLocation]`n[PS] > "
|
||||||
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.ProviderPath)" -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
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user