PowerShell prompts that are launched as Administrator default to C:\Windows\System32 as the working directory. When OCCAM attempts to discovery .Rule.ps1 files, it does so recursively, which can return errors when attempting to search parts of System32 that the PowerShell process does not have access to.
We can either:
Warn users when running in C:\Windows\System32 that they need to run OCCAM somewhere else
Add a special case that does a non-recursive search in C:\Windows\System32
Catch and silence the errors when in C:\Windows\System32
PowerShell prompts that are launched as Administrator default to
C:\Windows\System32
as the working directory. When OCCAM attempts to discovery.Rule.ps1
files, it does so recursively, which can return errors when attempting to search parts of System32 that the PowerShell process does not have access to.We can either:
C:\Windows\System32
that they need to run OCCAM somewhere elseC:\Windows\System32
C:\Windows\System32