remoting inconsistency.

This topic contains 8 replies, has 2 voices, and was last updated by  John Curtiss 3 weeks, 3 days ago.

  • Author
    Posts
  • #101374

    John Curtiss
    Participant

    i'm an admin on a remote server where I've dropped an MSI into c:\scripts.

    if I go into a pssession on SERVER, I can just run

    ."c:\scripts\mymsi – fun.msi" '/qn'

    and the software gets installed.

    but

    invoke-command SERVER {."c:\scripts\mymsi – fun.msi" '/qn'}

    doesn't do anything (from my workstation, outside of the possession).

  • #101379

    Rohn Edwards
    Participant

    What about this?

    $Session = New-PSSession SERVER
    Invoke-Command $Session { & 'c:\scripts\mymsi - fun.msi" /qn }
    # Confirm it's finished
    $Session | Remove-PSSession
    

    Alternatively, what about this?

    Invoke-Command SERVER { Start-Process 'c:\scripts\mymsi - fun.msi' -ArgumentList '/qn' -Wait }
    
  • #101386

    John Curtiss
    Participant

    actually I was wrong. the pssession version in my original post is only working on one server. nothing so far in this thread has worked on any other server.

    both my pssession version and your invoke-command work on the original server I tested. they take about 10 seconds, and I can see the msinstaller events in the application log on the target server for the software getting installed.

    neither my pssession version, your pssession version, or my invoke-command version have any affect on the original target server I was testing.

    but and none of them work on any other server besides the original target server I was testing. ugh.

    • #101389

      Rohn Edwards
      Participant

      What OS is the remote server? Do you have any other servers besides the two you've mentioned you can test it on?

      Also, have you tried calling it with msiexec.exe instead of with the MSI directly:

      $Proc = Start-Process msiexec -ArgumentList '/i', 'c:\scripts\mymsi - fun.msi', '/qn' -PassThru
      while (-not $Proc.HasExited) { Start-Sleep -Seconds 10 }
      'Exit code: {0}' -f $Proc.ExitCode
      

      Does it work from a terminal if you're logged in directly to the server?

  • #101392

    John Curtiss
    Participant

    now this line from your pssession suggestion:

    Invoke-Command $Session { & 'c:\scripts\mymsi – fun.msi" /qn }

    is giving me "cannot run a document in the middle of a pipeline"

    but yours has a single opening quote and double closing quotes

    • #101395

      Rohn Edwards
      Participant

      Whoops. Yeah, that's my bad. One of the quotes needs to be changed to match the other one.

  • #101397

    John Curtiss
    Participant

    i'm getting the error even with the quotes corrected.

    • #101398

      Rohn Edwards
      Participant

      Then I'm not sure what's going on. Did you try the last suggestion to call msiexec.exe? Also, what version of Windows and PowerShell are you running on the problem server?

  • #101400

    John Curtiss
    Participant

    pumping the brakes here after running it locally on a trouble server. the MSI's "publisher can't be verified." I re-thought how I was putting the msi file onto the machines.

    this seems to be working now.
    Invoke-Command SERVER { Start-Process 'c:\scripts\mymsi – fun.msi' -ArgumentList '/qn' -Wait }

    thank you for your help.

You must be logged in to reply to this topic.