In Invoke-CMDownloadBIOSPackage.ps1 function Invoke-CMDownloadContent uses double quotes in the ValidatePattern clause which causes problems for some versions of PowerShell. Switching to use single quotes allows it to run on a wider variety of PowerShell versions.
Original:
function Invoke-CMDownloadContent {
param (
[parameter(Mandatory = $true, ParameterSetName = "NoPath", HelpMessage = "Specify a PackageID that will be downloaded.")]
[Parameter(ParameterSetName = "CustomPath")]
[ValidateNotNullOrEmpty()]
[ValidatePattern("^[A-Z0-9]{3}[A-F0-9]{5}$")]
Fixed:
function Invoke-CMDownloadContent {
param (
[parameter(Mandatory = $true, ParameterSetName = "NoPath", HelpMessage = "Specify a PackageID that will be downloaded.")]
[Parameter(ParameterSetName = "CustomPath")]
[ValidateNotNullOrEmpty()]
[ValidatePattern('^[A-Z0-9]{3}[A-F0-9]{5}$')]
Thank you for the fix, however we don't support older versions of PowerShell like 2.0. I'll make this change anyway though since it doesn't really hurt.
In Invoke-CMDownloadBIOSPackage.ps1 function Invoke-CMDownloadContent uses double quotes in the ValidatePattern clause which causes problems for some versions of PowerShell. Switching to use single quotes allows it to run on a wider variety of PowerShell versions.
Original: function Invoke-CMDownloadContent { param ( [parameter(Mandatory = $true, ParameterSetName = "NoPath", HelpMessage = "Specify a PackageID that will be downloaded.")] [Parameter(ParameterSetName = "CustomPath")] [ValidateNotNullOrEmpty()] [ValidatePattern("^[A-Z0-9]{3}[A-F0-9]{5}$")]
Fixed: function Invoke-CMDownloadContent { param ( [parameter(Mandatory = $true, ParameterSetName = "NoPath", HelpMessage = "Specify a PackageID that will be downloaded.")] [Parameter(ParameterSetName = "CustomPath")] [ValidateNotNullOrEmpty()] [ValidatePattern('^[A-Z0-9]{3}[A-F0-9]{5}$')]
Other than the quote character, it is identical