Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

PS1 is not working on remote machine

$
0
0


I am new to poweshell, I have this modified script running file on local PC but cannot use remote call . (Powershell remoting is enabled via GPO )

The script running fine at local host icm  -computername PClocal {c:\folder1\test.ps1}

but not working on remote PCs and no error by using the cmdlet below:

icm -computername pc1 -scriptblock {c;\folder1\test.ps1}


No error at all but just didn't install the software. I think either missing curly bracket or something.

All files are pushed to local C:\folder1 via GPO. I can see them but script  just won't pick them up. It works on my local PC.  

Can I use this one below, which  cause a loop, I am not sure what to put in there.

 

$exe = @('setup.exe','SW_Win7_64Bit.exe')

$msi = @('Service.Installer_Win7')

 

 foreach ($exefile in $exe) 

{start-process -FilePath "c:\folder1\setup\setup.exe" /s 

 start-process -FilePath "c:\folder1\software9000.exe" -ArgumentList "/qn" -Wait

 Start-Process -FilePath "c:\folder\Service.Installer_Win7.msi" -ArgumentList "/qn" -Wait 

}

write-host $file_path


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>