I'm new to using PCs and I'm trying to remove some pre-installed software, specifically Microsoft Bing News. I attempted to run a command in PowerShell: `Get-AppxPackage -online | where-object {$_.displayname -like "*Microsoft.Bingnews*"}`, but I'm getting an error regarding the online parameter. I know there are scripts available, but I want to familiarize myself with PowerShell. I've looked for guidance on the Microsoft website, but I'm having a hard time understanding it. Any help would be greatly appreciated!
2 Answers
I've had success removing unwanted apps too! I found it easiest to loop through a list of packages I wanted to remove. If you're just playing around, try this example: `$packages = @("*Microsoft.BingNews*", "*Microsoft.XboxApp*"); foreach ($pkg in $packages) { $app = Get-AppxPackage -Name $pkg -ErrorAction SilentlyContinue; if ($app) { Remove-AppxPackage $app } }`. This approach is great for beginners as it lays out how the loops work! Just make sure you adjust the package names as needed.
Hey! It looks like you misunderstood the `Get-AppxPackage` command. You shouldn't use `-online`; it's not a valid parameter. Just try running `Get-AppxPackage | where-object {$_.name -like "*Microsoft.Bingnews*"}`. Once you get the package name, you can uninstall it with `Remove-AppxPackage -Package 'Microsoft.Bingnews'`. If you want a cleaner method, consider creating an array of packages to remove and using a foreach loop to iterate through them. But for now, this simpler method should work great for you!
Thanks for clarifying! I'll try that out!
This sounds super helpful! I'm going to give it a shot!