Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    QtCreator Custom Process Step Powershell

    General and Desktop
    qtcreator
    2
    2
    1656
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      krobinson last edited by krobinson

      I am trying to add a custom process step to my project. I am trying to execute a powershell script.

      Command: Powershell
      Arguments: -File Script.ps1
      Working directory: %{sourceDir}

      This works fine, but the powershell script never exits.

      Write-Host "Test"
      Exit

      Even with this simple script, it will print Test and then just sits there. The build process will not complete after this.

      The only way I can get this to work is to kill the process using the following command in the powershell file

      Get-Process Powershell | Stop-Process

      This returns -1 however, so I have to wrap this in a batch file with EXIT /B. With all this in place it does seem to work, but it seems a little hacky for running a simple script. Does anyone have any ideas or suggestions about this?

      1 Reply Last reply Reply Quote 0
      • M
        mcosta last edited by

        Hi,

        try to pass -ExecutionPolicy Unrestricted as parameter.

        Once your problem is solved don't forget to:

        • Mark the thread as SOLVED using the Topic Tool menu
        • Vote up the answer(s) that helped you to solve the issue

        You can embed images using (http://imgur.com/) or (http://postimage.org/)

        1 Reply Last reply Reply Quote 0
        • First post
          Last post