Got this array I created in PS to create columns with other data. I want to put two sets of information in specific columns without generating them from variables.
Top rated companies | Company name |
---|---|
#1 rating | |
#1 rating | Apple |
#2 rating | Toshiba |
$Companies = @()
foreach ($Company in $RatedCompanies) {
$Companies += [PSCustomObject]@{
'Top rated companies' = '#1 rating'
'Company name' = $TopRated
}
$Companies+= [PSCustomObject]@{
'Top rated companies' = '#2 rating'
'Company name' = $WorstRated
}
}
Essentially, I want to put two company names into the #2 rating through PS so it looks like this:
Top rated companies | Company name |
---|---|
#1 rating | |
#1 rating | Apple |
#2 rating | Toshiba |
#2 rating | Tesla |
#2 rating | Sony |
Tesla and Sony would be strings. I’ve messed around with Add-Content, but no luck.
New contributor
greenGob19 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.