Skip to content

Instantly share code, notes, and snippets.

View MaxMelcher's full-sized avatar
🏠
Working from home

Max Melcher MaxMelcher

🏠
Working from home
View GitHub Profile
@amandadebler
amandadebler / PowerShell Prompt.ps1
Last active March 12, 2019 22:28 — forked from fatherjack/PowerShell Prompt.ps1
Two-line prompt with last command execution time and tail of present working directory - modification of FatherJack's prompt, which was inspired by FriedrichWeinmann
function Prompt {
try {
$history = Get-History -ErrorAction Ignore -Count 1
if ($history) {
$ts = New-TimeSpan $history.StartExecutionTime $history.EndExecutionTime
Write-Host "[" -NoNewline
switch ($ts) {
{$_.TotalSeconds -lt 1} {
[decimal]$d = $_.TotalMilliseconds