8000 Compare-Baseline does not work as intended · Issue #68 · PoshSec/PoshSec · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Compare-Baseline does not work as intended #68

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jvucic opened this issue Nov 18, 2014 · 4 comments
Open

Compare-Baseline does not work as intended #68

jvucic opened this issue Nov 18, 2014 · 4 comments
Assignees
Labels
Milestone

Comments

@jvucic
Copy link
jvucic commented Nov 18, 2014

Run "Get-SecFileIntegrity", rename the output to $Copmputername-Integrity-Baseline.xml, then re-run "Get-SecFileIntegrity". Manually edit the newer file's text and save. Then create 2 objects ($new & $base), by using the Import-Clixml cmdlet. Then run...

Compare-Object -DifferenceObject $new -ReferenceObject $base -CaseSensitive

... it doesn't come back as having any difference, but if you change the Import-Clixml, to Get-Content, and recreate the two objects, and run this...

Compare-Object $new $base

... you can see the changes.

@mwjcomputing
Copy link
Member

Hey. Thanks for the feedback. I will work on pushing a fix in a few days. Let us know if you find anything else.

@jvucic
Copy link
Author
jvucic commented Nov 18, 2014

You can specify the property to be compared, and that gets you the results...

Compare-Object -DifferenceObject $new -ReferenceObject $base -CaseSensitive -Property Sha1Hash

... but the 8000 resulting formatting is garbage. I'm going to look at a friendly way to get what you're looking for. Will post back with revisions, once I have them ironed out. Really like your module though! :)

@mwjcomputing
Copy link
Member

Very cool. And I appreciate that you like the module. We will be getting back to developing more features for it soon.

@jvucic
Copy link
Author
jvucic commented Nov 18, 2014

Since (I'm pretty sure) you're using this for other comparisons, take a look at this. It gets all provided properties, from the imported XML's, and runs a comparison on each...

[System.Array]$local:approved = Import-Clixml -Path $BaselinePath
[System.Array]$local:installed = Import-Clixml -Path $ComparePath
$member = @()
$member = $local:approved | gm -MemberType property | select -ExpandProperty name
$member += $local:installed | gm -MemberType property | select -ExpandProperty name

[System.Array]$properties = $member | select -Unique
foreach ($property in $properties)
{
    $local:object = Compare-Object -ReferenceObject $local:approved -DifferenceObject $local:installed -CaseSensitive -Property $property -PassThru
    $local:object
}

@mwjcomputing mwjcomputing self-assigned this Nov 29, 2014
@mwjcomputing mwjcomputing added this to the Release 2.0 milestone Mar 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants
0