major update to override Write-Output func
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# Make sure this script runs as admin
|
||||
#If ( IsAdmin -eq $false ) { LogMsg "This script can only be run as admin" ; Exit }
|
||||
#If ( IsAdmin -eq $false ) { Write-Output "This script can only be run as admin" ; Exit }
|
||||
|
||||
# This is the list of Windows 10 AppX app names that we'll try to uninstall
|
||||
$AppList = @(
|
||||
@@ -59,19 +59,19 @@ If ( IsWindowsBuild -ge 9200 )
|
||||
|
||||
# If the package exists, uninstall it
|
||||
If ($PackageFullName) {
|
||||
LogMsg “Removing package: ${PackageFullName}”
|
||||
Write-Output “Removing package: ${PackageFullName}”
|
||||
Try { Remove-AppxPackage -Package $PackageFullName }
|
||||
Catch { LogErr $_.Exception.Message }
|
||||
}
|
||||
|
||||
# If the provisioned package exists, uninstall it
|
||||
If ($ProPackageFullName) {
|
||||
LogMsg “Removing provisioned package: ${ProPackageFullName}”
|
||||
Write-Output “Removing provisioned package: ${ProPackageFullName}”
|
||||
Try { Remove-AppxProvisionedPackage -PackageName $ProPackageFullName -Online -AllUsers }
|
||||
Catch { LogErr $_.Exception.Message }
|
||||
}
|
||||
}
|
||||
} Else { LogMsg "Cannot remove Appx packages because this endpoint is not running Windows 8 or higher" }
|
||||
} Else { Write-Output "Cannot remove Appx packages because this endpoint is not running Windows 8 or higher" }
|
||||
|
||||
# Uninstall unwanted Dell apps
|
||||
'Dell*SupportAssist*', 'Dell Digital Delivery*' | Uninstall-MSI
|
||||
|
||||
Reference in New Issue
Block a user