'Exporting a Powershell object containing multiple arrays to CSV/Power BI

It's Friday and my brain's just not working! I have a Powershell object which is the result of DSInternals Test-PasswordQuality cmdlet that I'd like to use as a Power BI dataset; it's a bunch of arrays of user accounts, ex.

ClearTextPassword          : {}
LMHash                     : {someuser, another user...}
EmptyPassword              : {someuser, another user}
WeakPassword               : {someuser, another user...}
DefaultComputerPassword    : {etc...}
PasswordNotRequired        : {etc...}
PasswordNeverExpires       : {etc...}
AESKeysMissing             : {etc...}
PreAuthNotRequired         : {}
DESEncryptionOnly          : {}
Kerberoastable             : {}
DelegatableAdmins          : {}
SmartCardUsersWithPassword : {}
DuplicatePasswordGroups    : {}

I'd like to export this to one csv where each array is its own column. If I simply do

$result | export-csv .\result.csv -NoTypeInformation

I do get a column for each array, but then the users in each column are all combined into one cell.

example of first few columns

How can I get the same, but with each user in it's own cell?

OR, how can I get this PS object directly into a Power BI dataset with maybe the MicrosoftPowerBIMgmt module?

Thanks a million y'all!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source