diff --git a/PSProfile/Public/Power Tools/Open-Code.ps1 b/PSProfile/Public/Power Tools/Open-Code.ps1 index 61cde1a..bc4fdbe 100644 --- a/PSProfile/Public/Power Tools/Open-Code.ps1 +++ b/PSProfile/Public/Power Tools/Open-Code.ps1 @@ -118,12 +118,11 @@ function Open-Code { } } Process { + $codeCommand = @('code','code-insiders') if($WithInsiders) { - $code = (Get-Command code-insiders -All | Where-Object { $_.CommandType -notin @('Function','Alias') })[0].Source - } - if($null -eq $code){ - $code = (Get-Command code -All | Where-Object { $_.CommandType -notin @('Function','Alias') })[0].Source + $codeCommand = @('code-insiders','code') } + $code = (Get-Command $codeCommand -All | Where-Object { $_.CommandType -notin @('Function','Alias') })[0].Source if ($PSCmdlet.ParameterSetName -eq 'InputObject') { $collection.Add($InputObject) if ($PSBoundParameters.ContainsKey('Path')) {