new-object

Unexpected results when reusing a custom object for the pipeline

丶灬走出姿态 提交于 2020-02-04 17:00:30
问题 A while ago I changed my Join-Object cmdlet which appeared to cause a bug which didn’t reveal in any of my testing. The objective of the change was mainly code minimizing and trying to improve performance by preparing a custom PSObject and reusing this in the pipeline. As the Join-Object cmdlet is rather complex, I have created a simplified cmdlet to show the specific issue: (The PowerShell version is: 5.1.16299.248 ) Function Test($Count) { $PSObject = New-Object PSObject -Property @{Name =

Unexpected results when reusing a custom object for the pipeline

天大地大妈咪最大 提交于 2020-02-04 17:00:16
问题 A while ago I changed my Join-Object cmdlet which appeared to cause a bug which didn’t reveal in any of my testing. The objective of the change was mainly code minimizing and trying to improve performance by preparing a custom PSObject and reusing this in the pipeline. As the Join-Object cmdlet is rather complex, I have created a simplified cmdlet to show the specific issue: (The PowerShell version is: 5.1.16299.248 ) Function Test($Count) { $PSObject = New-Object PSObject -Property @{Name =

PowerShell Studio dynamic checkbox naming issue

对着背影说爱祢 提交于 2019-12-11 15:09:32
问题 giving the following PowerShell Studio Code, how can I call and disable the 'David Checkbox' under the 'Checkit' button. I know I am messing up on the checkbox declaration somehow because powershell does not recognize my checkbox as an object: The property 'Enabled' cannot be found on this object. Verify that the property exists and can be set. $accounts = "David", "Dave" $buttonLoadLabels_Click = { $CheckBoxCounter = 1 $accounts = 'didier','david' foreach ($account in $accounts) { $label =