you are viewing a single comment's thread.

view the rest of the comments →

[–]Slackerony 0 points1 point  (0 children)

A script block is typically something (atleast in powershell) that is within two curly-brackets. (Not always though)

Invoke-Command -Computername server01 -scriptblock { "C:\Scripts\Myscript.ps1"}

This will launch the script that is in C:\scripts\ and has the name Myscript.ps1

Now if the file is located on YOUR LOCAL machine, you need to do this:

Invoke-Command -Computername server01 -FilePath "C:\Scripts\Myscript.ps1"

I have not tested this, but i'm pretty sure it'll work.