Skip to content

Instantly share code, notes, and snippets.

@jamescurran
Created August 13, 2022 10:35
Show Gist options
  • Save jamescurran/3110a8dfbb1ba85a6e5f6de41c7edbdd to your computer and use it in GitHub Desktop.
Save jamescurran/3110a8dfbb1ba85a6e5f6de41c7edbdd to your computer and use it in GitHub Desktop.
function global:prompt {
$Success = $?
Write-Host -Object $pwd -ForegroundColor Magenta
$date = Get-Date -Format "dd-MMM-yyyy HH:mm:ss"
Write-Host -Object $date -ForegroundColor Green
$quote = get-content "C:\Users\zames\OneDrive\Documents\times\$(Get-Date -Format "HH_mm").json" | ConvertFrom-Json | Get-random
Write-Host -Object $quote.Quote_first.Replace("<br>", "`n") -ForegroundColor Blue -NoNewLine
Write-Host -Object $quote.Quote_time_case -ForegroundColor Yellow -NoNewLine
Write-Host -Object $quote.Quote_last.Replace("<br>", "`n") -ForegroundColor Blue -NoNewLine
$author = $quote.Author
$source = $quote.Title
Write-Host -Object " ($author, '$source')" -ForegroundColor Cyan
return "> "
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment