Created
June 9, 2016 15:19
-
-
Save anonymous/e8d40244a299a425802763f568fb04af to your computer and use it in GitHub Desktop.
statuschange
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.csv" | select Stig, Vkey, Status | |
$Current = import-csv "Current.csv" | select Stig, Vkey, Status | |
$AssignedNumbers = @() | |
ForEach ($key in $Past) | |
{ | |
$vkey = $key.vkey | |
$stig =$key.stig | |
$status = $key.status | |
foreach($key2 in $current) | |
{ | |
$status2 = $key2.Status | |
$stig2 = $key2.stig | |
$vkey2 = $key2.Vkey | |
} | |
If (($status -match 'Open') -AND ($status2 -notmatch 'Open')) | |
{ | |
$AssignedNumbers += New-Object PsObject -Property @{STIG=$stig;Vkey =$Vkey;Status =$status2} | |
} | |
Elseif (($status -match 'closed') -AND ($status2 -match 'Open')) | |
{ | |
$AssignedNumbers += New-Object PsObject -Property @{STIG=$stig;Vkey =$Vkey;Status =$status2} | |
} | |
} | |
$AssignedNumbers | select "stig","vkey","status" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment