I want to run a shutdown command on a remote computer, but I want the user to be prompted to accept or decline the command. This is what I have. It prompts the local user for the $computername, I need to run an input prompt on the remote computer user, then execute the shutdown script.
$server=read-host 'Enter Name'
$choice = ""
while ($choice -notmatch "[y|n]"){
$choice = read-host "Do you want to continue? (Y/N)"
}
if($choice -eq "y"){
shutdown /m \\$server /r /t 00
}
else {write-host "Please contact your systems administrator."}
invoke-commandand some winforms magic? I don't know