Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QtCreator Custom Process Step Powershell
Forum Update on Monday, May 27th 2025

QtCreator Custom Process Step Powershell

Scheduled Pinned Locked Moved General and Desktop
qtcreator
2 Posts 2 Posters 1.9k Views
  • 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 Offline
    K Offline
    krobinson
    wrote on last edited by krobinson
    #1

    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
    0
    • M Offline
      M Offline
      mcosta
      wrote on last edited by
      #2

      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
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved