Skip to content

Instantly share code, notes, and snippets.

Created June 9, 2016 14:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/4b5fa3e243f6f5198eff831da2bd4316 to your computer and use it in GitHub Desktop.
Save anonymous/4b5fa3e243f6f5198eff831da2bd4316 to your computer and use it in GitHub Desktop.
Status Change
$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