Skip to content

Commit

Permalink
Fix win10_disabler.ps1 error (#2289)
Browse files Browse the repository at this point in the history
* Remove non-existent DisableAntiSpyware

* Fix DataCollection creation

* Fix removing WindowsApp
  • Loading branch information
qux-bbb authored Aug 25, 2024
1 parent 00723ba commit 01d06a6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions installer/win10_disabler.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

Write-Output "Disabling Windows defender features..."
New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender" -Name DisableAntiSpyware -Value 1 -PropertyType DWORD -Force
Set-MpPreference DisableAntiSpyware $true -ExclusionPath C:\ -DisableRemovableDriveScanning $true -DisableIntrusionPreventionSystem $true -DisableIOAVProtection $true -DisableRealtimeMonitoring $true -DisableBehaviorMonitoring $true -DisableScriptScanning $true -EnableControlledFolderAccess Disabled -EnableNetworkProtection AuditMode -Force -MAPSReporting Disabled -SubmitSamplesConsent NeverSend
Set-MpPreference -ExclusionPath C:\ -DisableRemovableDriveScanning $true -DisableIntrusionPreventionSystem $true -DisableIOAVProtection $true -DisableRealtimeMonitoring $true -DisableBehaviorMonitoring $true -DisableScriptScanning $true -EnableControlledFolderAccess Disabled -EnableNetworkProtection AuditMode -Force -MAPSReporting Disabled -SubmitSamplesConsent NeverSend
# https://www.alitajran.com/disable-windows-firewall-with-powershell/

Write-Output "Disabling Firewall..."
Expand Down Expand Up @@ -50,7 +50,7 @@ For ($i = 0; $i -lt 60; $i++) {
Rename-Item -Path "$msEdgeInstallationPath\EdgeUpdate\MicrosoftEdgeUpdate.exe" -NewName MicrosoftEdgeUpdateDisabled.exe -Force

Write-Output "Disabling telemetry via Group Policies"
New-FolderForced -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection"
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" -Force
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" "AllowTelemetry" 0

Write-Host "Block scheduled telemetry tasks"
Expand Down Expand Up @@ -84,5 +84,7 @@ $settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoi
Register-ScheduledTask -TaskName $jobname -Action $action -Trigger $trigger -RunLevel Highest -User $username -Password $password -Settings $settings
#>

Write-Output "Remove WindowsApp to prevent MS StoreStartup"
Remove-Item -path C:\Users\Default\AppData\Local\Microsoft\WindowsApp -recurse
if (Test-Path "C:\Users\Default\AppData\Local\Microsoft\WindowsApp") {
Write-Output "Remove WindowsApp to prevent MS StoreStartup"
Remove-Item -path "C:\Users\Default\AppData\Local\Microsoft\WindowsApp" -recurse
}

0 comments on commit 01d06a6

Please sign in to comment.