You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Write-Output of class with hidden params regression in PS 7 #10554
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-FixedThe issue is fixed.WG-Enginecore PowerShell engine, interpreter, and runtime
In PS 6 and below if a class has only hidden params it will show the ToString() output like it do when there are no parameters. If there are non hiden params it shows them instead.
In PS 7 if a class has only hidden params it shows blank lines.
classEmpty {
MyClass() { }
[String]ToString() { return'MyString' }
}
[Empty]::new()
# Will Show "MyString"classHidden {
hidden$Param='Foo'
MyClass() { }
[String]ToString() { return'MyString' }
}
[Hidden]::new()
# On PS < 7 Will Show "MyString"# On PS 7 Will Show "2 blank lines"classParams {
$Param='Foo'
MyClass() { }
[String]ToString() { return'MyString' }
}
[Params]::new()
<# Will Show:Param-----Foo#>
Expected behavior
If there are only hidden params show the ToString() like in PS6
Actual behavior
If there are only hidden params it shows blank lines like it tries to show the params but have noting to show.
Is it possible to get a fix before PS7 go stable? as this was working in PS6 stable and it will be preferable not to lose functionality when upgrading to PS7.
Thank you Dongbo Wang (@daxian-dbw)Ilya (@iSazonov)
I see the regression was already in 7.0 Preview1.
Write-Host works as expected.
I don't know that is a root of the regression. May be in formatting system. /cc Steve Lee (@SteveL-MSFT)
This is not in the formatter. In the formatter, the MyString output has Hidden as a typename so it's deliberately hidden. Not sure where that is being set. In the parser, I can see that only $Param has the hidden attribute. cc Rob Holt (@rjmholt)
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-FixedThe issue is fixed.WG-Enginecore PowerShell engine, interpreter, and runtime
Activity
iSazonov commentedon Sep 17, 2019
Dongbo Wang (@daxian-dbw) Could you please look the issue?
ili101 commentedon Nov 27, 2019
Is it possible to get a fix before PS7 go stable? as this was working in PS6 stable and it will be preferable not to lose functionality when upgrading to PS7.
Thank you
Dongbo Wang (@daxian-dbw) Ilya (@iSazonov)
iSazonov commentedon Nov 28, 2019
I see the regression was already in 7.0 Preview1.
Write-Host works as expected.
I don't know that is a root of the regression. May be in formatting system. /cc Steve Lee (@SteveL-MSFT)
SteveL-MSFT commentedon Dec 2, 2019
This is not in the formatter. In the formatter, the
MyStringoutput hasHiddenas a typename so it's deliberately hidden. Not sure where that is being set. In the parser, I can see that only$Paramhas the hidden attribute. cc Rob Holt (@rjmholt)iSazonov commentedon Dec 3, 2019
We could try compiled artifacts to find a PR where the regression come but GitHub removes old ones.
daxian-dbw commentedon Dec 3, 2019
This is a regression caused by the
FirstOrDefaultprimitive added early in PS7 preview.