From ba4f4b66486b94c3e121b54a0bdcd0db68cdc1b8 Mon Sep 17 00:00:00 2001 From: Matt Wrock Date: Tue, 27 Sep 2016 01:24:55 -0700 Subject: [PATCH] run updates on nano --- scripts/nano_cleanup.ps1 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/nano_cleanup.ps1 b/scripts/nano_cleanup.ps1 index b8d976b..3959a85 100644 --- a/scripts/nano_cleanup.ps1 +++ b/scripts/nano_cleanup.ps1 @@ -2,6 +2,11 @@ Import-Module C:\windows\system32\windowspowershell\v1.0\Modules\Microsoft.Power Import-Module C:\windows\system32\windowspowershell\v1.0\Modules\Microsoft.PowerShell.Management\Microsoft.PowerShell.Management.psd1 Import-Module C:\windows\system32\windowspowershell\v1.0\Modules\Storage\Storage.psd1 +$sess = New-CimInstance -Namespace root/Microsoft/Windows/WindowsUpdate -ClassName MSFT_WUOperationsSession +Invoke-CimMethod -InputObject $sess -MethodName ApplyApplicableUpdates + +Dism.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase + $partition = Get-Partition -DriveLetter C $c_size = $partition.size $partition = Get-Partition -DriveLetter D