Skip to content

Instantly share code, notes, and snippets.

View Clickbaitcake's full-sized avatar

Click Bait Cake Clickbaitcake

View GitHub Profile
#Block social networks.
127.0.0.1 localhost
127.0.0.1 localhost.localdomain
127.0.0.1 local
255.255.255.255 broadcasthost
::1 localhost
::1 ip6-localhost
::1 ip6-loopback
fe80::1%lo0 localhost
@Clickbaitcake
Clickbaitcake / CheckModule.ps1
Created December 8, 2020 11:33
Checks for the installation of a PowerShell module and tries to install it if its missing.
#Usage: CheckModule -ModuleName ABC123
function CheckModule{
param($ModuleName)
if (Get-Module -ListAvailable -Name $ModuleName) {
Write-Host -ForegroundColor Green "$($ModuleName) exists"
}
else{
write-host -ForegroundColor Green "Hello World, this is a test script for PowerShell Oneliners"
@Clickbaitcake
Clickbaitcake / DataClean.ps1
Last active October 23, 2019 13:06
Removes data in folder that was created more than 60 days ago.
CD "C:\PATHHERE"
Get-ChildItem | Where-Object {($_.CreationTime -lt (Get-Date).AddDays(-60))} | Remove-Item -Force -Recurse