Home

Published

- 1 min read

Powershell Output string CSV format

img of Powershell Output string CSV format

The solution for this is noted below

Powershell Output string CSV format

Solution

   $A = "Hello";
$B = "World";

$wrapper = New-Object PSObject -Property @{ FirstColumn = $A; SecondColumn = $B }
Export-Csv -InputObject $wrapper -Path C:\temp\myoutput.txt -NoTypeInformation

Try other methods by searching on the site. That is if this doesn’t work