Skip to content

Parameter Binding Tests: Dynamic parameter is found even if globbed path does not exist #15600

@rjmholt

Description

@rjmholt

The following test is failing on Ubuntu 20.04 in PS 7.2.0-preview.7:

It 'Dynamic parameter is found even if globbed path does not exist' {
$guid = New-Guid
# This test verifies that the ErrorRecord is coming from parameter validation on a dynamic parameter
# instead of an error indicating that the dynamic parameter is not found
{ Copy-Item "~\$guid*" -Destination ~ -ToSession $null } | Should -Throw -ErrorId 'ParameterArgumentValidationError'
}

The error is:

Expected an exception, with FullyQualifiedErrorId 'ParameterArgumentValidationError' to be thrown, but the FullyQualifiedErrorId was 'NamedParameterNotFound,Microsoft.PowerShell.Commands.CopyItemCommand'. from /home/vsts_azpcontainer/PSPackage/download/Test/test/powershell/engine/ParameterBinding/ParameterBinding.Tests.ps1:264 char:47
+         { Copy-Item "~$guid*" -Destination ~ -ToSession $null } | Sh ?
+                                               ~~~~~~~~~~

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-BugIssue has been identified as a bug in the productNeeds-TriageThe issue is new and needs to be triaged by a work group.Release-TestingResolution-No ActivityIssue has had no activity for 6 months or moreWG-Quality-Testissues in a test or in test infrastructure

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions