Skip to content

Instantly share code, notes, and snippets.

@jonathanMelly
Created March 12, 2019 15:28
Show Gist options
  • Save jonathanMelly/e775b7c2c0086df6ad1ad46b46961ec0 to your computer and use it in GitHub Desktop.
Save jonathanMelly/e775b7c2c0086df6ad1ad46b46961ec0 to your computer and use it in GitHub Desktop.
param([string]$room,[string]$exec)
for ($i =1;$i -ile 5; $i++) {
$target = $("INF-"+$room+"-M5" + "{0:00}" -f $i)
#ping -n 1 -w 5 $target > $null;
#$status = "NETWORK DOWN"
#if ($lastexitcode -eq 0){
# $status ="NETWORK OK"}
#echo $($target + " -> " + $status)
echo $("executing " + $exec + " on " + $target)
Invoke-Expression $($exec+" "+$target)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment