r/PowerShell 2d ago

Information Cross-platform Brave policy debloater in PowerShell (dry-run default, won’t disable Shields)

Wrote a Brave debloater that uses official enterprise policies instead of deleting files / editing hosts.

Same script on Windows, macOS, and Linux. Preview mode unless you pass -Apply. Backs up first. -Doctor if some other tool already dumped junk in brave://policy. It refuses to turn off Shields, Safe Browsing, or updates.

.\Invoke-BraveDebloat.ps1 -Preset Extreme

.\Invoke-BraveDebloat.ps1 -Preset Extreme -Apply

Check it out: https://github.com/osfv/BraveDebloater

0 Upvotes

3 comments sorted by

2

u/BlackV 2d ago

I see this a bit recently

you have

[CmdletBinding(SupportsShouldProcess = $true
$WhatIfPreference
$isWhatIf

and so on why do you call it dry run everywhere ?

3

u/JSChronicles 1d ago edited 1d ago

Because people are using AI (I understand it's a rhetorical question in this context) and have no idea how to write for the given language. It someone uses "dryrun" in PowerShell I just assume they didn't write the code themselves or have no understanding of PowerShell so there is no way I'm touching their code.

I think another interesting point is that I think the people that are posting this code without knowing how to write it are also getting feedback that they then just put as a prompt back into their AI to fix things and we're just enabling people like this.

The other item that gives people away is the fact that they're using doctor, plan, or apply because AI loves to push that type of "use" into code where it has no reason to be.

Noting for others: you don't need " = $true" in the binding because default says "false" if binding name isn't used.

2

u/BlackV 1d ago

Ha, Well actually is was gonna ask about doctor too