title: Sending multiple commands with psexec
body: <p>I'd like to condense</p>
  <pre><code>psexec \\server taskill /f /t /fi &quot;USERNAME eq $username&quot; /im soffice*
  psexec \\server taskill /f /t /fi &quot;USERNAME eq $username&quot; /im swriter*
  psexec \\server taskill /f /t /fi &quot;USERNAME eq $username&quot; /im scalc*
  psexec \\server taskill /f /t /fi &quot;USERNAME eq $username&quot; /im simpress*
  </code></pre>
  <p>Into one psexec command. Normally I'd try the <code>&amp;</code> operator to do <code>so &amp; so</code> but since I'm doing this all in PS, it doesn't seem to like that. I tried an array of <code>()</code> and <code>&quot;&quot;</code> but it doesn't seem to like those either.</p>
  <h2>EDIT [answer]</h2>
  <p>Ended up just copying a <code>.cmd</code> (BAT) file and making a shortcut in my <code>$PROFILE</code> locally.</p>
  <pre><code>function flushlibra
  {
  param([string]$user = &quot;&quot;)
  if ($user -eq &quot;&quot;)
  {
      $user = Read-Host &quot;User to nuke LibraOffice proccesses: &quot;
  }
  
  psexec -c &quot;\\unc\path\to\flushlibra.cmd&quot; $user
  }
  </code></pre>
  <p><code>.cmd</code> file</p>
  <pre><code>taskkill /f /t /fi &quot;USERNAME eq %1&quot; /im soffice*
  taskkill /f /t /fi &quot;USERNAME eq %1&quot; /im swriter*
  taskkill /f /t /fi &quot;USERNAME eq %1&quot; /im scalc*
  taskkill /f /t /fi &quot;USERNAME eq %1&quot; /im simpress*
  </code></pre>