Skip to content

Commit

Permalink
fix: use Remove-Item in alias removal to support Powershell < 6
Browse files Browse the repository at this point in the history
Signed-off-by: Chapman Pendery <[email protected]>
  • Loading branch information
cpendery committed Mar 15, 2024
1 parent 52f7703 commit 38a307c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion shell/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func generateShAliases(aliases *map[string]string) string {
func generatePowershellAliases(aliases *map[string]string) string {
builder := strings.Builder{}
for alias, cmd := range *aliases {
builder.WriteString(fmt.Sprintf("Remove-Alias '%s' -Force -ErrorAction SilentlyContinue\n", alias))
builder.WriteString(fmt.Sprintf("Remove-Item Alias:%s -Force -ErrorAction SilentlyContinue\n", alias))
builder.WriteString(fmt.Sprintf("function kaldo-%s() {\n%s $args\n}\n", alias, cmd))
builder.WriteString(fmt.Sprintf("Set-Alias -Name '%s' -Value 'kaldo-%s'\n\n", alias, alias))
}
Expand Down

0 comments on commit 38a307c

Please sign in to comment.