Skip to content

Instantly share code, notes, and snippets.

@ullaskunder3
Created June 9, 2025 10:48
Show Gist options
  • Select an option

  • Save ullaskunder3/3adb4665b85920bebe51da2816f8ed28 to your computer and use it in GitHub Desktop.

Select an option

Save ullaskunder3/3adb4665b85920bebe51da2816f8ed28 to your computer and use it in GitHub Desktop.
My Custom PowerShell 7 Prompt - 2025
$PSDefaultParameterValues['*:Encoding'] = 'utf8'
$OutputEncoding = [System.Text.Encoding]::UTF8
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
function prompt {
$hour = (Get-Date).Hour
$emoji = ""
$greeting = ""
if ($hour -ge 5 -and $hour -lt 12) {
$greeting = "おはよう Ohayo"
$emoji = "🌅"
} elseif ($hour -ge 14 -and $hour -lt 18) {
$greeting = "こんにちは Konnichiwa"
$emoji = "🌞"
} else {
$greeting = "こんばんは Konbanwa"
$emoji = "🌙"
}
$venv = $env:VIRTUAL_ENV
$venvName = if ($venv) { "($(Split-Path $venv -Leaf)) " } else { "" }
$folder = (Split-Path -Leaf (Get-Location))
Write-Host "$emoji $greeting ullas san" -ForegroundColor Cyan
Write-Host "$venvName" -ForegroundColor Red -NoNewline
Write-Host "$folder" -ForegroundColor Green -NoNewline
Write-Host "" -ForegroundColor Magenta -NoNewline
[System.Console]::ResetColor()
return " "
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment