Posted On March 30, 2019

Window Update Via PowerShell

kimconnect 0 comments
blog.KimConnect.com >> Codes >> Window Update Via PowerShell
  • Set Proxy

netsh winhttp set proxy proxy-server="hqproxy:80" bypass-list="*.kimconnect.com;192.168.*.*;"
[Microsoft.Win32.Registry]::SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU","UseWUServer",0,[Microsoft.Win32.RegistryValueKind]::DWord)
restart-service wuauserv
  • Enable Windows Update Repository:

Set-ExecutionPolicy RemoteSigned -Force
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
Install-Module PSWindowsUpdate -Force
Add-WUServiceManager -ServiceID 7971f918-a847-4430-9279-4a52d1efe18d -Confirm:$false
Restart-Computer
  • Run Windows Update from PowerShell (repeat this command multiple times until no more updates are available):

Get-WUInstall -MicrosoftUpdate -AcceptAll -AutoReboot -IgnoreUserInput -Install -Confirm:$false

# Manual Download of Updates and Execute of any Failed packages
Import-Module BitsTransfer
$url = "http://download.windowsupdate.com/c/msdownload/update/software/updt/2019/01/windows10.0-kb4480977-x64_4630376d446938345665e2ce8379d96bb63a84c8.msu"
$output = "C:\temp\KB4480977.msu"
Start-BitsTransfer -Source $url -Destination $output
C:\temp\KB4480977.msu /quiet

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

LAMPP Passwords Change

Change ProFTP password: vim /opt/lampp/etc/proftpd.conf <?-- delete the last line in password, leave the first…

PowerShell: Manually Create Failover Cluster SMB Shares

# Set three variables$shareName="someShare"$smbServer="someClusteredVServer"$sharePath="S:\Shares\someShare"# Generate Domain Admins label$subdomain=(net config workstation) -match 'Workstation domain\s+\S+$' -replace '.+?(\S+)$','$1'$domainadmins="$subdomain`\Domain…

PowerShell: Remove IP Address Assignment Using Bluecat API

$bluecatUri='http://bluecat.kimconnect.com/Services/API' $bluecatUsername='svc-bluecat-api' $bluecatPassword='PASSWORD' $configId=17 $ipv4Address='10.10.162.54' $marker='toBeDeleted-' function confirmation($content,$testValue="I confirm",$maxAttempts=3){ $confirmed=$false; $attempts=0; $content|write-host write-host "Please review…