CmdLets/Sync-WindowsUpdates.ps1

Function Sync-WindowsUpdates 
 {

    [CmdletBinding()]
    Param (
        [Parameter(Mandatory=$True)]$Updates,
        [Parameter(Mandatory=$True)]$Session
    )
    $Downloader = $Session.CreateUpdateDownloader()
    $Updates | ForEach-Object {
        $i++
        Write-Host "Downloading $i of $($Updates.Count()): $($_.Title)"
        $UpdatesToDownload = New-Object -Com Microsoft.Update.UpdateColl
        if ($_.Title -NotLike "*Feature Update*")
        {
            $updatesToDownload.Add($_) | out-null
        }
        $Downloader.Updates = $UpdatesToDownload
        $Downloader.Download() | out-null
    } 

}