Microsoft
Software
Hardware
Network
Question : Output to file compare-object within powershell
Hello,
I have to files which both contain large lines with letters (sometimes over a 100) without any spaces between them.
With the following powershell command i compare them:
Compare-Object -referenceObject $(Get-Content c:\test2.txt) -differenceObject $(Get-Content c:\test1.txt) > test3.txt
the output is this:
InputObject SideIndicator
----------- -------------
iqn.2001-05.com.equallogic
:0-8a0906-
66571ff02-
b7300003b7
74947a-cfd
c01-2008-1
2-16-14:..
. <=
iqn.2001-05.com.equallogic
:0-8a0906-
66571ff02-
f3900003b7
a4947a-cfd
c01.exch.l
og-2008-..
. <=
the problem is that the output is cut off. But i need the hole string. Is there away to get the output with out being cutted off and maybe even with out the "sideindicator" and so on.
Preferable one txt file with 2 lines (or more depending ofcourse...)
Thanks!
regards
Answer : Output to file compare-object within powershell
Yes
Compare-Object -referenceObject $(Get-Content c:\test2.txt) -differenceObject $(Get-Content c:\test1.txt) | %{$_.Inputobject} | ft -auto | out-file test3.txt -width 150
Random Solutions
Scheduled task does run if it requires admin elevation
How do you save a .pst file in Outlook 2007 Beta 2?
Windows XP Home SP3 & WinLogon.exe
Outlook Reminder Pop-Ups in Citrix
pattern match in shell script
Password stored on Sybase (Encrypt/Decrypt) ?
Database security issue, can't access source database
Simple SQL Query Date Command
I keep getting "there is no citrix presentation server configured on the specified address" when using citrix outside of my network
VBA to add formula with relative reference as opposed to absolute.