Created
March 20, 2018 15:24
-
-
Save Mehmet-Erkan/2c78caea1ad09b79040ba0ba9797aaca to your computer and use it in GitHub Desktop.
SharePoint compare list values with PowerShell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$mSite = Get-SPweb "http://sharepointed.com/site/taco" | |
$aList = $mSite.lists["A"] | |
$bList = $mSite.lists["B"] | |
$arrA = @() | |
$arrB = @() | |
foreach($iA in $aList.Items) | |
{ | |
$arrA += $iA["Title"] | |
} | |
foreach($iB in $bList.Items) | |
{ | |
$arrB += $iB["Title"] | |
} | |
$c = Compare-Object -ReferenceObject $arrA -DifferenceObject $arrB -PassThru | |
Write-Host $c |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment