Monday, October 12, 2009

Powershell | Where Am I? [hostname]

$myhostname=gc env:computername

Write-Host "My host name:$myhostname."
$myhostname.ToUpper() # make all letters upper case

if($myhostname -eq "IIS-SERVER")
{
#TODO: IF I'M ON SERVER, DO SOMETHING
}

No comments:

Post a Comment