From 1fe43a2b869982f26707d9ae62c691d85fb52ef5 Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Tue, 4 Aug 2020 11:49:42 +0800 Subject: [PATCH] [bugfix] powershell6 does not support Set-Prompt --- win/profile.ps1 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/win/profile.ps1 b/win/profile.ps1 index 9bf69cb..d8d3139 100644 --- a/win/profile.ps1 +++ b/win/profile.ps1 @@ -6,7 +6,10 @@ Set-PSReadLineOption -EditMode Emacs $Env:Path += ";$PSScriptRoot\bin" Set-Alias -Name k kubectl -Set-Prompt +$isPs7 = $host.Version.Major -ge 7 +if ( $isPs7 ) { + Set-Prompt +} function kcc { k config get-contexts $args } function kcu { k config use-context $args} @@ -70,4 +73,4 @@ function ssh-copy-id { ) Get-Content $IdentityFile | ssh $UserHost "umask 077; mkdir -p .ssh ; cat >> .ssh/authorized_keys" -} \ No newline at end of file +}