search
Categories
Sponsors
VirtualMetric Hyper-V Monitoring, Hyper-V Reporting
Archive
Blogroll

Badges
MCSE
Community

Cozumpark Bilisim Portali
Comparing two array in PowerShell
Posted in Windows Powershell | No Comment | 3,126 views | 09/07/2015 18:05

You can use Compare-Object to compare two different arrays:

1
2
3
4
5
[array]$OldModules = @(1,2,3,4,5,6);
[array]$CurrentModules= @(1,2,4,5,6);
 
# Compare Modules
Compare-Object $OldModules $CurrentModules

If output of compare-object is null, it means two arrays are identical.



Leave a Reply