Skip to content

Instantly share code, notes, and snippets.

param(
[CmdletBinding()]
[ValidatePattern('^(((?<days>[0-9]+)\+)?((?<hours>[0-9]{1,2}):))?(?<mins>[0-9]{1,2})$')]
[string]$quserTimeString
)
$quserTimeString -match '^(((?<days>[0-9]+)\+)?((?<hours>[0-9]{1,2}):))?(?<mins>[0-9]{1,2})$' | Out-Null
param(
[CmdletBinding()]
[ValidatePattern('^(((?<days>[0-9]+)\+)?((?<hours>[0-9]{1,2}):))?(?<mins>[0-9]{1,2})$')]
[string]$quserTimeString
)
$string = $quserTimeString
param(
[CmdletBinding(DefaultParameterSetName="OU")]
[Parameter(
ParameterSetName="Computer",
ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true)]
[string[]]$ComputerName,
[Parameter(ParameterSetName="OU")]
[string]$SearchBase = "OU=Target,OU=Stations,DC=hagatorn,DC=local",
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2017-04-25T15:39:00.4152962</Date>
<Author>DOMAIN\User</Author>
<Description>Triggers only on Exam Accounts 01-18 log-off events and clears just the logging off users files.</Description>
</RegistrationInfo>
<Triggers>
<EventTrigger>
<Enabled>true</Enabled>
@hagatorn
hagatorn / WOL-pdq.ps1
Last active March 19, 2021 18:46
WOL with pdq utility
[cmdletbinding()]
param(
[Parameter(ParameterSetName=’NamedHost’)]
[string]$HostName,
[Parameter(ParameterSetName=’AllHosts’)]
[switch]$All,
[switch]$DHCP,
@hagatorn
hagatorn / WOL.ps1
Last active March 16, 2017 12:16
WOL with DHCP utility
param(
[string]$HostName,
[string]$Mac,
[string]$ip,
[switch]$All,
[switch]$broadcast,
[ValidateSet(“Site1”,”Site2”)][string]$site = "Site1"
)
#installers
.\Sibelius712b46.exe" /LSINFO=calf /VERYSILENT /SUPPRESSMSGBOXES
.\Sibelius713b77Update.exe" /LSINFO=calf /VERYSILENT /SUPPRESSMSGBOXES
#instrument files and reg mod.
$localPath = "C:\YOUR\PATH"
copy-item -Path "$installerPath\Sibelius 7 Sounds" -Destination $localPath -Recurse
# Sibelius Sounds Update must be run manually following silent install as it is not possible to suppress user interation
REM Office Web Components
.\64bit\OfficeWeb_11\owc11.exe /quiet
REM Visual C++ 2005 Redistributables
pushd "64bit\Microsoft_C++_2005_Redistributable_(x64)"
.\vcredist_x64.exe /Q
popd
.\64bit\Microsoft_C++_2005_Redistributable\vcredist_x86.exe /Q
@hagatorn
hagatorn / List Gallery
Last active December 24, 2015 10:19
Alternative gallery with for kirby: uses a central csv table and image bank. In the text file for your page type ---- imagelist: yourfilename1, yourfilename2, yourfilename3, Allows for much easier page construction for large site that you may otherwise use a db for
@hagatorn
hagatorn / Recursive tree style accordion for kirby
Last active December 17, 2015 04:58
Recursive tree style accordion for kirby
<?php if(!isset($subpages)) $subpages = $site->pages();
if(!isset($id)) $id = 0; ?>
<?php $id+=1;
foreach($site->breadcrumb() AS $crumb):
$breadcrumb[] = $crumb->url();
endforeach ?>
<ul id="accordiongroup_<?php