Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Remote Bat File

$
0
0

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-ComputerNameDDS-AuthenticationCredssp-Credential$cred

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


Viewing all articles
Browse latest Browse all 6937

Trending Articles