Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function prompt {
- [string]$TimeString = (Get-History -Count 1).ElapsedTime
- while ($TimeString -match '\A00([-:]|\z)') { $TimeString = $TimeString -replace '\A00([-:]|\z)' }
- if ($TimeString) { Write-Host "$TimeString " -NoNewline -ForegroundColor Red }
- Write-Host ($executionContext.SessionState.Path.CurrentLocation.Path -replace '(.+?\\.+?\\).+?(\\[^\\]*)\z', '$1...$2') -NoNewline -ForegroundColor Cyan
- Write-Host ('>' * ($NestedPromptLevel + 1)) -NoNewline -ForegroundColor Gray
- return " "
- } # prompt
- Update-TypeData -Force -TypeName Microsoft.PowerShell.Commands.HistoryInfo -MemberType ScriptProperty -MemberName ElapsedTime -Value {
- ([timespan]($this.EndExecutionTime - $this.StartExecutionTime)).ToString('dd\-hh\:mm\:ss')
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement