Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

How do I format a custom PSObject correctly when I write to a text file?

$
0
0

Hello,

The intent is to take a custom PSObject and format it correctly and 'nicely' in an output file.  When I execute the following, I get 3-4 spaces in between my output. One space between each line would work, or how do I format the output so I get one line across?  Anyways, 'well formed' and easy to read output is what Im looking for here.

New-Object PSObject -Property @{WhenRun=$DateTime;

                                                  SamAccountName=$UA.Name;

                                                  ADAttr=$UA.objectGUID | FL | out-file myfile.txt -append


Thanks for your help! SdeDot


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>