From b936554abed7f29f745a1c12f2bdb6c46993f7e9 Mon Sep 17 00:00:00 2001 From: Thomas Nieto <38873752+ThomasNieto@users.noreply.github.com> Date: Fri, 19 Apr 2024 13:39:48 -0500 Subject: [PATCH] Fix aliased Scoop (#10) --- src/Scoop.psm1 | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/Scoop.psm1 b/src/Scoop.psm1 index b43ecfd..81e5e75 100644 --- a/src/Scoop.psm1 +++ b/src/Scoop.psm1 @@ -40,11 +40,16 @@ function Find-ScoopApp { ) begin { - $bucketPath = Get-Command -Name Scoop | - Select-Object -ExpandProperty Path | - Split-Path | - Split-Path | - Join-Path -ChildPath buckets + try { + $bucketPath = Get-Command -Name Scoop -CommandType ExternalScript -ErrorAction Stop | + Select-Object -ExpandProperty Path | + Split-Path | + Split-Path | + Join-Path -ChildPath buckets + } + catch { + throw $_ + } } process {