Invoke-Command not working when run remotely RRS feed

  • Question

  • If I run the following two commands locally on a machine, it works:

    I manually run this first: Get-Process pptview | Stop-Process -force (this shuts down powerpoint)

    I manually run this next: Invoke-Item  'C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp\hr_loop.lnk' (this launches a shortcut to a powerpoint presentation)

    Now, if I run the following test.ps1 from my machine (all it contains is the 2 lines above) all it will do is the complete the first task (shut down powerpoint), not the second item.

    I get no error. I've had 2 other folks look at this. We are missing something simple.

    Invoke-Command -ComputerName nameofremotepc 'C:\scripts\test.ps1'

    I cannot figure out why when running it remotely and using a script only the first part works.

    Thursday, August 10, 2017 11:01 PM


All replies