ajdinaliu
9/26/2015 - 2:06 PM

TST_TestReboot

TST_TestReboot

#HERE WE REBOOT
$message="Reboot?"
$caption=$message
$yes = new-Object System.Management.Automation.Host.ChoiceDescription "&Yes","Yes";
$no = new-Object System.Management.Automation.Host.ChoiceDescription "&No","No";
$choices = [System.Management.Automation.Host.ChoiceDescription[]]($yes,$no);

$answer = $host.ui.PromptForChoice($caption,$message,$choices,0)
switch ($answer){
    0 {Invoke-Reboot}
    1 {return $false;}
}