Click here to Skip to main content
15,885,745 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All

Below is the code what i am doing how and writing the data in a CSV file

HTML
$Obj = New-Object -TypeName PSObject -Property @{"ComputerName" = $ComputerName
                                                     "BelongsToOU" = $OUMainName}
Add-content $OutPath -Value $Obj


But in the CSV i am getting the data in a single line.

Please tell me how to get the data in columns like ComputerName one column and BelongsToOU another.

What I have tried:

HTML
$Obj = New-Object -TypeName PSObject -Property @{"ComputerName" = $ComputerName
                                                     "BelongsToOU" = $OUMainName}
Add-content $OutPath -Value $Obj
Posted

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900