From 32dc6a40498a513720a836a9fca6d2ae1a98e082 Mon Sep 17 00:00:00 2001 From: F-park <52167622+F-park@users.noreply.github.com> Date: Sat, 20 Jul 2024 23:08:17 +0800 Subject: [PATCH] refactor(module): update alias --- module/PSCompletions.psm1 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/module/PSCompletions.psm1 b/module/PSCompletions.psm1 index 1095532..75f5897 100644 --- a/module/PSCompletions.psm1 +++ b/module/PSCompletions.psm1 @@ -262,9 +262,7 @@ function PSCompletions { if ($alias -like "* *") { $alias = ($alias -split ' ')[0] } - $exist_cmd = (Get-Command).Name | Where-Object { $alias -eq $_ } - $exist_alias = (Get-Alias).Name | Where-Object { $alias -eq $_ } - if ($exist_cmd -or $exist_alias) { + if ($alias -in (Get-Alias).Name -or $alias -in (Get-Command).Name) { Show-ParamError 'err' '' $PSCompletions.info.alias.add.err.cmd_exist return }