title: PowerShell and Jar Execution
body: <p>I am trying to execute a jar file from PowerShell from a remote PowerShell session. Below is my current script block and it does not seem to work on remote machine. It appears that the jar file is picking up an anonymous credential but if I put a username command before the jar I get the actual user.</p>
  
  <pre class="lang-bsh prettyprint-override"><code>Invoke-Command -ComputerName "servera" -ScriptBlock {
      java -cp "multiplejars" main "arguments"
  } -Credential $global:credential
  </code></pre>
  
  <p>This is my current error.</p>
  
  <blockquote>
    <p>caused by: liquibase.exception.DatabaseException: com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user 'NT&nbsp;AUTHORITY\ANONYMOUS&nbsp;LOGON'. ClientConnectionId:7071e2b2-bad9-48db-b01a-d86665c783ff</p>
  </blockquote>