I am using PS 2.0 and I am trying to display a textbox message and restart the computer and display a second textbox message.
[System.Windows.Forms.MessageBox]::Show("Restarting.") $RunOnceKey = "HKLM:\Software\Microsoft\Windows\CurrentVersion\RunOnce" set-itemproperty $RunOnceKey "ConfigureServer" ('C:\Windows\System32\WindowsPowerShell\v1.0\Powershell.exe -File "C:\sw\test.ps1"') Restart-Computer -ErrorAction stop [System.Windows.Forms.MessageBox]::Show("Yay.")
I think I need to add more to this, but I am not sure what.