User Profile
MB_Smith
Iron Contributor
Joined 9 years ago
User Widgets
Recent Discussions
Re: Windows 10 deboat
You really shouldn't change the ExecutionPolicy at the end of the script. Executing PowerShell with the "-ExecutionPolicy Bypass" does NOT update the registry value for ExecutionPolicy. Also, you should look for specific displaynames that you are keeping. "*store*" is overly generic. 'Microsoft.StorePurchaseApp' and 'Microsoft.WindowsStore' are the two displaynames that need to be retained. Lastly, I think you should have a "noGUI" option so that this could be used in a scheduled task or in a deployment sequence.1.3KViews0likes0CommentsRe: Find app installed in PC
As Vasil wrote, don't use PackageFullname. Use DisplayName. Here is a script I run during computer deployment: [CmdletBinding()] Param() ## ## Remove everything but StickyNotes, Paint, Photos, Calc ## ## Michael B. Smith ## April 4, 2018 ## michael@smithcons.com ## ## No warranties, etc. etc. ## ## Somewhat based on ## https://gal.vin/2017/04/06/removing-uwp-apps-mdt/ ## ## But do NOT do a 'Get-AppxPackage | Remove-AppxPackage -AllUsers'. ## You will break Windows. ## ## The initial posting on this topic from Michael Niehaus in 2015: ## https://blogs.technet.microsoft.com/mniehaus/2015/11/11/removing-windows-10-in-box-apps-during-a-task-sequence/ ## $keepers = @( 'Microsoft.MicrosoftStickyNotes', 'Microsoft.MSPaint', 'Microsoft.Windows.Photos', 'Microsoft.WindowsCalculator', 'Microsoft.StorePurchaseApp', 'Microsoft.WindowsStore' ) $packages = Get-AppxProvisionedPackage -Online foreach( $package in $packages ) { if( $keepers -contains $package.DisplayName ) { Write-Verbose "Will NOT remove $( $package.DisplayName )" } else { Write-Verbose "WILL remove $( $package.DisplayName )" Write-Verbose "PackageFullName $( $package.PackageName )" Remove-AppxPackage -Package $package.PackageName -AllUsers -Verbose Remove-AppxProvisionedPackage -Online -PackageName $package.PackageName -Verbose -ErrorAction SilentlyContinue } } $packages = $null4KViews0likes0Comments
Recent Blog Articles
No content to show