Skip to content

Instantly share code, notes, and snippets.

@ecormaksin
Last active January 31, 2023 01:27
Show Gist options
  • Select an option

  • Save ecormaksin/0bd3ee83a77a4ae8174ec2ab5453ddb3 to your computer and use it in GitHub Desktop.

Select an option

Save ecormaksin/0bd3ee83a77a4ae8174ec2ab5453ddb3 to your computer and use it in GitHub Desktop.
Windows Powershellのプロンプトをカスタマイズする
<#
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_prompts?view=powershell-7.2
以下の内容を保存する。
- Windows Powershell: `%USERPROFILE%\Documents\WindowsPowerShell\Profile.ps1`
- Powershell: `%USERPROFILE%\Documents\PowerShell\Profile.ps1`
- Visual Studio Code PowerShell Extension: `%USERPROFILE%\Documents\PowerShell\Microsoft.VSCode_profile.ps1`
#>
function prompt {
"`r`n`r`n$($executionContext.SessionState.Path.CurrentLocation)$(' ')`($(Get-Date -Format 'yyyy/MM/dd HH:mm:ss')`)`r`n$('>' * ($nestedPromptLevel + 1)) ";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment