How to: Add patches released between specifics dates to a Patch Group using PowerShell and the API feature

Version 3

    Purpose

     

    This document contains instructions on how to add patches released between specifics dates to a Patch Group using PowerShell and the API feature.

     

    Overview

     

    Basic Instructions:

     

         1. Download AddPatchesToPatchGroupUsingDateRange.zip from this document. (download link)

         2. Extract the contents of the .zip file to a folder on the console server.

         3. Read Disclaimer.txt.

         4. Open PowerShell as an administrator.

         5. Change directory to the extracted location.

         6. Execute the following to get help. This will provide parameters and instructions on how to use the PowerShell script.

     

    Get-Help .\AddPatchesToPatchGroupUsingDateRange.ps1 -full

     

    Examples:

     

    Add all patches released between to dates.

    .\AddPatchesToPatchGroupUsingDateRange.ps1 "Test" "1/1/2018" "1/31/2018" "ServerName\SQLInstance" "MyDatabase"

     

    Add all patches released within the last 30 days.

    .\AddPatchesToPatchGroupUsingDateRange.ps1 "Test" ((Get-Date).AddDays(-30)) (Get-Date) "ServerName\SQLInstance" "MyDatabase"

      

    Add security and non-security patches released within the last 30 days

    .\AddPatchesToPatchGroupUsingDateRange.ps1 "Test" ((Get-Date).AddDays(-30)) (Get-Date) "ServerName\SQLInstance" "MyDatabase" "0, 1, 4"

      

    Add .net and Java patches released within the last 30 days

    .\AddPatchesToPatchGroupUsingDateRange.ps1 "Test" ((Get-Date).AddDays(-30)) (Get-Date) "ServerName\SQLInstance" "MyDatabase" -productList ".net|Java"

      

    Add all patches except .net and Java released within the last 30 days

    .\AddPatchesToPatchGroupUsingDateRange.ps1 "Test" ((Get-Date).AddDays(-30)) (Get-Date) "ServerName\SQLInstance" "MyDatabase" -productList ".net|Java" -excludeProductList

     

    Additional Information

     

    API Quick Start Guide

     

    Affect Product

     

    Ivanti Patch for Windows Servers