File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -123,13 +123,20 @@ Default is 32767
123123[Parameter (ParameterSetName = ' Fail' )]
124124[switch ] $Fail
125125)
126+
126127function Set-ResolvedAlias ([Parameter (Position = 0 )][string ]$Name , [Parameter (Position = 1 )][string ]$Path )
127128{
128129 Set-Alias $Name (Resolve-Path $Path - EA SilentlyContinue | Select-Object - ExpandProperty Path | Find-NewestFile.ps1 |
129130 Select-Object - ExpandProperty FullName) - Scope Global
130131}
131132if ((Get-Command $Name - ErrorAction Ignore)) { Write-Verbose " $Name command found." ; return }
132133if ($Path -and (Test-Path $Path )) { Set-ResolvedAlias $Name $Path ; return }
134+ if ((! $IsWindows ) -and $IsLinux )
135+ {
136+ if (Get-Command / usr/ lib/ command- not- found - Type Application) { / usr/ lib/ command- not- found $Name }
137+ elseif (Get-Command apropos - Type Application) { apropos $Name }
138+ Stop-ThrowError.ps1 " Command '$Name ' not available!" - SearchContext $Name
139+ }
133140
134141switch ($PSCmdlet.ParameterSetName )
135142{
You can’t perform that action at this time.
0 commit comments