title: Remote Execute command - No Wait
body: <p>This is the code:</p>
  
  <pre><code>$remotelastexitcode = Invoke-Command -ComputerName $fdt_server -Credential $Cred -ScriptBlock {
      Param($Rjava_path, $Rfdt_path, $Rfdt_log_folder, $Rfdt_log_filename)
  
      Invoke-Expression -Command:"cmd.exe /c 'start /B $Rjava_path -jar $Rfdt_path -S 1&gt;&gt; $Rfdt_log_folder\$Rfdt_log_filename.txt 2&gt;&gt;&amp;1 &amp; exit 0'";
  
      $LASTEXITCODE
  } -ArgumentList $java_path, $fdt_path, $fdt_log_folder, $fdt_log_filename -ErrorAction Stop
  
  # Force the result to an array, and then test just the last line, which will be
  # the last exit code. Anything echoed before that will be ignored.
  if (@($remotelastexitcode)[-1] -ne 0) {
      exit 1
  }
  </code></pre>
  
  <p>I would like to invoke</p>
  
  <pre><code>cmd.exe /c 'start /B $Rjava_path -jar $Rfdt_path -S 1&gt;&gt; $Rfdt_log_folder\$Rfdt_log_filename.txt 2&gt;&gt;&amp;1'
  </code></pre>
  
  <p>on the remote server <code>$fdt_server</code>, but not to wait for it to finish.
  Basically, I want it to just run it and keep going.</p>
  
  <p>How can I achieve this? I tried using <code>-AsJob</code> but does not seem to work.</p>