Showing posts with label PowerShell. Show all posts
Showing posts with label PowerShell. Show all posts

Sep 15, 2023

Windows 11 : Built-In Apps that can be Remove

Windows 11 comes bundled with a some Apps that may or may not be needed in a Corporate environment, these may include App such as Xbox, Video Editor etc.

But removing all those unnecessary Apps maybe troublesome, and worst breaking the "SysPrep" function and further preventing for a mass deployment.

Below are the few Apps that can be removed safely without breaking "SysPrep" functionality. You will need to remove script lines for App(s) that you want to retain.

Copy and save the file as PowerShell Script (.ps1).

 

Write-Host
Write-Host
Write-Host "**************************"
Write-Host "* Removing Appx Packages *"
Write-Host "**************************"
Write-Host
Write-Host "Removing Zune Video..."
Get-AppxPackage -AllUsers *ZuneVideo* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Zune Music..."
Get-AppxPackage -AllUsers *ZuneMusic* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Microsoft Your Phone..."
Get-AppxPackage -AllUsers *YourPhone* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Xbox Speech..."
Get-AppxPackage -AllUsers *XboxSpeech* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Xbox Identity..."
Get-AppxPackage -AllUsers *XboxIdentity* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Xbox Gaming Overlay..."
Get-AppxPackage -AllUsers *XboxGamingOverlay* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Xbox Game Overlay..."
Get-AppxPackage -AllUsers *XboxGameOverlay* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Xbox App..."
Get-AppxPackage -AllUsers *XboxApp* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Xbox TCUI..."
Get-AppxPackage -AllUsers *Xbox.TCUI* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Windows Maps..."
Get-AppxPackage -AllUsers *WindowsMaps* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Windows Feedback Hub..."
Get-AppxPackage -AllUsers *WindowsFeedbackHub* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Windows Communications Apps..."
Get-AppxPackage -AllUsers *windowscommunicationsapps* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Windows Alarms..."
Get-AppxPackage -AllUsers *WindowsAlarms* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Microsoft People..."
Get-AppxPackage -AllUsers *Microsoft.People* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Solitaire Collection..."
Get-AppxPackage -AllUsers *MicrosoftSolitaireCollection* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Office Hub..."
Get-AppxPackage -AllUsers *MicrosoftOfficeHub* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Windows Get Started..."
Get-AppxPackage -AllUsers *GetStarted* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Windows Get Help..."
Get-AppxPackage -AllUsers *GetHelp* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Bing Weather..."
Get-AppxPackage -AllUsers *BingWeather* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Microsoft Gaming App..."
Get-AppxPackage -AllUsers *GamingApp* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Microsoft Bing News..."
Get-AppxPackage -AllUsers *BingNews* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Microsoft Teams App..."
Get-AppxPackage -AllUsers *MicrosoftTeams* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Microsoft To Dos App..."
Get-AppxPackage -AllUsers *Microsoft.Todos* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Microsoft Power Automate Desktop App..."
Get-AppxPackage -AllUsers *Microsoft.PowerAutomateDesktop* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Microsoft ClipChamp App..."
Get-AppxPackage -AllUsers *Clipchamp* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host "Removing Microsoft Windows Terminal App..."
Get-AppxPackage -AllUsers *WindowsTerminal* | Remove-AppxPackage
Start-Sleep -s 5
Write-Host
Write-Host "Uninstallation of AppxPackages Completed."
Start-Sleep -s 5 
Write-Host
Write-Host
Write-Host "**************************************"
Write-Host "* Removing Appx Provisioned Packages *"
Write-Host "**************************************"
Write-Host
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Zune Video..."
Remove-AppxProvisionedPackage -Online -PackageName Microsoft.ZuneVideo_2019.22091.10041.0_neutral_~_8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Zune Music..."
Remove-AppxProvisionedPackage -Online -PackageName Microsoft.ZuneMusic_11.2305.4.0_neutral_~_8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Microsoft Your Phone..."
Remove-AppxProvisionedPackage -Online -PackageName Microsoft.YourPhone_1.22022.147.0_neutral_~_8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Xbox Speech..."
Remove-AppxProvisionedPackage -Online -PackageName Microsoft.XboxSpeechToTextOverlay_1.17.29001.0_neutral_~_8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Xbox Identity..."
Remove-AppxProvisionedPackage -Online -PackageName Microsoft.XboxIdentityProvider_12.50.6001.0_neutral_~_8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Xbox Gaming Overlay..."
Remove-AppxProvisionedPackage -Online -PackageName Microsoft.XboxGamingOverlay_2.622.3232.0_neutral_~_8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Xbox Game Overlay..."
Remove-AppxProvisionedPackage -Online -PackageName Microsoft.XboxGameOverlay_1.47.2385.0_neutral_~_8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Xbox TCUI..."
Remove-AppxProvisionedPackage -Online -PackageName Microsoft.Xbox.TCUI_1.23.28004.0_neutral_~_8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Windows Maps..."
Remove-AppxProvisionedPackage -Online -PackageName Microsoft.WindowsMaps_2022.2202.6.0_neutral_~_8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Windows Feedback Hub..."
Remove-AppxProvisionedPackage -Online -PackageName Microsoft.WindowsFeedbackHub_2022.106.2230.0_neutral_~_8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Windows Communications Apps..."
Remove-AppxProvisionedPackage -Online -PackageName microsoft.windowscommunicationsapps_16005.14326.20544.0_neutral_~_8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Windows Alarms..."
Remove-AppxProvisionedPackage -Online -PackageName Microsoft.WindowsAlarms_2022.2202.24.0_neutral_~_8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Microsoft People..."
Remove-AppxProvisionedPackage -Online -PackageName Microsoft.People_2020.901.1724.0_neutral_~_8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Solitaire Collection..."
Remove-AppxProvisionedPackage -Online -PackageName Microsoft.MicrosoftSolitaireCollection_4.12.3171.0_neutral_~_8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Office Hub..."
Remove-AppxProvisionedPackage -Online -PackageName Microsoft.MicrosoftOfficeHub_18.2204.1141.0_neutral_~_8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Windows Get Started..."
Remove-AppxProvisionedPackage -Online -PackageName Microsoft.Getstarted_2021.2204.1.0_neutral_~_8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Windows Get Help..."
Remove-AppxProvisionedPackage -Online -PackageName Microsoft.GetHelp_10.2201.421.0_neutral_~_8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Bing Weather..."
Remove-AppxProvisionedPackage -Online -PackageName Microsoft.BingWeather_4.53.33420.0_neutral_~_8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Microsoft Gaming App..."
Remove-AppxProvisionedPackage -Online -PackageName Microsoft.GamingApp_2021.427.138.0_neutral_~_8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Microsoft Bing News..."
Remove-AppxProvisionedPackage -Online -PackageName Microsoft.BingNews_4.2.27001.0_neutral_~_8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Microsoft Teams..."
Remove-AppxProvisionedPackage -Online -PackageName MicrosoftTeams_23231.411.2342.9597_x64__8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Microsoft Power Automate Desktop App..."
Remove-AppxProvisionedPackage -Online -PackageName Microsoft.PowerAutomateDesktop_10.0.3735.0_neutral_~_8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Microsoft ClipChamp App..."
Remove-AppxProvisionedPackage -Online -PackageName Clipchamp.Clipchamp_2.2.8.0_neutral_~_yxz26nhyzhsrt
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Microsoft To Dos App..."
Remove-AppxProvisionedPackage -Online -PackageName Microsoft.Todos_2.54.42772.0_neutral_~_8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host "Removing AppxProvisioned Microsoft Windows Terminal App..."
Remove-AppxProvisionedPackage -Online -PackageName Microsoft.WindowsTerminal_3001.12.10983.0_neutral_~_8wekyb3d8bbwe
Start-Sleep -s 5
Write-Host
Write-Host
Write-Host "*******************************************************"
Write-Host "* Uninstallation of AppxProvisionedPackage Completed. *"
Write-Host "*******************************************************"
Start-Sleep -s 5
EXIT

 

 


!!! HAPPY COMPUTING !!!

Jan 6, 2023

PowerShell : Command Line

PowerShell Command for Windows 10 22H2. 

1) Enable/Install SMB v1 Client Protocol.

Enable-WindowsOptionalFeature -Online -FeatureName "SMB1Protocol-Clinet" -All


2) Mount ISO image file.

Mount-DiskImage -ImagePath "%ISO_FILE_PATH%"


3) Unmount/Eject ISO Image file.

Dismount-DiskImage -ImagePath "%ISO_FILE_PATH%"


4) To run a PowerShell Script File (.ps1) inside a Batch File.

POWERSHELL.EXE -NoProfile -ExecutionPolicy Bypass -Command "& {Start-Process PowerShell -ArgumentList '-NoProfile -ExecutionPolicy Bypass -File ""%POWERSHELL_SCRIPT_FILE%""' -Verb RunAs}"


!!! HAPPY COMPUTING !!!


Feb 5, 2017

Windows 10 - Remove Provisioned Apps

This is my second post about Windows 10 built-in apps (Provisioned Apps), some of us just don't like the built-in apps... just like the ridiculous Xbox apps which I find it to be best at hogging system resources.

Now my last post was to remove those built-in apps, but later I found it was still in Windows 10 when another user logged-in. After much googling and studying MSDN and TechNet, I found a powershell script and I wrote some sample of my own.

First of all, you still need to run the previous powershell script to ensure that all users are not provisioned with the built-in apps, just in case I have re-posted those script here for your references.


Get-AppxPackage -allusers *3dbuilder* | Remove-AppxPackage
Get-AppxPackage -allusers *windowsalarms* | Remove-AppxPackage
Get-AppxPackage -allusers *zunevideo* | Remove-AppxPackage
Get-AppxPackage -allusers *officehub* | Remove-AppxPackage
Get-AppxPackage -allusers *skypeapp* | Remove-AppxPackage
Get-AppxPackage -allusers *getstarted* | Remove-AppxPackage
Get-AppxPackage -allusers *zunemusic* | Remove-AppxPackage
Get-AppxPackage -allusers *solitairecollection* | Remove-AppxPackage
Get-AppxPackage -allusers *bingfinance* | Remove-AppxPackage
Get-AppxPackage -allusers *bingnews* | Remove-AppxPackage
Get-AppxPackage -allusers *people* | Remove-AppxPackage
Get-AppxPackage -allusers *windowsphone* | Remove-AppxPackage
Get-AppxPackage -allusers *commsphone* | Remove-AppxPackage
Get-AppxPackage -allusers *bingsports* | Remove-AppxPackage
Get-AppxPackage -allusers *windowsstore* | Remove-AppxPackage
Get-AppxPackage -allusers *bingweather* | Remove-AppxPackage
Get-AppxPackage -allusers *xboxapp* | Remove-AppxPackage
Get-AppxPackage -allusers *twitter* | Remove-AppxPackage
Get-AppxPackage -allusers *office.sway* | Remove-AppxPackage
Get-AppxPackage -allusers *xboxonesmartglass* | Remove-AppxPackage
Get-AppxPackage -allusers *messaging* | Remove-AppxPackage

Note : You can choose which apps you want to retain back. 

After you have completed the above script, now you can run the 2nd script as below, also you can choose which apps you want to retain back.


Remove-AppxProvisionedPackage -online -packagename Microsoft.3DBuilder_11.0.47.0_neutral_~_8wekyb3d8bbwe
Remove-AppxProvisionedPackage -online -packagename Microsoft.BingWeather_4.9.51.0_neutral_~_8wekyb3d8bbwe
Remove-AppxProvisionedPackage -online -packagename Microsoft.Getstarted_3.11.3.0_neutral_~_8wekyb3d8bbwe
Remove-AppxProvisionedPackage -online -packagename Microsoft.Messaging_2.7.1001.0_neutral_~_8wekyb3d8bbwe
Remove-AppxProvisionedPackage -online -packagename Microsoft.MicrosoftOfficeHub_2015.6801.23751.0_neutral_~_8wekyb3d8bbwe
Remove-AppxProvisionedPackage -online -packagename Microsoft.MicrosoftSolitaireCollection_3.9.5100.0_neutral_~_8wekyb3d8bbwe
Remove-AppxProvisionedPackage -online -packagename Microsoft.Office.OneNote_2015.6868.57981.0_neutral_~_8wekyb3d8bbwe
Remove-AppxProvisionedPackage -online -packagename Microsoft.OneConnect_1.1605.17.0_neutral_~_8wekyb3d8bbwe
Remove-AppxProvisionedPackage -online -packagename Microsoft.People_2016.709.155.0_neutral_~_8wekyb3d8bbwe
Remove-AppxProvisionedPackage -online -packagename Microsoft.People_2016.709.155.0_neutral_~_8wekyb3d8bbwe
Remove-AppxProvisionedPackage -online -packagename Microsoft.SkypeApp_11.4.86.0_neutral_~_kzf8qxf38zg5c
Remove-AppxProvisionedPackage -online -packagename Microsoft.StorePurchaseApp_1.0.454.0_neutral_~_8wekyb3d8bbwe
Remove-AppxProvisionedPackage -online -packagename Microsoft.WindowsAlarms_2016.622.2118.0_neutral_~_8wekyb3d8bbwe
Remove-AppxProvisionedPackage -online -packagename microsoft.windowscommunicationsapps_2015.6868.41201.0_neutral_~_8wekyb3d8bbwe
Remove-AppxProvisionedPackage -online -packagename Microsoft.WindowsFeedbackHub_1.3.1741.0_neutral_~_8wekyb3d8bbwe
Remove-AppxProvisionedPackage -online -packagename Microsoft.WindowsMaps_2016.701.2235.0_neutral_~_8wekyb3d8bbwe
Remove-AppxProvisionedPackage -online -packagename Microsoft.WindowsStore_11606.1001.394.0_neutral_~_8wekyb3d8bbwe
Remove-AppxProvisionedPackage -online -packagename Microsoft.XboxApp_2016.623.248.0_neutral_~_8wekyb3d8bbwe
Remove-AppxProvisionedPackage -online -packagename Microsoft.XboxIdentityProvider_2016.616.818.0_neutral_~_8wekyb3d8bbwe
Remove-AppxProvisionedPackage -online -packagename Microsoft.ZuneMusic_2019.6.19261.0_neutral_~_8wekyb3d8bbwe
Remove-AppxProvisionedPackage -online -packagename Microsoft.ZuneVideo_2019.6.19281.0_neutral_~_8wekyb3d8bbwe

 
After completion, you just need to restart the computer. Please be aware that if an apps was still provisioned to a user, you cannot remove that apps. As such it is important that you ensure no users is still requiring that apps before removing.

I find this to be useful especially when you want to create a consistent operating environment (COE) for a corporate/enterprise system.

!!! HAPPY SCRIPTING !!!
!!! HAPPY CHINESE NEW YEAR !!!

Apr 17, 2016

Windows 10 - Create & Run PowerShell Script

In one of my previous post where I've shown on how to remove/uninstall Windows 10 built-in apps, now it's time to create your own PowerShell script to run all those command automatically.

Imagine you need to do this everytime you performed a new installation, well if 1-2 system then it might be OK with..... how about 10-50 systems ? I surely will want to do this automatically.

Of course firstly you need to create the script first then save it and run it at a later stage.

1. Open --> PowerShell ISE.



2. You will see a new application opened.



3. Create your script in the right pane as shown.


For easy reference, you just need to copy & paste the following cmdlet into the pane. You may remove any cmdlet as you deem fits your requirements.


Get-AppxPackage -AllUsers *3dbuilder* | Remove-AppxPackage
Get-AppxPackage -AllUsers *windowsalarms* | Remove-AppxPackage
Get-AppxPackage -AllUsers *zunevideo* | Remove-AppxPackage
Get-AppxPackage -AllUsers *officehub* | Remove-AppxPackage
Get-AppxPackage -AllUsers *skypeapp* | Remove-AppxPackage
Get-AppxPackage -AllUsers *getstarted* | Remove-AppxPackage
Get-AppxPackage -AllUsers *zunemusic* | Remove-AppxPackage
Get-AppxPackage -AllUsers *solitairecollection* | Remove-AppxPackage
Get-AppxPackage -AllUsers *bingfinance* | Remove-AppxPackage
Get-AppxPackage -allusers *bingnews* | Remove-AppxPackage
Get-AppxPackage -AllUsers *people* | Remove-AppxPackage
Get-AppxPackage -AllUsers *windowsphone* | Remove-AppxPackage
Get-AppxPackage -AllUsers *commsphone* | Remove-AppxPackage
Get-AppxPackage -AllUsers *photos* | Remove-AppxPackage
Get-AppxPackage -AllUsers *bingsports* | Remove-AppxPackage
Get-AppxPackage -AllUsers *windowsstore* | Remove-AppxPackage
Get-AppxPackage -AllUsers *bingweather* | Remove-AppxPackage
Get-AppxPackage -AllUsers *xboxapp* | Remove-AppxPackage
Get-AppxPackage -AllUsers *twitter* | Remove-AppxPackage
Get-AppxPackage -AllUsers *office.sway* | Remove-AppxPackage
Get-AppxPackage -AllUsers *xboxonesmartglass* | Remove-AppxPackage
Get-AppxPackage -AllUsers *messaging* | Remove-AppxPackage
Get-AppxPackage -AllUsers *windowscommunicationsapps* | Remove-AppxPackage
Get-AppxPackage -AllUsers *windowscamera* | Remove-AppxPackage
Get-AppxPackage -AllUsers *windowsmaps* | Remove-AppxPackage
Get-AppxPackage -AllUsers *soundrecorder* | Remove-AppxPackage
Get-AppxPackage -AllUsers *onenote* | Remove-AppxPackage
Get-AppxPackage -AllUsers *windowsscan* | Remove-AppxPackage
Get-AppxPackage -AllUsers *windowscalculator* | Remove-AppxPackage


4. Now save the newly created script to your preferred location, also you need to ensure the file extension is ".ps1" before saving it.



5. Now you must run --> PowerShell with "administrator" rights by right-click --> Run as administrator option as shown below.



6. Note the "Administrator" level is shown on the top left corner of the windows.



7. As my script file was save in [D:] folder, so must first change the working directory first, your folder maybe different from mine. Proper path is required.



8. Now type the script's filename as shown below and press --> [ENTER] key.



9. You will definitely encounter this error, don't worry as this is normal. This is because the "PowerShell Execution Policy" prevents any unauthorised scripts from running as security measures, which I very much like this idea (even though some find it troublesome).



10. Now type this cmdlet --> Get-ExecutionPolicy --> [ENTER]. It will display the current status of the policy, note the "Restricted" level as shown below screen.



11. Now to change it type the following cmdlet --> Set-ExecutionPolicy Unrestricted --> [ENTER], this will change the level to "Unrestricted" which will allows you to run the script. When prompted just type --> "A" key --> [ENTER] to continue.



12. Type the script filename again and this time you should be able to run it without any error message, if successful you should be able to see the below screen. This will takes some times to complete so be patience.



13. Once completed, you might want to change back the policy back to "Restricted" as security measure, just type --> Set-ExecutionPolicy Restricted --> [ENTER] key.



14. To really do this automatically, you will need to create a batch file to first change the policy level, then run the script and finally change back the policy to default level.

For that will be another posting coming soon.

HAPPY CODING !!!