Introduction
Features
Downloads & Changelogs
FAQs
Disclaimer
License/forks
Requirements
Instructions for use with administrator privileges (recommended)
Instructions for use without administrator privileges
Instructions to customize psAdBlock
Credits & thanks to
XDA:DevDB Information
psAdBlock, Tool/Utility for the Windows 8 General
Contributors
Makorus
Source Code: https://github.com/makorus/ps-adblock
Version Information
Status: Stable
Current Stable Version: 1.6.5
Stable Release Date: 2017-07-03
Created 2015-05-09
Last Updated 2018-07-13
Dear community
This is my very first XDA: DevDB project. I'm glad to announce my ad-block solution purely based on PowerShell.
I've been (and I still am) using AdAway on my Android phone. It's a great app, and it inspired me to get a similar solution for Windows computers.
Version 0.1 was not public because it was slow as hell. It took about 8 minutes to handle ~200'000 hosts.
With version 1.0, my script got a massive speed improvement. Now its duration has been greatly decreased. I achieved the same amount of hosts in less than 100 seconds now. But of course, these measured values shouldn't mean a lot, as they depend completely on your hardware (and a little bit on your internet connection of course).
Now version 1.6 has an automatic backup & apply routine, check it out!
Features
This script does exactly what you think: It grabs various "hosts" sources from the internet, saves them locally, and merges them to one big file. Enjoy an ad-free Windows experience.
- Download as many "hosts" files as you want
- Merge them automatically into one big "hosts" file
- Remove duplicates from the "hosts" file
- Remove any comment line starting with # to keep your hosts file as small as possible
- Apply a custom whitelist or even custom blacklists
- Log the entire process to a log file (placed within the same directory where you saved this script)
Downloads & Changelogs
FAQs
Disclaimer
Altough this is normally a safe process, I am not responsible for possible damage to your device if anything should fail.
I will not take any responsability for bricked Windows installations, other software defects or even lost data.
License/forks
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License().
This is an open source project, it's a PowerShell script and you're able to see the source code of course. You're allowed to modify this script as you want, as long as you give credits to me. Adaptations of my work shall be shared as well under the same license. Commercial use is allowed, as long as you don't sell my work.
Requirements
There are some requirements to check.
- A little bit of PowerShell-knowledge (not necessary of course)
- At least Windows 7 (theoretically it should work on any Windows)
- At least PowerShell 3.0 (PowerShell 2.0 may work, but is unsupported)
- At least 50 MB free space for this script
- Administrative privileges - required if you want to use the automatic backup & apply routines, not for the script itself, otherwise you'll need to manually copy the "hosts" file into the Windows directory
Instructions for use with administrator privileges (recommended)
- Download the archive and unzip it anywhere
- Execute the "_Run_Admin.bat" script via double-click, confirm the UAC window by clicking on the yes button and wait for the console to close itself
- Reboot your machine and enjoy an ad-free Windows experience
- Note: Instead of the batch script you can use the .ps1 file as well (unblock it first, simply right-click the .ps1 file, choose "Properties", then hit the "Unblock" button), start a new PowerShell console as administrator and manually run the script
Instructions for use without administrator privileges
- Download the archive and unzip it anywhere
- Execute the "_Run_User.bat" script via double-click and wait for the console to close itself
- Copy the newly created "hosts" file and rename the existing "hosts" file to manually create a backup
Code:C:/Windows/System32/drivers/etc/hosts
- Reboot your machine and enjoy an ad-free Windows experience
- Note: Instead of the batch script you can use the .ps1 file as well (unblock it first, simply right-click the .ps1 file, choose "Properties", then hit the "Unblock" button), start a new PowerShell console and manually run the script
Instructions to customize psAdBlock
- To modify the "hosts" sources, simply edit the file "hostslist.ini"
- To allow specific hosts, simply edit the file "whitelist.ini"
- To block specific hosts, simply create a new .txt file within the "DL_Cache" folder and add the hosts (one per line) you want to block (e.g. "0.0.0.0 place-any-site-here.com")
Credits & thanks to
* Makorus: Creator of this PowerShell script
* Dominik Schuermann: Inspiring me to do this
* Luca Sturlese: Allowing us to use his awesome logging function library
Any questions or suggestions? Did you find any bugs? Thanks for your feedbacks in advance! :good:
XDA:DevDB Information
psAdBlock, Tool/Utility for the Windows 8 General
Contributors
Makorus
Source Code: https://github.com/makorus/ps-adblock
Version Information
Status: Stable
Current Stable Version: 1.6.5
Stable Release Date: 2017-07-03
Created 2015-05-09
Last Updated 2018-07-13
Last edited: