This code below is for one of my scripts that I am trying to automate. I am dealing with the rows and all the data that is in those rows. What I am trying to do is make this look neater and maybe adding some different variables to make it look decent.
Foreach ($row in $csv) {
If ($row.Type0 -eq 'Domain') {
$row."Unique Account Name" = "$($row.Domain0) - $($row.Account0)"
If ($row."Unique Account Name" -in @('ACCOUNTS - DODSCAN'.'ACCOUNTS - Domain Admins','ACCOUNTS - LADM_WS_Admins','ACCOUNTS - Tech Enterprise'))
{$row."Excluded" = "True"}
Else {$row."Excluded" = "False"}
}
Else {
$row."Unique Account Name" = "$($row.Netbios_name0) - $($row.Account0)"
If ($row."Account0" -in @('esrxadm1n_esi','#Update','medco_tech','medco_admin'))
{$row."Excluded" = "True"}
Else {$row."Excluded" = "False"}
}