Could anyone please offer me some hints? I am stuck with this problem.
I have developed a PowerShell script located in:
\\\ComputerNameA.xxx.xxx.local\d\xxx\script.ps1
This script requires 4 arguments to work. I need to run that script from another computer.
I have tried:
Invoke-Command -ComputerName ComputerNameA
-FilePath \\\ComputerNameA.xxx.xxx.local\d\xxx\script.ps1
-ArgumentList {-arg0 string -arg1 string -arg2 string -arg3 string}
Any hints will be appreciated.
Update:
As to answer my original question, I think the answer is:
Invoke-Command -ComputerName ComputerNameA -Credential $cred
-FilePath \\ComputerNameA.xxx.xxx.local\d\xxx\script.ps1
-ArgumentList {-arg0 string -arg1 string -arg2 string -arg3 string}
Now, the new problem is I got the access denied error even the credential is exist (i.e. I setup a new user account - abcd and set the password as abcd)