Installing a KB from a remote computer to localhost

Hi everyone, Thanks for stopping by :slight_smile:

 

I’m having some difficulties to install a KB that it situated on a remote computer to the localhost.

Here is what I launch on the localhost:

[pre]

if ($global:windows7 -eq “true”){
$kbcheck = systeminfo.exe | findstr kb2852386
$kbcheck
if (!$kbcheck) {get-hotfix -id kb2852386 -computername “\path to the folder where the kb is stored\CleanMgr_KB2852386”}
}

[/pre]

 

 

I’me pretty sure I’m not doing what I’m supposed to do right there, but I’m having a lot of trouble finding how installing through get-hotfix is supposed to work

The parameter -ComputerName takes one or more computer names. Did you read the help for Get-HotFix? I’m afraid it does not do what you expect it to do. It lists the installed hotfixes on the local or one or more remote computers. You should read the complete help including the examples to learn how to use it.

That’s what i was thinking yeah. i read it but i couldn’t find an installation part, so yeah, it doesn’t install anything.

Back to the drawing board then. thank you.

Why would you actually expect to get something installed when the cmdlet starts with “Get”? I’d expect this behaviour only when the cmdlet starts with “Install” or “Add” or “Invoke” or “Push” or “Publish” or “Set” … but not with “Get”. :wink:

Remote deployment is a never-ending headache on Windows. You will probably not be able to install the KB on a remote system while keeping the file on the local system, but you should be able to copy the KB to the remote machine and then remotely execute the installation via PowerShell. Here are two examples: