Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #### Configure uBOL first run and exclusions via Powershell
- $urls=@"
- anonit.net
- example.com
- "@ -split "`n" | % {$_.trim()}
- ### CHROME
- # Registry key location for uBlock Origin Lite's filtering exemptions
- $keyLocation = "HKLM:\SOFTWARE\Policies\Google\Chrome\3rdparty\extensions\ddkjiahejlhfcafbddmgiahcphecmpfh\policy\"
- $firstRunValue = "disableFirstRunPage"
- $firstRunSetting = $keyLocation+$firstRunValue
- $noFilteringValue = "noFiltering"
- $noFilteringSetting = $keyLocation+$noFilteringValue
- # Check if Disable first run is set, if not set it.
- if (!(test-path -path $firstRunSetting)) {
- new-item -path $keyLocation -force
- new-itemProperty -path $keyLocation -name $FirstRunValue -value "1" -propertyType DWORD -force
- }
- # Remove noFiltering key if it already exists. Clearing the decks makes updating an existing list far less complicated.
- if (test-path -path $noFilteringSetting) {remove-item -path $noFilteringSetting}
- new-item -path $keyLocation -name $noFilteringValue -force
- # Iterate through the content of $urls and write numbered values to the noFiltering key
- $urlCount = 0
- $urls | % -process {
- $urlCount++
- new-itemProperty -path $noFilteringSetting -name "$urlCount" -value "$_" -propertyType String -force
- }
- ### EDGE
- # Registry key location for uBlock Origin Lite's filtering exemptions
- $keyLocation = "HKLM:\SOFTWARE\Policies\Microsoft\Edge\3rdparty\extensions\cimighlppcgcoapaliogpjjdehbnofhn\policy\"
- $firstRunValue = "disableFirstRunPage"
- $firstRunSetting = $keyLocation+$firstRunValue
- $noFilteringValue = "noFiltering"
- $noFilteringSetting = $keyLocation+$noFilteringValue
- # Check if Disable first run is set, if not set it.
- if (!(test-path -path $firstRunSetting)) {
- new-item -path $keyLocation -force
- new-itemProperty -path $keyLocation -name $FirstRunValue -value "1" -propertyType DWORD -force
- }
- # Remove the old filters and add new ones
- if (test-path -path $noFilteringSetting) {remove-item -path $noFilteringSetting}
- new-item -path $keyLocation -name $noFilteringValue -force
- $urlCount = 0
- $urls | % -process {
- $urlCount++
- new-itemProperty -path $noFilteringSetting -name "$urlCount" -value "$_" -propertyType String -force
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement