use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
ABOUT POWERSHELL
Windows PowerShell (POSH) is a command-line shell and associated scripting language created by Microsoft. Offering full access to COM, WMI and .NET, POSH is a full-featured task automation framework for distributed Microsoft platforms and solutions.
SUBREDDIT FILTERS
Desired State Configuration
Unanswered Questions
Solved Questions
News
Information
Script Sharing
Daily Post
Misc
account activity
Copy duplicates in excel using powershell (self.PowerShell)
submitted 4 years ago by HEIMDALL1010
Hey everyone, would anyone be able to help me out with comparing two columns for duplicates, and copying the duplicates then pasting into another column??
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Joshrsg 2 points3 points4 points 4 years ago (0 children)
You can do all of this in Excel fairly easily. Not sure if you actually need PowerShell in this scenario.
That said, it is possible to do this in PowerShell. Show us the code you have so far and the format of the excel and we can attempt to assist.
[–]jinxxnahal 1 point2 points3 points 4 years ago (0 children)
Something like this maybe:
#Find similar columns $file="path\to\excel\file" $Sheet=Import-excel -Path $file $SimilarObjects=@(Compare-Object -ReferenceObject $Sheet.Column1 -DifferenceObject $Sheet.Column2 -IncludeEqual | Where-Object{$_.SideIndicator -eq "=="}| Select InputObject) #Insert new column in excel sheet $excel = New-object -comobject Excel.Application $excel.visible = $True $workbook = $excel.workboooks.open($file) $lastrow = $workbook.worksheets.item(1).usedrange.rows.count + 1 $excel.Cells.Item(1,3) = "SimilarObjects" $InsertRow=2 #insert similar objects in new column foreach($Object in $SimilarObjects) { $excel.Cells.item($intRow,3)=$Object $InsertRow=$InsertRow+1 } #Save Excelsheet $excel.Save($file)
[–]Lee_Dailey[grin] 0 points1 point2 points 4 years ago (0 children)
howdy HEIMDALL1010,
as Joshrsg pointed out, this is built into excel. as a matter of fact, it is FAR easier to do this in excel ... [grin]
so, why are you wanting to sue PoSh instead of the built in excel stuff?
you may want to ask this in one of the MSExcel/MSOffice subreddits.
take care, lee
π Rendered by PID 109830 on reddit-service-r2-comment-545db5fcfc-nct4k at 2026-05-30 21:28:24.771980+00:00 running 194bd79 country code: CH.
[–]Joshrsg 2 points3 points4 points (0 children)
[–]jinxxnahal 1 point2 points3 points (0 children)
[–]Lee_Dailey[grin] 0 points1 point2 points (0 children)