Skip to content

Instantly share code, notes, and snippets.

View thefamousbrian's full-sized avatar

Brian Walsh thefamousbrian

View GitHub Profile
#
# Wait for AWS instance to be ready for SSM commands
#
instance_id=$1
echo "waiting for instance $instance_id..."
pingStatus=$(aws ssm describe-instance-information \
--instance-information-filter-list key=InstanceIds,valueSet=$instance_id \
--query 'InstanceInformationList[].PingStatus' \
--output text)
@thefamousbrian
thefamousbrian / NewCluster.ps1
Last active February 7, 2020 15:46
DSC Script resource to create a new failover cluster
Script NewCluster {
TestScript = {
$computerObject = Get-CimInstance -ClassName Win32_ComputerSystem
$cluster = Get-Cluster -Name $Using:clustername -Domain $computerObject.Domain
if($cluster) {
return $true
} else {
return $false
@thefamousbrian
thefamousbrian / configure.ps1
Last active February 19, 2021 14:40
certutil error checking Powershell DSC Script resource
# Install local cert with certutil
Script localcert {
SetScript = {
$certPath = "C:\Installers\$using:cert"
$result = $(certutil -p $using:cert_pass -csp "Microsoft Enhanced RSA and AES Cryptographic Provider" -importpfx $certPath)
if($result -like '*FAILED*') {
Throw "certutil failed for local cert $certPath $result"
}
}
TestScript = { $false }