OctopusDeploy / Library

| Public | A repository of step templates and other community-contributed extensions to Octopus Deploy
Other
171 stars 504 forks source link

Fixes #1392 #1393

Closed twerthi closed 1 year ago

twerthi commented 1 year ago

Background

Customer reported that older versions of PowerShell did not contain the UseBasicParsing argument. Template was coded to add argument for PowerShell versions less than or equal to version 5.

Results

The change checks to see if the cmdlet has the UseBasicParsing argument. If it does, it will be added. This should cover the scenarios of older versions of Powershell as well as when the argument is officially removed as it's marked as deprecated.

Before

The template would fail for customers trying to run on version 4 of PowerShell (Windows 2012 R2).

After

The Invoke-RestMethod cmdlet now completes successfully on PowerShell where the argument is present as well as missing.

Pre-requisites

Fixes #1392