Trouble parsing string to object with PowerShell
问题 I have a string with structured data (see below). I need to take this string and convert it to an object, so I can export it to .csv (or whatever else is requested of me). I ran the following code: $data = $string -replace "\s*:\s*","=" But my output looks like this: City=Country=Department=DisplayName=John Doe DistinguishedName=CN=John Doe, CN=Users, DC=domain, DC=com EmailAddress=jdoe@domain.com Enabled=False Fax=GivenName=John MobilePhone=Name=John Doe ObjectClass=user ObjectGUID=cdb9a45c