Write-Output of class with hidden params regression in PS 7
See original GitHub issueSteps to reproduce
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.
class Empty {
MyClass() { }
[String]ToString() { return 'MyString' }
}
[Empty]::new()
# Will Show "MyString"
class Hidden {
hidden $Param = 'Foo'
MyClass() { }
[String]ToString() { return 'MyString' }
}
[Hidden]::new()
# On PS < 7 Will Show "MyString"
# On PS 7 Will Show "2 blank lines"
class Params {
$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.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
PowerShell stripping double quotes from command line ...
As an example, trying to use SqlCmd from SQL Server 2008, there is a -v parameter which takes a series of name:value parameters....
Read more >How to use powershell.exe with -Command using a ...
I am trying to run it PowerShell from either a command prompt, ... __GENUS : 2 __CLASS : __PARAMETERS __SUPERCLASS : __DYNASTY ...
Read more >regression - Linear model with hidden variable - Cross Validated
My question is: what can be estimated in this situation, and is there some well-known model? What form of parameters is most tractable,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is a regression caused by the
FirstOrDefault
primitive added early in PS7 preview.🎉This issue was addressed in #11258, which has now been successfully released as
v7.0.0-rc.1
.🎉Handy links: