Important Notice: On February 29th, this community was put into read-only mode. All existing posts will remain but customers are unable to add new posts or comment on existing. Please feel to join our Community Discord for any questions and discussions.

Gui Powershell

Hi, We are to execute a ps1 file that displays a gui in the remote computer but we are getting the error

C:\WINDOWS\AdminArsenal\PDQDeployRunner\service-1\exec>powershell.exe -executionpolicy bypass -file "CustomRestart.ps1" Exception calling "ShowDialog" with "0" argument(s): "Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application." At CustomRestart.ps1:343 char:9 return $MainForm.ShowDialog() ~~~~~~~~~~~~~~~~~~~~~~ CategoryInfo : NotSpecified: (:) [], MethodInvocationException FullyQualifiedErrorId : InvalidOperationException

PS1--> https://gallery.technet.microsoft.com/scriptcenter/Custom-PowerShell-GUI-7c7fbda8

Is there any way we can get that gui to display in the remote computer?

0

Comments

3 comments
Date Votes
  • I believe that script is designed to be ran as the logged on user - which context is your package running the powershell step as? Step -> Options -> Run As...

    0
  • i executed with administrator priviliege

    0
  • Needs to run as deploy user (interactive). The account doing the deployments should be a service account with admin rights. That's the correct way to do this.

    0