Execute .exe file thr remote in windows server RRS feed

  • Question

  • $s = New-PSSession -ComputerName local -Credential $creds

    Invoke-Command -Session $s -ScriptBlock{
    write-host "Service status"
    get-service -name WwanSvc


    Invoke-command $s -ScriptBlock{dci.exe}

    output:(without this line Invoke-command $s -ScriptBlock{dci.exe})

    This application has requested the Runtime to terminate it in an unusual way.
    Please contact the application's support team for more information.

    When I try to execute the above script I could able to hit the remote server and get the status of the services running but unable to execute dci.exe in it.Getting errored out saying 

    output:(when Invoke-command $s -ScriptBlock{dci.exe} is present)

    NotSpecified: (:String) [], RemoteException
    + CategoryInfo : NotSpecified: (:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

    can someone please let me know what I am  doing wrong.

    Thanks in advance

    • Moved by Bill_Stewart Wednesday, May 9, 2018 3:10 PM Unanswerable drive-by question
    Sunday, March 25, 2018 2:30 PM

All replies