Running cscript remotely via Invoke Command?

Hello , here I have a script that for some reason is not working

$cpName = Read-Host "hostname" $package = Read-Host "pack.ID f.e.: 0233" $ver = Read-Host "package version f.e.: 1.2.0" Invoke-Command -ComputerName $cpName -ScriptBlock {cscript %path%install.vbs /p:$package /v:$ver} 

Script isnt working especially it wont connect to computer for some reason could you please help me ? If I run remote cmd on target machine and then run cscript its working without problems

submitted by /u/ItsAnnonymousHere
[link] [comments]

Leave a Reply