Skip to content

Instantly share code, notes, and snippets.

View waldronj's full-sized avatar

Josh Waldron waldronj

View GitHub Profile
@waldronj
waldronj / gist:f51f2383ac79f5cbaf36
Created November 9, 2015 16:50
Azure VM Provisioning and Domain Join
param(
[Parameter(Mandatory=$true)]
$Name,
[Parameter(Mandatory=$true)]
$location,
[Parameter(Mandatory=$true)]
$size,
node 'default'{
file { 'c:/users/vagrant/desktop/test.txt':
ensure => present,
content => hiera('file_content')
}
}
windows.yaml:
---
$servers = Get-Content "PathToServerList"
#Get-WUList -ComputerName $servers | select computername, kb, size, ismandatory, MsrcSeverity, title | ft -AutoSize
Get-Job | Remove-Job
foreach($server in $servers){
start-job -Name $server -ArgumentList $server -ScriptBlock {
param($server)
Function Get-WUList
{
import argparse
import sys
parser = argparse.ArgumentParser(description="Tail Substitute")
parser.add_argument('lines', type=int, default=10, nargs='?',
help="Number of lines to print, default is 10")
args = parser.parse_args()
input_stream = []
for line in sys.stdin:
{
"check":"2",
"url":"http://thejwal.com",
"transaction":[
{
"action":"present",
"selector":"#idLogo123",
"text": "This is what I'm going to fill a textbox with"
},
{
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCbpolXf6wGv6hJW83mzw6gY1Z85cimGBS2vGVrL2K0oZdRnIqoXOEhm+h+oieO61ZQXD3ILuPdQR4vPSpkfOPHZuX7YdfJ9L/UqciUucSpQn1QDTEcaRebWjqQUxcuezHvMdWr52nS08AMbRuDQ/tWHgSJLOJXzP1V8C9RuqoIr5epQf1wxdrTWVDD4Wq1Wt1I0n1QX28FXI32ysc0yTKIHiJf0mUXV7ZZBKGcouI6VYE9MTWL0vB/pbW3og7TfVsdwTRrF0TVM39Y76k/XSaGw/S4K/uYWtAchZ+XtNpPIZZdh70XAMVPhVPZEsoPWochJOXbqfx98L+GpFy3O5+X jwaldron@Joshuas-MacBook-Pro.local
Debug: Creating new connection for https://puppet:8140
Info: Caching certificate for ca
Debug: Creating new connection for https://puppet:8140
Debug: Creating new connection for https://puppet:8140
Info: csr_attributes file loading from /home/vagrant/.puppet/csr_attributes.yaml
Info: Creating a new SSL certificate request for centos
Info: Certificate Request fingerprint (SHA256): 4C:4A:DA:3B:7C:6D:19:6A:21:1B:3C:7A:E5:8C:BB:24:83:47:37:AA:5C:37:08:5F:91:92:CB:8C:5D:20:12:FB
Debug: Creating new connection for https://puppet:8140
Debug: Using cached certificate for ca
Debug: Creating new connection for https://puppet:8140
@waldronj
waldronj / gist:0b467ccd3cf29092177f
Last active August 29, 2015 14:09
Workflow, ping in parallel
[System.Array]$arrComputer = 'www.msn.com', 'www.google.com', 'localhost', '127.0.0.1'
workflow TestAllTheConnections{
param(
[System.String[]]$Computers
)
Foreach -Parallel ($c in $Computers){
Test-Connection -ComputerName $c -Count 1 -Delay 1
}
}
$numbers = 1..10
$i = 0
while($i -le 10){
$numbers
$i++
}
function Size($w, $h)
{
New-Object System.Management.Automation.Host.Size($w, $h)
}
function resize()
{
Write-Host '[Arrows] resize [Esc] exit ...'
$ErrorActionPreference = 'SilentlyContinue'
for($ui = $Host.UI.RawUI;;) {