Last active
October 22, 2015 18:16
-
-
Save riezebosch/cc165872280e2506c5c6 to your computer and use it in GitHub Desktop.
Alle cursist computers in cursuslokaal
This file contains hidden or 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
function ForEach-Computer([int] $from, [int] $to, [ScriptBlock] $script) { | |
for ($i=$from; $i -le $to; $i++) { | |
$computername = "$($env:COMPUTERNAME -replace "DOCENT(?=.)", "CURSIST")$($i.ToString("00"))" | |
Write-Host $computername | |
Invoke-Command $script | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment