cyberark / CYBRHardeningCheck

A utility to check CyberArk component servers hardening status
GNU General Public License v3.0
53 stars 24 forks source link

Ability to define used Drive OR check all drives (non-network mounted) #75

Open redboyhun opened 2 years ago

redboyhun commented 2 years ago

In Main.ps1 Line 408: Start-Job -Name FileCollection -ScriptBlock {Get-ChildItem -Path "$ENV:SystemDrive\*" -Include "InstallationAutomation" -Recurse -Directory -ErrorAction SilentlyContinue | Select-Object -First $args[0] } -ArgumentList $TotalComponentsFound | Out-Null

Please take into consideration that the searched folder and files might be on another drive than the SystemDrive. It would be nice if the user would have option to define the drive, where to look for that, or check all the available non-network mounted drives.

AssafMiron commented 2 years ago

Hey @redboyhun ,

Would it be correct to assume that if it is not on the system drive, these folders would be on the same drive the components are installed on?

redboyhun commented 2 years ago

Would it be correct to assume that if it is not on the system drive, these folders would be on the same drive the components are installed on?

in our case the assumption is correct, but I can imagine that it differs, like Apps on C: and Install files on D: and so on. Maybe instead of error just write a warning if the path is not found.