Starting a process gives no visible window

We’ve got a deployment step where we need to start a particular process on one of our production boxes. I’m trying to use the following:

start-process -FilePath “$env:<executable” -verb runAs

But the process is starting with no visible window. Is there a way around this? Running the same powershell command locally on the box starts the process as expected.

Hi Chris,

Thanks for getting in touch! I believe there are two solutions for you here.
If you add -NoNewWindow to your current line hopefully it should start the process as expected.

The second is to change how you call it completely. Octopus already runs as administrator so you do not need the runAs.
So you could consider replacing your powershell line with & "$env:<executable" instead

Let me know how this goes!

Vanessa

Hi Vanessa,

Thanks for the reply but neither of those options worked. They both still start the process with no visible window.

Also, they both cause the deployment to wait for the process to finish, whereas this is an executable which needs to be running for the rest of the deployment. The original ‘start-process’ command simply starts the process and moves on immediately, which is what we need.

Regards

Chris

Hi Chris,

Thanks for trying those.

Could you give me a bit of an explanation about what you are trying to accomplish here and the deployment steps.
What we have maybe figured out is that you want a window to open after running your executable.
Where are you expecting the window to appear?

Vanessa

Hi Vanessa,

The executable in question is a manager, it runs alongside our system and starts and stops components as necessary.
When we do a deployment, we install the latest version of the software, which includes the manager executable. We then want to start the manager executable on one of our server machines. This will then start all the other components of the system.
If we can’t see the console window of the manager, it makes it difficult to identify what’s happening.

I hope this helps, let me know if you need any more information.

Regards

Chris

Hi Chris,

Yeah thanks for the information, but I don’t think we really have great news, sorry.
Octopus Server runs as a service account when it is doing it’s thing. Calling your manager through PowerShell isn’t going to give you what you want here.
Our only suggestion would be to include a manual step and manually call the manager at that point while on the target machine.

Vanessa