Reputation: 4423
I am writing a script to install patches on Windows boxes. The best methodology I can find is to:
1) map a network drive 2) copy files over 3) install files 4) clean up and log 5) remove network drive
I can do all this except for number 3. How do I install/execute a file remotely via powershell? I want to avoid using PSEXEC; I'd like to use all that powershell has to offer.
Also, Is there a better way than I am seeing? I'd like to eventually expand this into something that would audit and see which patches are installed.
Upvotes: 0
Views: 1973
Reputation: 28174
invoke-item/invoke-command should work (depending upon how the patches are packaged) as long as you have remoting enabled.
However, it seems like you're trying to devise a solution to an already-solved problem in your last paragraph. WSUS & SCCM (or System Center, as they're calling it now) are designed to do exactly what you're asking for.
Upvotes: 1