Академический Документы
Профессиональный Документы
Культура Документы
$Form.controls.AddRange(@($compnameTxtbox,$Label1,$result,$pingButton,$closeButton,
$restartButton))
#endregion GUI }
function ping(){
$result.text += "`r`n" + "Pinging " + $compnameTxtbox.text
if(test-connection $compnameTxtbox.text){
$result.text += "`r`nConnection successfull"
}else{
$result.text += "`r`nConnection Failed"
}
}
function restart(){
$result.text += "`r`n" + "Restarting " + $compnameTxtbox.text
Restart-Computer -ComputerName $compnameTxtbox.text -Force
$result.text += "`r`n" + $compnameTxtbox.text + " restarted"
}
function closeForm(){$Form.close()}
[void]$Form.ShowDialog()