This file contains 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
$newDomain = "yourdomain.com" | |
$outputDir = "_redirects" | |
function redirectPage($uri) {@" | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Redirecting to https://$newDomain$uri</title> | |
<meta http-equiv="refresh" content="0; URL=https://$newDomain$uri"> |
This file contains 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
param( | |
[ValidatePattern(" *[a-zA-z0-9]{2,4} +[a-zA-z0-9]{2,4} *")] | |
[Parameter(Position = 0, Mandatory = $true)] | |
[string]$postCode | |
) | |
BEGIN | |
{ | |
$root = "https://coronavirus.data.gov.uk/search?postcode=" | |
} | |
PROCESS{ |
This file contains 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
$data = Import-Csv "PupilsByPrimaryAddress.csv" | |
$uniqueUkPostCode = $data |? {$_.txtCountry -eq "United Kingdom"} |% {$_.txtPostCode} | Sort-Object -Unique |? {$_ -ne ''} | |
$uniqueUkPostCode | | |
ForEach-Object -Begin { | |
$total = $uniqueUkPostCode.count | |
$i = 0 | |
$dict = @{} | |
} -Process { |
This file contains 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
while($true){ | |
$timeStamp = (Get-Date).toString('yyyy-MM-dd-HH-mm-ss') | |
$path = $pwd.Path + "\" + $timeStamp + ".txt" | |
Start-Job{ | |
try{ | |
Invoke-WebRequest https://www.dundasparksgolf.co.uk/ > $null | |
"Success`t"+$using:timeStamp | |
} catch | |
{ | |
$error[0] > $using:path |
This file contains 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
$removeExcess = $false | |
$count = $sets.Count | |
$i = 0 | |
foreach($set in $filteredSets){ | |
$percent = $i * 100 / $count | |
$i += 1 | |
$teamName = $set.SetCode + " " + $year | |
Write-Progress -Activity "Creating Team" -Status "$percent% Complete | working on $teamName)" -PercentComplete $percent | |
$ProgressPreference = "SilentlyContinue" |
This file contains 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
#Requires -Modules IsamsBatchApi | |
$config = Get-Content ./config.json -Raw | ConvertFrom-Json | |
$clientID = $config.BatchAPI.ClientID | ConvertTo-SecureString | ConvertFrom-SecureString -AsPlainText | |
$clientSecret = $config.BatchAPI.ClientSecret | ConvertTo-SecureString | ConvertFrom-SecureString -AsPlainText | |
$isamsInstance = $config.BatchAPI.Host | ConvertTo-SecureString | ConvertFrom-SecureString -AsPlainText | |
$searchBase = $config.ActiveDirectory.PupilSearchBase | ConvertTo-SecureString | ConvertFrom-SecureString -AsPlainText |