Created
June 9, 2016 14:36
-
-
Save anonymous/4b5fa3e243f6f5198eff831da2bd4316 to your computer and use it in GitHub Desktop.
Status Change
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
$Past = Import-csv "Past 51.csv" | select Stig, Vkey, Status | |
$Current = import-csv "Current 51.csv" | select Stig, Vkey, Status | |
$AssignedNumbers = @() | |
ForEach ($key in $Past) | |
{ | |
$vkey = $key.vkey | |
$stig =$key.stig | |
$status = $key.status | |
$Keymatch = $Current| where {$_.vkey -eq $vkey} | |
$statusdifference = $current | where {$_.status -eq $status} | |
$currentstatus = $Current | where {$_.status} | select status | |
If($Keymatch -ne $statusdifference) | |
{ | |
#Process the data | |
$AssignedNumbers += New-Object PsObject -Property @{STIG=$stig;Vkey =$Vkey;Status =$currentstatus} | |
} | |
} | |
$AssignedNumbers | select "stig","vkey","status" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment