prevent multiple packages from getting returned

This commit is contained in:
2024-01-04 08:51:49 -05:00
parent ff522d1e79
commit 5b43b97ce2
+1 -1
View File
@@ -55,7 +55,7 @@ If ( IsWindowsBuild -ge 9200 )
ForEach ( $App in $AppList ) { ForEach ( $App in $AppList ) {
# Get the full name for the package and provisioned package # Get the full name for the package and provisioned package
$PackageFullName = $($(Get-AppxPackage $App).PackageFullName) $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 the package exists, uninstall it
If ($PackageFullName) { If ($PackageFullName) {