Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

$input type in advanced functions #1563

Copy link
Copy link
@vors

Description

@vors
Issue body actions

We have a test for $input type behavior in advanced functions (functions that are cmdlets).

It '$input Type should be enumerator' {
        function from_begin { [cmdletbinding()]param() begin { Write-Output -NoEnumerate $input } }
        function from_process { [cmdletbinding()]param() process { Write-Output -NoEnumerate $input } }
        function from_end { [cmdletbinding()]param() end { Write-Output -NoEnumerate $input } }

        (from_begin) -is [System.Collections.IEnumerator] | Should Be $true
        (from_process) -is [System.Collections.IEnumerator] | Should Be $true
        (from_end) -is [System.Collections.IEnumerator] | Should Be $true
    } 

It '$input Type should be enumerator' {

This tests works fine in PS v2. Since then, the behavior changed to this

        (from_begin) -is [System.Collections.ArrayList] | Should Be $true
        (from_process) -is [System.Collections.ArrayList] | Should Be $true
        (from_end) -is [System.Object[]] | Should Be $true

Which is pretty inconsistent, but exists since v3.

@lzybkr was trying to fix it (back to v2 behavior) and it broke a couple customer scenarios.

Plan: we will gover feedback about this issue and may consider go thru breaking change process.
Meanwhile, I'm marking the test as -Skip

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Breaking-Changebreaking change that may affect usersbreaking change that may affect usersCommittee-ReviewedPS-Committee has reviewed this and made a decisionPS-Committee has reviewed this and made a decisionResolution-By DesignThe reported behavior is by design.The reported behavior is by design.WG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.