This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Moved to Github: https://github.com/chrisbrownie/Convert-ExcelSheetToJson |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Downloads all aero charts from Airservices | |
$hostUri = "http://www.airservicesaustralia.com/aip/current/dap/AeroProcChartsTOC.htm" | |
$fileTypesToDownload = @("pdf") | |
# Download the page of charts | |
$links = Invoke-WebRequest $hostUri | select -ExpandProperty links | |
# Get a webclient ready for downloading files | |
$webClient = New-Object System.Net.WebClient | |
foreach ($link in $links) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#EmailWhenUp.ps1 | |
# Usage: ./EmailWhenUp.ps1 Computer01 | |
Param([string]$ComputerName,[string]$mailServer,[string]$MailTo) | |
function isup { | |
Param([string]$ComputerName) | |
Test-Connection -ComputerName $ComputerName -Count 1 -Quiet | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$uri = "https://flamingkeys.com" | |
while ($true) { | |
try { | |
Invoke-WebRequest $uri -TimeoutSec 5 | |
start "https://www.youtube.com/watch?v=xos2MnVxe-c" | |
break | |
} catch { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Connect-ExchangeOnline() { | |
Param( | |
$Credential = $(Get-Credential) | |
) | |
if (-not $global:eoSession) { | |
$Global:eoSession = New-PSSession ` | |
-ConfigurationName Microsoft.Exchange ` | |
-ConnectionUri "https://outlook.office365.com/powershell-liveid" ` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$logFile = "dns2_cleaned.log" | |
$sr = New-Object System.IO.StreamReader($logFile) | |
$line = $sr.ReadLine() | |
$packets = @() | |
while ($line -ne $null) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$logFile = "$pwd\dns.log" | |
$newLogFile = "$pwd\dns_cleaned.log" | |
$sr = New-Object System.IO.StreamReader($logFile) | |
$sw = New-Object System.IO.StreamWriter($newLogFile) | |
$line = $sr.ReadLine() | |
while ($line -ne $null) { | |
if ($line.trim() -ne "") { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-ImmutableId ($a) { | |
[System.Convert]::ToBase64String(([guid](Get-ADUser $a -Properties ObjectGuid).ObjectGuid).ToByteArray()) | |
} | |
## | |
## WARNING: This script does not health check anything at all. | |
## If you run it without knowing what it does, you | |
## will probably break the internet, and not in the good way. | |
## |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Site to check | |
$site = "https://www.github.com" | |
# Seconds between checks | |
$interval = 2 | |
while ($true) { | |
$result = try { Invoke-WebRequest $site -ErrorAction silentlycontinue } catch { $null } | |
if ($result.statuscode -eq 200) { | |
Write-Host "$site is up" -BackgroundColor green -ForegroundColor white | |
} else { |