> I think your regex has multiple issues. I don't have time at the moment to really dig into it, but wanted to offer an alternative approach.
davnex opened this issue · 1 comments
davnex commented
> I think your regex has multiple issues. I don't have time at the moment to really dig into it, but wanted to offer an alternative approach.
switch -regex ($vssadmin){ "^\w.*'(?<Name>.*)'$" {$ht = @{Name = $matches.name}} "^\s+(?<Name>\w[\w\s]*): (?<Value>.*)$" { $ht.Add($matches.Name,$matches.Value) if($matches.Name -like '*err*'){ [PSCustomObject]$ht } } }
I miss some output with this code
Originally posted by @B-Art in PowerShell/PowerShell#19754 (comment)
andyleejordan commented
I don't understand why this was opened here.