# Install Windows Update Standalone Installer remotely

**URL:** <https://forums.powershell.org/t/install-windows-update-standalone-installer-remotely/8143>\
**Category:** PowerShell Help\
**Created:** [February 27, 2017, 5:25am UTC](https://forums.powershell.org/t/install-windows-update-standalone-installer-remotely/8143 "2017-02-27T05:25:14Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![powershelluser143](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/powershelluser143/32/524_2.png) [@powershelluser143](https://forums.powershell.org/u/powershelluser143)\
**Post date:** [February 27, 2017, 5:25am UTC](https://forums.powershell.org/t/install-windows-update-standalone-installer-remotely/8143/1 "2017-02-27T05:25:14Z")

</div>

Hello all I am trying to install an update using PowerShell my current line of code is as follows which is working in local machine

```
$path = "D:\mysoftware-x64.msu"
Start-Process "$($env:WINDIR)\system32\wusa.exe" -ArgumentList "$path /quiet" -Wait
```

I tried by using the invoke-coomand as follows

```
Invoke-command -computername ss -scriptblock { Start-Process "$($env:WINDIR)\system32\wusa.exe" -ArgumentList "$path /quiet" -Wait }
```

So can some one help me on this, I tried psexec but in vain

---

<div class="post-metadata">

**Author:** ![daniel-krebs](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/daniel-krebs/32/484_2.png) [@daniel-krebs](https://forums.powershell.org/u/daniel-krebs)\
**Post date:** [February 27, 2017, 5:54am UTC](https://forums.powershell.org/t/install-windows-update-standalone-installer-remotely/8143/2 "2017-02-27T05:54:58Z")

</div>

Unfortunately, the installation of Windows Updates doesn’t work in a PowerShell Remoting session.

Alternative options known to work are:

- PowerShell Desired State Configuration
- Transfer the update file onto the box, create and execute a scheduled task to install it
- Leverage tools like Ansible, Chef or Puppet

---

<div class="post-metadata">

**Author:** ![powershelluser143](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/powershelluser143/32/524_2.png) [@powershelluser143](https://forums.powershell.org/u/powershelluser143)\
**Post date:** [February 28, 2017, 12:22am UTC](https://forums.powershell.org/t/install-windows-update-standalone-installer-remotely/8143/3 "2017-02-28T00:22:16Z")

</div>

I don’t want to execute it as scheduled task, can you give me some idea on how to achieve this with DSC. I tried but it is asking for some mof files. I am getting error like The computer-specific MOF file for computer localhost does not exist in the current directory.

---

<div class="post-metadata">

**Author:** ![powershelluser143](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/powershelluser143/32/524_2.png) [@powershelluser143](https://forums.powershell.org/u/powershelluser143)\
**Post date:** [February 28, 2017, 1:44am UTC](https://forums.powershell.org/t/install-windows-update-standalone-installer-remotely/8143/4 "2017-02-28T01:44:11Z")

</div>

I tried this way but I got the exception saying when I run in remotely

> The WS-Management service cannot process the request. The CIM namespace root/Microsoft/Windows/DesiredStateConfiguration is invalid. + CategoryInfo : ObjectNotFound: (root/Microsoft/...gurationManager:String) [], CimException + FullyQualifiedErrorId : HRESULT 0x80338000 + PSComputerName : testmachine
> 
> The WS-Management service cannot process the request. The CIM namespace root/Microsoft/Windows/DesiredStateConfiguration is invalid.  
> + CategoryInfo : ObjectNotFound: (root/Microsoft/…gurationManager:String) , CimException  
> + FullyQualifiedErrorId : HRESULT 0x80338000  
> + PSComputerName : testmachine

```
Configuration V5Install
{
    node "$env:COMPUTERNAME"
    {

        LocalConfigurationManager
        {
            RebootNodeIfNeeded = $true
        }

        Package InstallPowerShell_V5
        {
            Name = "PowerShellV5"
            Path = "$($env:WINDIR)\system32\wusa.exe"
            ProductId = ""
            Arguments = "C:\Windows\Temp\W2K12-KB3134759-x64.msu /quiet"
        }
    }
}

V5Install -OutputPath $env:SystemDrive:\DSCconfig -Verbose
Set-DscLocalConfigurationManager -ComputerName $env:COMPUTERNAME -Path $env:SystemDrive\DSCconfig
Start-DscConfiguration -ComputerName $env:COMPUTERNAME -Path $env:SystemDrive:\DSCconfig -Wait -Force
```

---

<div class="post-metadata">

**Author:** ![powershelluser143](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/powershelluser143/32/524_2.png) [@powershelluser143](https://forums.powershell.org/u/powershelluser143)\
**Post date:** [February 28, 2017, 4:08am UTC](https://forums.powershell.org/t/install-windows-update-standalone-installer-remotely/8143/5 "2017-02-28T04:08:31Z")

</div>

Another try which I tested locally fails

```
Configuration V5Install
{
    node "$env:COMPUTERNAME"
    {

        LocalConfigurationManager
        {
            RebootNodeIfNeeded = $true
        }

        Package InstallPowerShell_V5
        {
            Name = "PowerShellV5"
            Path = "$($env:WINDIR)\system32\wusa.exe"
            ProductId = ""
            Arguments = "C:\Windows\Temp\W2K12-KB3134759-x64.msu /quiet"
        }
    }
}

V5Install -OutputPath $env:SystemDrive:\DSCconfig -Verbose
Set-DscLocalConfigurationManager -ComputerName $env:COMPUTERNAME -Path $env:SystemDrive\DSCconfig
Start-DscConfiguration -ComputerName $env:COMPUTERNAME -Path $env:SystemDrive:\DSCconfig -Wait -Force
```

Error message recieved

PowerShell DSC resource MSFT\_PackageResource failed to execute Set-TargetResource functionality with error message: The return code 1058 was not expected. Configuration is likely not correct + CategoryInfo : InvalidOperation: (:) [], CimException + FullyQualifiedErrorId : ProviderOperationExecutionFailure + PSComputerName : localhost

The SendConfigurationApply function did not succeed.  
+ CategoryInfo : NotSpecified: (root/Microsoft/…gurationManager:String) , CimException  
+ FullyQualifiedErrorId : MI RESULT 1  
+ PSComputerName : localhost

---

<div class="post-metadata">

**Author:** ![powershelluser143](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/powershelluser143/32/524_2.png) [@powershelluser143](https://forums.powershell.org/u/powershelluser143)\
**Post date:** [February 28, 2017, 6:33am UTC](https://forums.powershell.org/t/install-windows-update-standalone-installer-remotely/8143/6 "2017-02-28T06:33:40Z")

</div>

My remote machine doesn’t have PowerShell V5 installed can I execute DSC commands remotely

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:39pm UTC](https://forums.powershell.org/t/install-windows-update-standalone-installer-remotely/8143/7 "2024-05-16T20:39:11Z")

</div>

Closed on May 16, 2024, 8:39pm UTC


