strawgate / C3-Inventory

C3 Inventory
Other
14 stars 10 forks source link

Ensure PS version and improve error handling #36

Closed seanjseymour closed 7 years ago

seanjseymour commented 7 years ago

The Cert Provider requires PS >= 3.0 and will cause the script to fail on older versions, so I added "#Requires -Version 3.0" Remove-Item "HKLM:\Software\Certificates" can cause PowerShell to halt if it doesn't exist, so I appended "-ErrorAction SilentlyContinue" The three New-ItemProperty calls for the timestamp entries produce an annoying "property already exists" error, so I added "-Force"

strawgate commented 7 years ago

@seanjseymour Thanks! I'll take a look at this and see if I can just shift it to use only PS2 so it works on Windows 7.

seanjseymour commented 7 years ago

Cool. Thanks again Bill for making C3 open source!