Request for assistance - PowerShell Output

%3CLINGO-SUB%20id%3D%22lingo-sub-1967163%22%20slang%3D%22en-US%22%3ERequest%20for%20assistance%20-%20PowerShell%20Output%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1967163%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20using%20Graph%20API%20to%20get%20some%20informations%20in%20tabular%20format%20and%20current%20output%20looks%20like%20this%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22gautameu_0-1607438012787.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F238652i509EB5A6607A6A47%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22gautameu_0-1607438012787.png%22%20alt%3D%22gautameu_0-1607438012787.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3BIn%20first%20table%20under%20%22licenseName%22%20column%2C%20I%20am%20translating%20%22License%20name%22%20to%20%22FriendlyName%22%20using%20%22replace%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3E%40%7BLabel%3D'LicenseName'%3BExpression%3D%7B%24(%24_.skuPartNumber%20-replace%20%24_.skuPartNumber%2C%24sku.Item(%24_.skuPartNumber))%7D%7D%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ewhere%20%24sku%20is%20like%20%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3E%24Sku%20%3D%20%40%7B%0A%20%22DEVELOPERPACK_E5%22%20%20%20%20%20%20%3D%20%22Developer%20Pack%20E5%20-%20from%20MSDN%22%3B%0A%20%22O365_BUSINESS_ESSENTIALS%22%20%20%20%20%20%20%3D%20%22Office%20365%20Business%20Essentials%22%3B%0A%20%22O365_BUSINESS_PREMIUM%22%20%20%20%20%20%20%3D%20%22Office%20365%20Business%20Premium%22%3B%0A%20%22DESKLESSPACK%22%20%20%20%20%20%20%3D%20%22Office%20365%20(Plan%20K1)%22%3B%0A%20%22DESKLESSWOFFPACK%22%20%20%20%20%20%20%3D%20%22Office%20365%20(Plan%20K2)%22%3B%0A%20%22LITEPACK%22%20%20%20%20%20%20%3D%20%22Office%20365%20(Plan%20P1)%22%3B%0A%20%22EXCHANGESTANDARD%22%20%20%20%20%20%20%3D%20%22Office%20365%20Exchange%20Online%20Only%22%3B%0A%20%22STANDARDPACK%22%20%20%20%20%20%20%3D%20%22Enterprise%20Plan%20E1%22%3B%0A%20%22STANDARDWOFFPACK%22%20%20%20%20%20%20%3D%20%22Office%20365%20(Plan%20E2)%22%3B%0A%20%22ENTERPRISEPACK%22%20%3D%20%22Enterprise%20Plan%20E3%22%3B%0A%20%22ENTERPRISEPACKLRG%22%20%20%20%20%20%20%3D%20%22Enterprise%20Plan%20E3%22%3B%0A%20%22ENTERPRISEWITHSCAL%22%20%3D%20%22Enterprise%20Plan%20E4%22%3B%0A%20%7D%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHowever%2C%20in%20other%20table%20below%2C%20column%20name%20%22Licenses%22%2C%20I%20cannot%20translate%20it%20to%20%22FriendlyName%22%20as%20it%20has%20multiple%20value.%20I%20tried%20several%20things%20but%20no%20luck%26nbsp%3B(using%20%22replace%22%20like%20above)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECan%20anyone%20please%20help%20me.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20thank%20you%20in%20advance%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1967163%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EWindows%20PowerShell%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Occasional Visitor

I am using Graph API to get some informations in tabular format and current output looks like this:

 

 

gautameu_0-1607438012787.png

 In first table under "licenseName" column, I am translating "License name" to "FriendlyName" using "replace"

 

 

@{Label='LicenseName';Expression={$($_.skuPartNumber -replace $_.skuPartNumber,$sku.Item($_.skuPartNumber))}}

 

 

 

where $sku is like :

 

 

 

$Sku = @{
 "DEVELOPERPACK_E5"      = "Developer Pack E5 - from MSDN";
 "O365_BUSINESS_ESSENTIALS"      = "Office 365 Business Essentials";
 "O365_BUSINESS_PREMIUM"      = "Office 365 Business Premium";
 "DESKLESSPACK"      = "Office 365 (Plan K1)";
 "DESKLESSWOFFPACK"      = "Office 365 (Plan K2)";
 "LITEPACK"      = "Office 365 (Plan P1)";
 "EXCHANGESTANDARD"      = "Office 365 Exchange Online Only";
 "STANDARDPACK"      = "Enterprise Plan E1";
 "STANDARDWOFFPACK"      = "Office 365 (Plan E2)";
 "ENTERPRISEPACK" = "Enterprise Plan E3";
 "ENTERPRISEPACKLRG"      = "Enterprise Plan E3";
 "ENTERPRISEWITHSCAL" = "Enterprise Plan E4";
 }

 

 

 

However, in other table below, column name "Licenses", I cannot translate it to "FriendlyName" as it has multiple value. I tried several things but no luck (using "replace" like above)

 

Can anyone please help me. 

 

I thank you in advance

 

 

0 Replies