Skip to content

Instantly share code, notes, and snippets.

@jonathanelbailey
Last active October 6, 2015 00:10
Show Gist options
  • Save jonathanelbailey/1af6cc4f5828471650e6 to your computer and use it in GitHub Desktop.
Save jonathanelbailey/1af6cc4f5828471650e6 to your computer and use it in GitHub Desktop.
A script that demonstrates the ease by which a windows machine can be provisioned using Chocolatey and PsRemoting.
$scriptblock = {choco.exe install adobereader -y
choco.exe install openoffice -y}
$servers = Get-ADComputer -Filter * -Properties * | Where-Object name -match $SomeName
foreach ($s in $servers){
$session = new-pssession $s
Invoke-Command -ScriptBlock $scriptblock -Session $session
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment