1
Get-ADComputer -SearchBase "DC=some,DC=website,DC=net" -Filter * -Properties Name,Created,whenChanged,LastLogonDate,Description,IPv4Address,OperatingSystem,OperatingSystemServicePack,OperatingSystemVersion | Sort Description | Format-Table Name,Created,whenChanged,LastLogonDate,Description,IPv4Address,OperatingSystem,OperatingSystemServicePack,OperatingSystemVersion -Wrap | Out-File $env:USERPROFILE\Desktop\AD-Quick-Inventory.txt
The above code is what I want, but when outputted to a .txt file I only have 5 columns (stopping at description).
How do I allow for all the columns to be displayed.
I tried export-csv and it did export data I wanted, but it also exported a bunch of random properties I didn't select.
You have the -wrap parameter set. What happens if you remove that one? Also, are they maybe on multiple lines? – LPChip – 2018-03-05T17:51:09.327
have you tried to pipe to Out-String -Width 4096 first before pipe to Out-File – Antony – 2018-03-06T12:47:46.607
Its funny you mentioned Out-String because I found an article yesterday after posting that covers this exact topic. https://poshoholic.com/2010/11/11/powershell-quick-tip-creating-wide-tables-with-powershell/
– David Prentice – 2018-03-06T23:48:00.513out-file also has a width parameter, so no need for out-string (i guess) – SimonS – 2018-03-07T09:24:53.737