title: Passing Key Commands in powershell
body: <p>I'm a total noob at this so please forgive me if my question is silly.</p>
  <p>I have a script I use to remotely install .exe file on my network. The script has work fine without any issues until now. The updated version of the .exe now has a dialog box with &quot;Next&quot; that has to be clicked for the install to start.</p>
  <p>My script looks something like this:</p>
  <pre><code>        $computers = get-content &quot;Filepath&quot;
  
          foreach ($c in $Computers) {
  
     try { 
         if (test -path &quot;\\$c\C$\&quot;) {
         invoke-command - computername $c -scriptblock {cmd /c 
         &quot;Filepath.exe -s&quot;} Erroraction Stop -verbose - 
         InDisconnectedSession -SessionName $c 
         $job = receive-pssession -computername $c -Name $c 
  
         }
       catch {throw
       }
         }
  </code></pre>
  <p>My current .exe file that i'd like remote install no longer installs as the window now has a new &quot;Next&quot; button that has to be clicked to start the donwload/install process.</p>
  <p>I am stumped.</p>