Script I use to remove various things before I image a clean install

  • 14 October 2020
  • 0 replies

#Set-up script to remove apps and enable/disable features.

#Creates a logfile in C:

Start-Transcript -Path C:\SetupLog.txt -NoClobber

#List of apps to remove. May be ammended in the future.

#Please Note: Do Not Remove the Windows Store App. This will cause problems.

$AppsToRemove = @( “Microsoft3DViewer”
























#This is the main loop that removes the programs specified.

#It removes the apps from the current user and from provisioned packages preventing them from being

#installed when a new user profile is created, such as when a domain user logs into a new computer.

ForEach($App in $AppsToRemove){

Get-AppxPackage -AllUsers | ? Name -Like “$App” | Remove-AppxPackage

Get-AppxProvisionedPackage -Online | ? DisplayName -Like “$App” | Remove-AppxProvisionedPackage -Online


#This section ensures that System Restore is active on the C:\ drive and creates a restore point

#after all changes are made. Please leave this as the last section.

Enable-ComputerRestore -Drive “C:”

CheckPoint-Computer -Description “Initial Installation” -RestorePointType APPLICATION_INSTALL

#Ends logging


0 replies

Be the first to reply!