Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
ncheymol authored Jun 1, 2022
1 parent 2d356b2 commit 0ff84d1
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Intune/Intune-ForceWindowsUpdate.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Start-Transcript -Path "c:\ProgramData\Microsoft\IntuneManagementExtension\Logs\force-windowsupdate.log"
if ((Get-PackageProvider | where Name -EQ Nuget) -eq $null)
{
Install-PackageProvider -Name NuGet -Force -verbose
timeout 10
}

if ((Get-Module -Name PSWindowsUpdate) -eq $null)
{
Install-Module -Name PSWindowsUpdate -Force -verbose
timeout 10
}

Import-Module PSWindowsUpdate
Get-WindowsUpdate -Install -AcceptAll -IgnoreReboot -verbose
Write-host $LASTEXITCODE
stop-transcript

0 comments on commit 0ff84d1

Please sign in to comment.