Skip to content

Instantly share code, notes, and snippets.

View ryancbutler's full-sized avatar

Ryan Butler ryancbutler

View GitHub Profile
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
Enable-Psremoting -force -SkipNetworkProfileCheck
choco install -y git -params '"/GitOnlyOnPath"'
Install-PackageProvider -Name NuGet -Force
find-module -Repository PSGallery -Name PowerShellGet | Install-Module -Force
find-module -Repository PSGallery -Name PSScriptAnalyzer | Install-Module -Force
find-module -Repository PSGallery -Name Pester | Install-Module -Force -SkipPublisherCheck
Find-Module -Name xComputerManagement -Repository PSGallery | Install-Module -Force
Find-Module -Name xRemoteDesktopAdmin -Repository PSGallery | Install-Module -Force
Find-Module -Name xWinRm -Repository PSGallery | Install-Module -Force
$image = Get-ALimage -websession $websession|where{$_.name -eq "Accounting Win10"}
$imagedetail = Get-ALimagedetail -websession $websession -id $image.id
$osrev = $imagedetail.OsRev.Revisions.RevisionResult
$myimage = New-Object -TypeName PSObject
#Operating System
$OS = [PSCustomObject]@{
NAME = $imagedetail.OsRev.name
ID = $imagedetail.OsRev.Revisions.RevisionResult.Id
IMAGEID = $imagedetail.OSrev.ImageId
@ryancbutler
ryancbutler / RunJenkins.ps1
Created August 6, 2018 13:54
Build Jenkins Job PS
$JenkinsURL = "192.168.4.20:8080/"
$JobName = "UpgradeDesktop"
$Username = "rbutler"
$Token = ""
$full = "http://" + $jenkinsurl + "/job/" + $jobname + "/build"
$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $username,$token)))
$ParamsJSON = ConvertTo-Json -InputObject $JenkinsParams
Invoke-RestMethod -uri $Full -Method POST -Body @{ json = $ParamsJSON } -Headers @{Authorization=("Basic {0}" -f $base64AuthInfo)}
Write-Verbose "Starting VM Tools Installs" -Verbose
$UnattendedArgs = '/S /v /qn REBOOT=R'
$filepath = "$($env:SystemRoot)\temp\"
$url = "https://packages.vmware.com/tools/esx/latest/windows/x64/"
$link = invoke-webrequest $url -SessionVariable mysession
$link = $link.Links|Where-Object{$_.innerHTML -like "VMware*"}
$filename = ($link.href).Replace("x64/","")
Invoke-WebRequest -Uri ($url + $filename) -WebSession $mysession -OutFile "$filepath\$filename"
# Calico Version v3.3.1
# https://docs.projectcalico.org/v3.3/releases#v3.3.1
# This manifest includes the following component versions:
# calico/node:v3.3.1
# calico/cni:v3.3.1
# This ConfigMap is used to configure a self-hosted Calico installation.
kind: ConfigMap
apiVersion: v1
metadata:
@ryancbutler
ryancbutler / citrix-ingress.yml
Last active November 30, 2018 16:26
citrix-ingress.yml
---
kind: Namespace
apiVersion: v1
metadata:
name: citrix
labels:
name: citrix
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
#!/usr/bin/env python
import json, requests, base64, sys, os, re, socket
slack_url = "https://hooks.slack.com/services/###MYKEYHERE#####"
def main():
consul_stdin = json.load(sys.stdin)
getSVCStatus(consul_stdin)
$aplip = "192.168.1.100"
$pass = "mysupersecretpassword"
$username = "administrator"
$SecurePassword = ConvertTo-SecureString $Pass -AsPlainText -Force
$Credential = New-Object System.Management.Automation.PSCredential ($Username, $SecurePassword)
$websession = Connect-alsession -aplip $aplip -Credential $Credential -Verbose
#Final Array
$final = @()
@ryancbutler
ryancbutler / Update-AUPackages.md
Created July 15, 2019 16:10
Update-AUPackages Report #powershell #chocolatey
@ryancbutler
ryancbutler / Update-AUPackages.md
Created July 15, 2019 16:23
Update-AUPackages Report #powershell #chocolatey