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