Quantcast
Channel: Active questions tagged powershell-3.0 - Stack Overflow
Viewing all articles
Browse latest Browse all 122

Get full stack trace from remote session

$
0
0

I'm using Invoke-Expression under remote session and when throws exception - it returns just RemoteException without any stack trace information. Example:

try{    Invoke-Expression "$command 2>&1"}    catch{    Write-Host $_    }

If I exclude redirect error to output(2>&1) - I'm getting proper error but it call unwanted debug console(from $command), which is hidden using redirection.

Start-Process -NoNewWindow -FilePath $CmdExe -ArgumentList $Arguments

Using Start-Process I can see full stack trace but also have unwanted debug console.

How can I get a full stack trace and proper Exception from thrown exception under remote session?Thanks.


Viewing all articles
Browse latest Browse all 122

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>