Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest 2.3.1 version of Requirements module throws an error about pipeline input for Invoke-Requirement #50

Closed
pcgeek86 opened this issue Nov 22, 2019 · 1 comment

Comments

@pcgeek86
Copy link

Reproduction

  • MacOS Catalina
  • PowerShell 6.2.3
  • Requirements module 2.3.1
$Requirements = @(
    @{
        Name = 'vscode-powershell'
        Describe = 'VSCode PowerShell Extension is installed'
        Test = { (code --list-extensions) -match 'ms\-vscode\.powershell' }
        Set = {
            $VSCodePowerShell = 'https://github.com/PowerShell/vscode-powershell/releases/download/v2019.9.0/PowerShell-2019.9.0.vsix'
            Invoke-WebRequest -OutFile ~/powershell.vsix -Uri $VSCodePowerShell
            code --install-extension ~/powershell.vsix
        }
    }
)

$RequirementsResult = $Requirements | Invoke-Requirement

Expected Result

Invoke-Requirement runs successfully.

Actual Result

Invoke-Requirement : The input object cannot be bound to any parameters for the command either because the command does not take pipeline input or the input and its properties do not match any of the parameters that take pipeline input.
At line:1 char:39
+ $RequirementsResult = $Requirements | Invoke-Requirement
+                                       ~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidArgument: (System.Collections.Hashtable:Hashtable) [Invoke-Requirement], ParameterBindingException
+ FullyQualifiedErrorId : InputObjectNotBound,Invoke-Requirement

Workaround

  • Downgrade to 2.2.7
  • I haven't tested other interim versions
@chriskuech
Copy link
Contributor

There were some design issues carried over from v1, so v2.3 introduced some breaking changes to fix these issues. As a result, we no longer support a Name property. Check out the Patterns section of the README to see how to best leverage the design improvements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants