在宅勤務が続いて曜日感覚がなくなってきたので、プロンプトで曜日感覚を取り戻そうと思います。
サンプル
prompt
Microsoft.PowerShell_profile.ps1
function prompt {
$table = @(
@("日", "DarkYellow", "White"),
@("月", "DarkBlue", "White"),
@("火", "Magenta", "Gray"),
@("水", "DarkCyan", "White"),
@("木", "Green", "White"),
@("金", "Yellow", "DarkGray"),
@("土", "Cyan", "White")
)
$today = $table[[System.Convert]::toint32((Get-Date).DayOfWeek)]
$leaf = $pwd.Path | Split-Path -Leaf
Write-Host ("{0}[{1}]" -f (Get-Date -Format "yyyy-MM-dd"), $today[0]) -NoNewline -BackgroundColor $today[1] -ForegroundColor $today[2]
Write-Host "~\$leaf" -ForegroundColor $today[1] -BackgroundColor $today[2]
Write-Host ">" -NoNewline
return " "
}