Is there any approach to break line in the same column in a CSV constructed by PowerShell? For example
Role |Scope
--------------------
Role 01 |Scope 01
|Scope 02
--------------------
Role 02 |Scope 01
|Scope 03
I'm not sure if this is achievable. If not, what would be the supported format e.g. HTML?
[Updated] Below is my CSV object construct
class CsvObj {
[Object] ${Role}
[Object] ${Scope}
}
$roleList= Get-Role
$array = @()
ForEach ($role in $roleList) {
$roleObj = [CsvObj]::new()
$roleObj.Role = $role.Role
$roleObj.Scope = $role.Scope
$array += $roleObj
}
$array | Export-Csv -Path C:\file.csv
Each role may have more scopes and I'd like to group them properly.