error code:
Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation.
i want to display the messagebox (which is part of the script) on the host-computer while i'm running a remote command
here is my code:
Invoke-Command -ComputerName NAME -Credential USER -FilePath FILEPATH
i want to execute a script which is stored locally and display the messagebox
[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
$versioncheck = (get-host).Version.Major
If ($versioncheck -ge 3)
{[System.Windows.Forms.MessageBox]::Show("Aktuelle Version von PowerShell: $versioncheck", "Status") }
else
{[System.Windows.Forms.MessageBox]::Show("Aktuelle Version von PowerShell: $versioncheck. Dies entspricht nicht den Anforderungen!", "Status")}
He doesn´t show the message box! Please help me - sorry for my english.