I want to bold a particular row (for ex: row 1) present in CSV file but I cannot able to bold the row.
I imported a CSV file in a variable and used System.Windows.Form.Label method to bold the row in CSV file. I am unable to figure out what went wrong.
$c = Get-Content ".\Documents\test\test.csv"
$LabelComputer = New-Object System.Windows.Forms.Label
$LabelComputer.Text = $c | Select-Object -First 1
$LabelComputer.Font = [System.Drawing.Font]::new("Microsoft Sans Serif", 12, [System.Drawing.FontStyle]::Bold)
$LabelComputer.Text | Add-Content ".\Documents\test\new.csv"
Number | Message | Mobile 1 | hello | 1***6 2 | hi | 2**7
Expected: I expect the row 1 (1 hello 1**6) to be bold.
Output: Row1 is not getting bold.
Labelobject. It is not preserved when you write the text of theLabelobject back to a file. Not to mention that CSV doesn't support formatting anyway.