Cogger

I0-Software-Modifications.ps1

Jun 13th, 2022
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ########################################################################################################################
  2. #=====[ Software ]=====#
  3. ########################################################################################################################
  4.  
  5. #=====[ Software Configuration ]=====#
  6. #Stops edge from taking over as the default .PDF viewer
  7. Write-Host('Stopping Edge from taking over as the default .PDF viewer') -Fore White
  8. # Identify the edge application class
  9. $Packages = "HKCU:SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\Repository\Packages"
  10. $edge = Get-ChildItem $Packages -Recurse -include "MicrosoftEdge"
  11.  
  12. # Specify the paths to the file and URL associations
  13. $FileAssocKey = Join-Path $edge.PSPath Capabilities\FileAssociations
  14. $URLAssocKey = Join-Path $edge.PSPath Capabilities\URLAssociations
  15.  
  16. # get the software classes for the file and URL types that Edge will associate
  17. $FileTypes = Get-Item $FileAssocKey
  18. $URLTypes = Get-Item $URLAssocKey
  19.  
  20. $FileAssoc = Get-ItemProperty $FileAssocKey
  21. $URLAssoc = Get-ItemProperty $URLAssocKey
  22.  
  23. $Associations = @()
  24. $Filetypes.Property | foreach {$Associations += $FileAssoc.$_}
  25. $URLTypes.Property | foreach {$Associations += $URLAssoc.$_}
  26.  
  27. # add registry values in each software class to stop edge from associating as the default
  28. foreach ($Association in $Associations)
  29.         {
  30.     $Class = Join-Path HKCU:SOFTWARE\Classes $Association
  31.     #if (Test-Path $class)
  32.     #   {write-host $Association}
  33.     # Get-Item $Class
  34.     Set-ItemProperty $Class -Name NoOpenWith -Value ""
  35.     Set-ItemProperty $Class -Name NoStaticDefaultVerb -Value ""
  36.         }
  37.  
  38.  
  39. Set-Content -Path 'C:\Automation\Choco.ps1' -Value {
  40.     # Zoom Download and Install
  41.     # choco install zoom -y
  42.     # Brave Download
  43.     choco install brave -y
  44.     # Parsec
  45.     choco install parsec -y
  46.     # Google Chrome Download and Install
  47.     choco install googlechrome -y
  48.     # Notepad++ Download and Install
  49.     choco install notepadplusplus -y
  50.     # VLC Download and Install
  51.     choco install vlc -y
  52.     # 7Zip Download and Install
  53.     choco install 7zip -y
  54.     # Windows Terminal Download and Install
  55.     choco install microsoft-windows-terminal -y
  56.     # PowerToys Download and Install
  57.     choco install powertoys -y
  58.     # MegaSync Download and Install
  59.     choco install megasync -y
  60.     # Notion Download and Install
  61.     choco install notion -y
  62.     # GreenShot Download and Install
  63.     choco install greenshot -y
  64.     # FoxitReader Download and Install
  65.     choco install foxitreader -y
  66.     # Sublime Download and Install
  67.     choco install sublimetext3 -y
  68.     # JRE8 Download and Install
  69.     choco install jre8 -y
  70.     # HoneyView Download and Install
  71.     # choco install honeyview -y
  72.     # Parsec Download and Install
  73.     choco install parsec -y
  74.     # VSCodium Download and Install
  75.     choco install vscodium -y
  76.     # Pot Player Download and Install
  77.     choco install potplayer -y
  78.     # DupeGuru Download and Install
  79.     choco install dupeguru -y
  80.  
  81.     # Set Brave and Chrome Extensions for use
  82.     Set-Location -Path "C:\Users\Default\Links"
  83.     $URLs = @(
  84.  
  85.         "https://www.mediafire.com/file/x3d7jl3i6sqqnmm/BitWarden_extension_1_56_4_0.crx/file"
  86.         "https://www.mediafire.com/file/k2ydui0i7l4kyq6/NordTheme_2_4_4_0.crx/file"
  87.         "https://www.mediafire.com/file/60msblhs8n4kdwz/Ublock_Orgin_extension_1_41_2_0.crx/file"
  88.  
  89.     )
  90.     foreach ($URL in $URLs) {
  91.  
  92.         $DownloadLink2 = (Invoke-WebRequest -Uri $URL -UseBasicParsing).Links | sort-object href -Unique | Select-Object href | Select-String -Pattern 'https://download' -SimpleMatch
  93.         $DownloadLink1 = $DownloadLink2 -replace "@{href=" -replace "" ; $Source = $DownloadLink1 -replace "}" -replace ""
  94.         $DIR = $(get-location).Path ; $APP = ($Source.Split('/',6) | Select -Index 5) ; $DIRAPP = $DIR + "\" + $APP
  95.         Write-Host("Downloading $APP...") -Fore Yellow
  96.         Start-BitsTransfer -Source $Source -Destination $DIRAPP
  97.  
  98.     }
  99.  
  100.     # ======== Chrome Settings ======== #
  101.     # Set Extensions root key
  102.     New-Item -Path "HKLM:\SOFTWARE\Wow6432Node\Google\Chrome\Extensions" -EA SilentlyContinue
  103.     # Set Nord Theme extension root key
  104.     New-Item -Path "HKLM:\SOFTWARE\Wow6432Node\Google\Chrome\Extensions\Nord" -EA SilentlyContinue
  105.     New-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Google\Chrome\Extensions\Nord" -Name "Path" -Type String -Value "C:\Users\Default\Links\NordTheme_2_4_4_0.crx" -Force -EA SilentlyContinue
  106.     New-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Google\Chrome\Extensions\Nord" -Name "Version" -Type String -Value "2.4.4" -Force -EA SilentlyContinue
  107.     # Set Bit Warden extension root key
  108.     New-Item -Path "HKLM:\SOFTWARE\Wow6432Node\Google\Chrome\Extensions\Ward" -EA SilentlyContinue
  109.     New-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Google\Chrome\Extensions\Ward" -Name "Path" -Type String -Value "C:\Users\Default\Links\BitWarden_extension_1_56_4_0.crx" -Force -EA SilentlyContinue
  110.     New-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Google\Chrome\Extensions\Ward" -Name "Version" -Type String -Value "2" -Force -EA SilentlyContinue
  111.     # Set Ublock Origin extension root key
  112.     New-Item -Path "HKLM:\SOFTWARE\Wow6432Node\Google\Chrome\Extensions\UORG" -EA SilentlyContinue
  113.     New-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Google\Chrome\Extensions\UORG" -Name "Path" -Type String -Value "C:\Users\Default\Links\Ublock_Orgin_extension_1_41_2_0.crx" -Force -EA SilentlyContinue
  114.     New-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Google\Chrome\Extensions\UORG" -Name "Version" -Type String -Value "2" -Force -EA SilentlyContinue
  115.  
  116.     # ======== Brave Settings ======== #
  117.     # Set Extensions root key
  118.     New-Item -Path "HKLM:\SOFTWARE\Wow6432Node\BraveSoftware\Brave-Browser\Extensions" -EA SilentlyContinue
  119.     # Set Nord Theme extension root key
  120.     New-Item -Path "HKLM:\SOFTWARE\Wow6432Node\BraveSoftware\Brave-Browser\Extensions\Nord" -EA SilentlyContinue
  121.     New-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\BraveSoftware\Brave-Browser\Extensions\Nord" -Name "Path" -Type String -Value "C:\Users\Default\Links\NordTheme_2_4_4_0.crx" -Force -EA SilentlyContinue
  122.     New-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\BraveSoftware\Brave-Browser\Extensions\Nord" -Name "Version" -Type String -Value "2.4.4" -Force -EA SilentlyContinue
  123.     # Set Bit Warden extension root key
  124.     New-Item -Path "HKLM:\SOFTWARE\Wow6432Node\BraveSoftware\Brave-Browser\Extensions\Ward" -EA SilentlyContinue
  125.     New-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\BraveSoftware\Brave-Browser\Extensions\Ward" -Name "Path" -Type String -Value "C:\Users\Default\Links\BitWarden_extension_1_56_4_0.crx" -Force -EA SilentlyContinue
  126.     New-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\BraveSoftware\Brave-Browser\Extensions\Ward" -Name "Version" -Type String -Value "2" -Force -EA SilentlyContinue
  127.     # Set Ublock Origin extension root key
  128.     New-Item -Path "HKLM:\SOFTWARE\Wow6432Node\BraveSoftware\Brave-Browser\Extensions\UORG" -EA SilentlyContinue
  129.     New-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\BraveSoftware\Brave-Browser\Extensions\UORG" -Name "Path" -Type String -Value "C:\Users\Default\Links\Ublock_Orgin_extension_1_41_2_0.crx" -Force -EA SilentlyContinue
  130.     New-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\BraveSoftware\Brave-Browser\Extensions\UORG" -Name "Version" -Type String -Value "2" -Force -EA SilentlyContinue
  131.  
  132.     $Currentlocation = (Get-Location).path
  133.     sl $env:USERPROFILE\Desktop\
  134.     Get-ChildItem *.lnk | foreach { Remove-Item -Path $_.FullName }
  135.     Get-ChildItem $env:Public\Desktop\*.lnk | ForEach-Object { Remove-Item $_ }
  136.     sl $Currentlocation
  137.     }
  138.  
  139. #=====[ Software Removal ]=====#
  140. # OneDrive Uninstallation
  141. Write-Host "Uninstalling OneDrive..."
  142. Stop-Process -Name "OneDrive" -ErrorAction SilentlyContinue
  143. Start-Sleep -s 2
  144. $onedrive = "$env:SYSTEMROOT\SysWOW64\OneDriveSetup.exe"
  145. If (!(Test-Path $onedrive)) {
  146. $onedrive = "$env:SYSTEMROOT\System32\OneDriveSetup.exe"
  147. Start-Process $onedrive "/uninstall" -NoNewWindow -Wait
  148. Stop-Process -Name "explorer" -ErrorAction SilentlyContinue
  149. Remove-Item -Path "$env:USERPROFILE\OneDrive" -Force -Recurse -ErrorAction SilentlyContinue
  150. Remove-Item -Path "$env:LOCALAPPDATA\Microsoft\OneDrive" -Force -Recurse -ErrorAction SilentlyContinue
  151. Remove-Item -Path "$env:PROGRAMDATA\Microsoft OneDrive" -Force -Recurse -ErrorAction SilentlyContinue
  152. Remove-Item -Path "$env:SYSTEMDRIVE\OneDriveTemp" -Force -Recurse -ErrorAction SilentlyContinue
  153. Remove-Item -Path "HKCR:\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" -Recurse -ErrorAction SilentlyContinue
  154. Remove-Item -Path "HKCR:\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" -Recurse -ErrorAction SilentlyContinue}
  155.  
  156. $Bloatware = @(
  157.  
  158.         #Unnecessary Windows 10 AppX Apps
  159.         "*3DViewer*"
  160.         "*3dbuilder*"
  161.         "*ACGMediaPlayer*"
  162.         "*ActiproSoftwareLLC*"
  163.         "*AdobePhotoshopExpress*"
  164.         "*AdobeSystemsIncorporated.AdobePhotoshopExpress*"
  165.         "*AssignedAccessLockApp*"
  166.         "*AutodeskSketchBook*"
  167.         "*BethesdaSoftworks.FalloutShelter*"
  168.         "*Bing*"
  169.         "*BubbleWitch3Saga*"
  170.         "*CandyCrush*"
  171.         "*CommsPhone*"
  172.         "*ConnectivityStore*"
  173.         "*Dolby*"
  174.         "*Duolingo-LearnLanguagesforFree*"
  175.         "*EclipseManager*"
  176.         "*Facebook*"
  177.         "*FarmVille2CountryEscape*"
  178.         "*FeedbackHub*"
  179.         "*Flipboard*"
  180.         "*Getstarted*"
  181.         "*HiddenCity*"
  182.         "*HiddenCityMysteryofShadows*"
  183.         "*Hulu*"
  184.         "*LinkedInforWindows*"
  185.         "*Linkedin*"
  186.         "*Microsoft.3dbuilder*"
  187.         "*Microsoft.549981C3F5F10*"
  188.         "*Microsoft.Asphalt8Airborne*"
  189.         "*Microsoft.BingFinance*"
  190.         "*Microsoft.BingNews*"
  191.         "*Microsoft.BingWeather*"
  192.         "*Microsoft.Caclulator*"
  193.         "*Microsoft.DrawboardPDF*"
  194.         "*Microsoft.GetHelp*"
  195.         "*Microsoft.Getstarted*"
  196.         "*Microsoft.MSPaint*"
  197.         "*Microsoft.Messaging*"
  198.         "*Microsoft.MicrosoftOfficeHub*"
  199.         "*Microsoft.MicrosoftSolitaireCollection*"
  200.         "*Microsoft.MsixPackagingTool*"
  201.         "*Microsoft.OneConnect*"
  202.         "*Microsoft.People*"
  203.         "*Microsoft.Print3D*"
  204.         "*Microsoft.SkypeApp*"
  205.         "*Microsoft.Wallet*"
  206.         "*Microsoft.Windows.Photos*"
  207.         "*Microsoft.WindowsAlarms*"
  208.         "*Microsoft.WindowsCamera*"
  209.         "*Microsoft.WindowsFeedbackHub*"
  210.         "*Microsoft.WindowsMaps*"
  211.         "*Microsoft.WindowsSoundRecorder*"
  212.         "*Microsoft.WindowsStore*"
  213.         "*Microsoft.Xbox.TCUI*"
  214.         "*Microsoft.XboxApp*"
  215.         "*Microsoft.XboxGameOverlay*"
  216.         "*Microsoft.XboxGamingOverlay*"
  217.         "*Microsoft.XboxIdentityProvider*"
  218.         "*Microsoft.XboxSpeechToTextOverlay*"
  219.         "*Microsoft.YourPhone*"
  220.         "*Microsoft.ZuneMusic*"
  221.         "*Microsoft.ZuneVideo*"
  222.         "*Microsoft3DViewer*"
  223.         "*MicrosoftOfficeHub*"
  224.         "*MinecraftUWP*"
  225.         "*MixedReality*"
  226.         "*Netflix*"
  227.         "*Office.Sway*"
  228.         "*OneCalendar*"
  229.         "*OneNote*"
  230.         "*Paint*"
  231.         "*PandoraMediaInc*"
  232.         "*PinningConfirmationDialog*"
  233.         "*Royal Revolt*"
  234.         "*SecureAssessmentBrowser*"
  235.         "*Sketchable*"
  236.         "*SkypeApp*"
  237.         "*Speed Test*"
  238.         "*Sticky*"
  239.         "*Store*"
  240.         "*Sway*"
  241.         "*Todos*"
  242.         "*Twitter*"
  243.         "*Viber*"
  244.         "*WindowsCalculator*"
  245.         "*WindowsCamera*"
  246.         "*WindowsMaps*"
  247.         "*WindowsPhone*"
  248.         "*WindowsScan*"
  249.         "*WindowsSoundRecorder*"
  250.         "*Wunderlist*"
  251.         "*Xbox*"
  252.         "*XboxApp*"
  253.         "*XboxGameOverlay*"
  254.         "*XboxGamingOverlay*"
  255.         "*XboxOneSmartGlass*"
  256.         "*XboxSpeechToTextOverlay*"
  257.         "*Xboxapp*"
  258.         "*YourPhone*"
  259.         "*advertising*"
  260.         "*appconnector"
  261.         "*bing*"
  262.         "*bingfinance*"
  263.         "*bingnews*"
  264.         "*bingsports*"
  265.         "*bingweather*"
  266.         "*candy*"
  267.         "*commsphone*"
  268.         "*connectivitystore*"
  269.         "*dropbox*"
  270.         "*feed*"
  271.         "*flaregamesGmbH.RoyalRevolt2*"
  272.         "*freshpaint*"
  273.         "*getstarted*"
  274.         "*king.com.CandyCrushSodaSaga*"
  275.         "*messag*"
  276.         "*microsoft.windowscommunicationsapps*"
  277.         "*mspaint*"
  278.         "*netflix*"
  279.         "*office*"
  280.         "*officehub*"
  281.         "*onenote*"
  282.         "*people*"
  283.         "*photos*"
  284.         "*print3D*"
  285.         "*reality*"
  286.         "*sketch*"
  287.         "*skype*"
  288.         "*skypeapp*"
  289.         "*solit*"
  290.         "*solitaire*"
  291.         "*solitairecollection*"
  292.         "*soundrecorder*"
  293.         "*sway*"
  294.         "*twitter*"
  295.         "*wallet*"
  296.         "*windowsalarms*"
  297.         "*windowscamera*"
  298.         "*windowscommunicationsapps*"
  299.         "*windowsmaps*"
  300.         "*windowsphone*"
  301.         "*xbox*"
  302.         "*xboxapp*"
  303.         "*yourphone*"
  304.         "*zune*"
  305.         "*zunemusic*"
  306.         "*zunevideo*"
  307.         "DellInc.DellDigitalDelivery"
  308.         "Microsoft.3DBuilder"
  309.         "Microsoft.AppConnector"
  310.         "Microsoft.BingFinance"
  311.         "Microsoft.BingNews"
  312.         "Microsoft.BingSports"
  313.         "Microsoft.BingTranslator"
  314.         "Microsoft.BingWeather"
  315.         "Microsoft.GetHelp"
  316.         "Microsoft.Getstarted"
  317.         "Microsoft.Messaging"
  318.         "Microsoft.Microsoft3DViewer"
  319.         "Microsoft.MicrosoftSolitaireCollection"
  320.         "Microsoft.NetworkSpeedTest"
  321.         "Microsoft.News"
  322.         "Microsoft.Office.Lens"
  323.         "Microsoft.Office.Sway"
  324.         "Microsoft.OneConnect"
  325.         "Microsoft.People"
  326.         "Microsoft.Print3D"
  327.         "Microsoft.SkypeApp"
  328.         "Microsoft.StorePurchaseApp"
  329.         "Microsoft.Wallet"
  330.         "Microsoft.Whiteboard"
  331.         "Microsoft.WindowsAlarms"
  332.         "Microsoft.WindowsFeedbackHub"
  333.         "Microsoft.WindowsMaps"
  334.         "Microsoft.WindowsSoundRecorder"
  335.         "Microsoft.Xbox.TCUI"
  336.         "Microsoft.XboxGamingOverlay"
  337.         "Microsoft.XboxIdentityProvider"
  338.         "Microsoft.XboxSpeechToTextOverlay"
  339.         "Microsoft.ZuneMusic"
  340.         "Microsoft.ZuneVideo"
  341.         "microsoft.windowscommunicationsapps"
  342.  
  343.  
  344.     )
  345.     foreach ($Bloat in $Bloatware) {
  346.         Get-AppxPackage -allusers -Name $Bloat| Remove-AppxPackage -allusers -ErrorAction SilentlyContinue
  347.         Get-AppxProvisionedPackage -Online | Where-Object DisplayName -like $Bloat | Remove-AppxProvisionedPackage -Online
  348.         Write-Host "Trying to remove $Bloat."
  349.             }
  350.  
  351. # Uninstall specific bloatware
  352.         Get-Package -Name "*office*" | Uninstall-Package
  353.         Get-Package -Name "*Microsoft 365*" | Uninstall-Package
  354.  
  355. #=====[ Software Installtion ]=====#
  356. # Install Software Management utility Chocolatey.
  357. # Write Script to Install Chocolately
  358. Set-Content -Path 'C:\Automation\Choco00.ps1' -Value {
  359.     Set-ExecutionPolicy Bypass -Scope Process -Force
  360.     Set-Location -Path C:\Automation
  361.     [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
  362.     iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
  363.  
  364.     }
  365.  
  366. # Invoke Script to Install Chocolately
  367.     Invoke-Expression 'cmd /c start powershell -Command { powershell.exe C:\Automation\Choco00.ps1 }'
  368.  
  369. ## Install the older better Media Player
  370.     Enable-WindowsOptionalFeature -Online -FeatureName "WindowsMediaPlayer" -NoRestart -WarningAction SilentlyContinue | Out-Null
  371.  
  372. ##  Install the older better calculator
  373.     $URL = 'https://www.mediafire.com/file/8rzj2o2apgn7t8r/oldcalcWin11Win10.zip/file'
  374.     $DownloadLink2 = (Invoke-WebRequest -Uri $URL -UseBasicParsing).Links | sort-object href -Unique | Select-Object href | Select-String -Pattern 'https://download' -SimpleMatch
  375.     $DownloadLink1 = $DownloadLink2 -replace "@{href=" -replace "" ; $Source = $DownloadLink1 -replace "}" -replace ""
  376.     $DIR = $(get-location).Path ; $APP = ($Source.Split('/',6) | Select -Index 5) ; $DIRAPP = $DIR + "\" + $APP
  377.     Start-BitsTransfer -Source $Source -Destination $DIRAPP
  378.     Expand-Archive -LiteralPath 'C:\temp\oldcalcWin11Win10.zip' -DestinationPath C:\temp\
  379.     Start C:\temp\OldClassicCalc-2.0-setup.exe
  380.     Sleep 4
  381.     $wshell = New-Object -ComObject wscript.shell;
  382.     $wshell.AppActivate('Setup Old Classic Calculator for Windows 11 and Windows 10')
  383.     Sleep 4
  384.     $wshell.SendKeys('~')
  385.     Sleep 2
  386.     $wshell.SendKeys("%(N)")
  387.     Sleep 2
  388.     $wshell.SendKeys("%(D)")
  389.     Sleep 2
  390.     $wshell.SendKeys("%(N)")
  391.     Sleep 4
  392.     $wshell.SendKeys("%(I)")
  393.     Sleep 3
  394.     $wshell.SendKeys(' ')
  395.     Sleep 1
  396.     $wshell.SendKeys('{TAB}')
  397.     Sleep 2
  398.     $wshell.SendKeys(' ')
  399.     Sleep 2
  400.     $wshell.SendKeys("%(F)")
  401.     sleep 10
  402.     Remove-Item -Recurse -Force C:\temp\OldClassicCalc-2.0-setup.exe -EA SilentlyContinue
  403.     Remove-Item -Recurse -Force C:\temp\oldcalcWin11Win10.zip -EA SilentlyContinue
  404.  
  405.  
  406. ### Running Shutup10 and using recomended settings
  407.     Import-Module BitsTransfer      
  408.     choco install shutup10 -y
  409.     Start-BitsTransfer -Source "https://raw.githubusercontent.com/ChrisTitusTech/win10script/master/ooshutup10.cfg" -Destination ".\ooshutup10.cfg"
  410.     OOSU10 ooshutup10.cfg /quiet
  411.     Start-BitsTransfer -Source "https://dl5.oo-software.com/files/ooshutup10/OOSU10.exe" -Destination ".\OOSU10.exe"
  412.     ./OOSU10.exe ooshutup10.cfg /quiet
  413.  
  414. ### Download and install OpenDrive.
  415.     Start-BitsTransfer -Source "https://www.opendrive.com/wp-content/uploads/releases/windows/setup.exe" -Destination OpenDrive.exe
  416.     $Dir = $(get-location).Path;
  417.     $App_OpenDrive = 'OpenDrive.exe'
  418.     $DirAPPOD = $Dir + '\' + $App_OpenDrive
  419.     Start-Process -Wait -FilePath $DirAPPOD -Argument "/silent" -PassThru        
  420.  
Add Comment
Please, Sign In to add comment