Last active
October 6, 2015 00:10
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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