I am working on some code and I thought the Get-Unique cmdlet would be a perfect match for what I am trying to accomplish. I cannot get it to work though tried many different ways to get the output to write to a file but it does not work. What I need to do is search through a file and get the unique ip addresses and write those to a different file. The follow is what I have so far everything works except the last two lines. Any help would be greatly appreciated.
$DUPIP1=Compare-Object-ReferenceObject $(get-contentf:\globalscape\Powershell\TEST.csv)
-DifferenceObject $(get-contentf:\globalscape\powershell\PROD.csv)
Write-output
$DUPIP1
$DUPIP2
=Compare-Object-ReferenceObject $(get-contentf:\globalscape\Powershell\TEST.csv)
-DifferenceObject $(get-contentf:\globalscape\powershell\QTS.csv)
Write-output
$DUPIP2
$DUPIP3
=Compare-Object-ReferenceObject $(get-contentf:\globalscape\Powershell\PROD.csv)
-DifferenceObject $(get-contentf:\globalscape\powershell\QTS.csv)
Write-output
$DUPIP3
Out-File
f:\globalscape\powershell\output.csv-Encodingascii-append-InputObject$DUPIP1
-NoClobber
Out-File
f:\globalscape\powershell\output.csv-Encodingascii-append-InputObject$DUPIP2
-NoClobber Out-File
f:\globalscape\powershell\output.csv-Encodingascii-append-InputObject$DUPIP3-NoClobber
Get-Unique
-InputObjectF:\GlobalScape\Powershell\output.csv-Outvariable+out
Write-output
outF:\GlobalScape\Powershell\finaloutput.csv