0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

PowerShell(Core)でコマンドプロンプトを短く表示する例

Last updated at Posted at 2020-02-20

ドキュメントフォルダ配下にPowerShellフォルダを作成し以下のファイルを作成する。

Microsoft.PowerShell_profile.ps1
function prompt() {
    $Parent = Split-Path -Path (Split-Path -Path (Get-Location) -Parent) -Leaf
    $Leaf = Split-Path -Path (Get-Location) -Leaf
    "PS6:" + $Parent + "\" + $Leaf + "> "
}

コマンドのエイリアスを設定する例(おまけ)

Microsoft.PowerShell_profile.ps1
Set-Alias -Name which -Value get-command
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?