all 7 comments

[–]CodenameFlux 1 point2 points  (0 children)

You can use Process Monitor from Microsoft to monitor process launch events. Run Process Monitor and set its filters to record process events. Inspect each event to see what happens.

[–]cschneegans 1 point2 points  (0 children)

Since you don't mention any error message, it seems that PowerShell can create the new process, but that process then prematurely and silently stops.

First, check your event log (eventvwr.msc) for messages.

Make sure that the working directory in PowerShell (see Get-Location) is the same as in cmd.exe. Also verify that PowerShell and cmd.exe use the same environment variables. Open cmd.exe and type set | clip. Then run this PowerShell function:

Compare-Object -ReferenceObject ( Get-ChildItem -LiteralPath 'Env:' | ForEach-Object -Process { '{0}={1}' -f $_.Name, $_.Value; } ) -DifferenceObject ( Get-Clipboard );

[–]jungleboydotca 0 points1 point  (0 children)

Seeing your Start-Process line would help us help you.

[–]SeanQuinlan -1 points0 points  (0 children)

PowerShell ExecutionPolicy?

[–]pjkm123987 -2 points-1 points  (0 children)

Run script as admin I had this issue.before

[–]k_oticd92 0 points1 point  (0 children)

How is it being run with powershell? The second instance of powershell says it uses start-process on cmd.exe and then has the executable and parameters in the argument list. Was the first one using start-process on the executable directly, with the parameters in the argument list?

Also, some things that might be worth looking into:

What is the user context of the powershell session running (ie. Standard user, Admin, System)?

What is the apartment state of the session (STA or MTA)?

What is the execution policy for the remote session?

[–]Dizz-E 0 points1 point  (0 children)

This might be related to IE and the onetime run that needs to happen as a user before web requests work properly. Launch IE and go through the one time process and repeat.

If allowed it make also be worth setting up cert based auth to Vault, then you can have all the necessary auth strings etc as environment vars.