Skip to content

Minor Improvement to Get-SuspiciousFiles#239

Merged
bill-long merged 4 commits into
microsoft:mainfrom
nashiooka:main
Mar 10, 2021
Merged

Minor Improvement to Get-SuspiciousFiles#239
bill-long merged 4 commits into
microsoft:mainfrom
nashiooka:main

Conversation

@nashiooka
Copy link
Copy Markdown
Contributor

Issue:
Nothing specific.

Reason:
Minor readability and performance improvements.

Fix:

Store various filter strings and paths in variables for easier reference.
Consolidate 2 ForEach() loops used for searching for lsass.*dmp files to 1 loop ForEach-Object{} referencing an array of the 2 paths.
Convert ForEach() loop searching for archive files to ForEach-Object{}
Use the same loop with an if block to substitute for original Where{}. This approach is usually faster and is ideal since already using ForEach-Object{}

Validation:
Tested by creating bogus .dmp & archive files in relevant locations. Seems to work.

@bill-long bill-long self-requested a review March 10, 2021 17:20
@bill-long bill-long merged commit 30bc55c into microsoft:main Mar 10, 2021
@bill-long
Copy link
Copy Markdown
Member

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants