Remote Bat File

I am having trouble creating a persistent session open with a remote computer. The problem I am facing is I want to execute a .bat file on the remote computer which I can do no problem. The issue is that the .bat file has multiple commands within it that have to be ran on the machine, but are being kicked off on my local machine.

 

$session = New-PSSession -ComputerName DDS -Authentication Credssp -Credential $cred

Invoke-Command -Session $session {CMD /c D:\Test\Batches\test.bat}

Parents
No Data
Reply Children
No Data