Created
June 9, 2025 10:48
-
-
Save ullaskunder3/3adb4665b85920bebe51da2816f8ed28 to your computer and use it in GitHub Desktop.
My Custom PowerShell 7 Prompt - 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $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