
Untitled
By: a guest on
Aug 12th, 2012 | syntax:
None | size: 0.64 KB | hits: 7 | expires: Never
Different code depending on computer name. Most efficient process?
$a = hostname
switch ($a)
{
"WS001" { $sb = {dir} ; $txt = "Computer name: " + $a }
"WS003" { $sb = { get-process } ; $txt = "Computer name: " + $a }
default { $sb = $null ; $txt = "This Computer can't run this script"}
}
if ($sb) { &$sb }
$txt
$a = hostname
switch ($a)
{
"WS001" { $sb = {dir} ; $txt = "Computer name: " + $a ; break }
"WS003" { $sb = { get-process } ; $txt = "Computer name: " + $a; break }
default { $sb = $null ; $txt = "This Computer can't run this script"}
}
...