From 5b43b97ce226a9d05d69893c4c7da17d7a5e0c61 Mon Sep 17 00:00:00 2001 From: David Yoder Date: Thu, 4 Jan 2024 08:51:49 -0500 Subject: [PATCH] prevent multiple packages from getting returned --- Uninstall-UnwantedDefaultApps.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Uninstall-UnwantedDefaultApps.ps1 b/Uninstall-UnwantedDefaultApps.ps1 index 1a5479c..4b8122f 100644 --- a/Uninstall-UnwantedDefaultApps.ps1 +++ b/Uninstall-UnwantedDefaultApps.ps1 @@ -55,7 +55,7 @@ If ( IsWindowsBuild -ge 9200 ) ForEach ( $App in $AppList ) { # Get the full name for the package and provisioned package $PackageFullName = $($(Get-AppxPackage $App).PackageFullName) - $ProPackageFullName = $($(Get-AppxProvisionedPackage -Online | Where-Object {$_.Displayname -eq $App}).PackageName) + $ProPackageFullName = $($(Get-AppxProvisionedPackage -Online | Where-Object {$_.Displayname -eq $App}).PackageName | Select-Object -First 1) # If the package exists, uninstall it If ($PackageFullName) {