CrowdStrike / psfalcon

PowerShell for CrowdStrike's OAuth2 APIs
The Unlicense
353 stars 66 forks source link

[ BUG ] `Get-FalconContainerVulnerability` validation of `Package` fails in PowerShell Core #316

Closed bk-cs closed 10 months ago

bk-cs commented 1 year ago

Describe the bug The following error message is produced when attempting to follow the example for Get-FalconContainerVulnerability:

Get-FalconContainerVulnerability: Cannot validate argument on parameter 'Package'. Missing property ''.

Environment (please complete the following information):

Additional context This problem does not appear in PowerShell Desktop (i.e. PowerShell 5.1 on Windows).

bk-cs commented 1 year ago

This has been fixed for the 2.2.6 release. If you'd like to bypass this issue before the release, you can modify your public\image-assessment.ps1 file and comment out the validation for Package:

        [Parameter(ParameterSetName='/image-assessment/combined/vulnerability-lookups/v1:post',Position=2)]
        <#[ValidateScript({
            foreach ($Object in $_) {
                $Param = @{
                    Object = $Object
                    Command = 'Get-FalconContainerVulnerability'
                    Endpoint = '/image-assessment/combined/vulnerability-lookups/v1:post'
                    Allowed = @('layerindex','packageprovider','layerhash','packagehash','packagesource',
                        'softwarearchitecture','status','majorversion','product','vendor')
                }
                Confirm-Parameter @Param
            }
        })]#>
        [Alias('packages')]
        [object[]]$Package,
bk-cs commented 10 months ago

Resolved in 2.2.6 release which has been published to GitHub and will be published on the PowerShell Gallery soon.