You administer 100 Windows 8 laptops, all of which have PowerShell Remoting enabled.
You run the following command on a computer named Computer1.
Invoke-Command -filepath \\Computer2\Share\MyScript.ps1 -computer name Computer2
MyScriptl.psl fails to execute.
You verify that you are able to access it from the network.
You need to be able to execute MyScriptl.psl on Computer1.
What should you do?
A.
Copy MyScriptl.psl to a local drive on Computer1 and run the Invoke-Command cmdlet on
Computer1.
B.
Run the Set-ExecutionPolicy cmdlet on Computer1.
C.
Run the Enter-PSSession cmdlet on Computer1.
D.
Run the Set-ExecutionPolicy cmdlet on Computer2.
Answer A.
https://technet.microsoft.com/en-us/library/hh849719.aspx?f=255&MSPPError=-2147217396
Relevant quote from your link:
-FilePath
Runs the specified local script on one or more remote computers. Enter the path and file name of the script, or pipe a script path to Invoke-Command. The script must reside on the local computer or in a directory that the local computer can access. Use the ArgumentList parameter to specify the values of parameters in the script.
I’m still in doubt.