SuperCATDevelopers / SuperCAT

The purpose of SuperCAT is to provide an all-in-one tool to inventory and audit offline computers without making any changes the baseline of the target machine. It is intended to run from a re-writable CD/DVD.
Other
1 stars 2 forks source link

Update script to run from command line arguments #42

Closed VWong99 closed 2 years ago

VWong99 commented 2 years ago

https://github.com/SuperCATDevelopers/SuperCAT/issues/26

This gives the option of running the script with command line arguments without user input in runtime. This may help with automated unit testing.

Example usage: .\SuperCAT.ps1 -Choices "1" -System "1" -Location "1" -Confirm

github-actions[bot] commented 2 years ago

PSScriptAnalyzer results:

Errors: [0], Warnings: [3], Information: [3]

``` RuleName : PSAvoidUsingWMICmdlet Severity : Warning ScriptName : SuperCAT.ps1 Line : 51 Message : File 'SuperCAT.ps1' uses WMI cmdlet. For PowerShell 3.0 and above, use CIM cmdlet which perform the same tasks as the WMI cmdlets. The CIM cmdlets comply with WS-Management (WSMan) standards and with the Common Information Model (CIM) standard, which enables the cmdlets to use the same techniques to manage Windows computers and those running other operating systems. RuleName : PSAvoidUsingWMICmdlet Severity : Warning ScriptName : SuperCAT.ps1 Line : 129 Message : File 'SuperCAT.ps1' uses WMI cmdlet. For PowerShell 3.0 and above, use CIM cmdlet which perform the same tasks as the WMI cmdlets. The CIM cmdlets comply with WS-Management (WSMan) standards and with the Common Information Model (CIM) standard, which enables the cmdlets to use the same techniques to manage Windows computers and those running other operating systems. RuleName : PSAvoidUsingWMICmdlet Severity : Warning ScriptName : SuperCAT.ps1 Line : 130 Message : File 'SuperCAT.ps1' uses WMI cmdlet. For PowerShell 3.0 and above, use CIM cmdlet which perform the same tasks as the WMI cmdlets. The CIM cmdlets comply with WS-Management (WSMan) standards and with the Common Information Model (CIM) standard, which enables the cmdlets to use the same techniques to manage Windows computers and those running other operating systems. RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : SuperCAT.ps1 Line : 6 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : SuperCAT.ps1 Line : 7 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : export-offline-registry.ps1 Line : 8 Message : Line has trailing whitespace ```

VWong99 commented 2 years ago

Previous change to main (https://github.com/SuperCATDevelopers/SuperCAT/commit/b41bef5bcfe21ef7bcf5638e245e5a2e05dca06a) introduced error with ampersand usage. This may be a linter error.

The ampersand (&) character is not allowed. The & operator is reserved for future use; wrap an ampersand in double quotation marks ("&") to pass it as part of a string.

github-actions[bot] commented 2 years ago

PSScriptAnalyzer results:

Errors: [0], Warnings: [3], Information: [3]

``` RuleName : PSAvoidUsingWMICmdlet Severity : Warning ScriptName : SuperCAT.ps1 Line : 51 Message : File 'SuperCAT.ps1' uses WMI cmdlet. For PowerShell 3.0 and above, use CIM cmdlet which perform the same tasks as the WMI cmdlets. The CIM cmdlets comply with WS-Management (WSMan) standards and with the Common Information Model (CIM) standard, which enables the cmdlets to use the same techniques to manage Windows computers and those running other operating systems. RuleName : PSAvoidUsingWMICmdlet Severity : Warning ScriptName : SuperCAT.ps1 Line : 129 Message : File 'SuperCAT.ps1' uses WMI cmdlet. For PowerShell 3.0 and above, use CIM cmdlet which perform the same tasks as the WMI cmdlets. The CIM cmdlets comply with WS-Management (WSMan) standards and with the Common Information Model (CIM) standard, which enables the cmdlets to use the same techniques to manage Windows computers and those running other operating systems. RuleName : PSAvoidUsingWMICmdlet Severity : Warning ScriptName : SuperCAT.ps1 Line : 130 Message : File 'SuperCAT.ps1' uses WMI cmdlet. For PowerShell 3.0 and above, use CIM cmdlet which perform the same tasks as the WMI cmdlets. The CIM cmdlets comply with WS-Management (WSMan) standards and with the Common Information Model (CIM) standard, which enables the cmdlets to use the same techniques to manage Windows computers and those running other operating systems. RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : SuperCAT.ps1 Line : 6 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : SuperCAT.ps1 Line : 7 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : export-offline-registry.ps1 Line : 8 Message : Line has trailing whitespace ```

github-actions[bot] commented 2 years ago

PSScriptAnalyzer results:

Errors: [0], Warnings: [3], Information: [3]

``` RuleName : PSAvoidUsingWMICmdlet Severity : Warning ScriptName : SuperCAT.ps1 Line : 51 Message : File 'SuperCAT.ps1' uses WMI cmdlet. For PowerShell 3.0 and above, use CIM cmdlet which perform the same tasks as the WMI cmdlets. The CIM cmdlets comply with WS-Management (WSMan) standards and with the Common Information Model (CIM) standard, which enables the cmdlets to use the same techniques to manage Windows computers and those running other operating systems. RuleName : PSAvoidUsingWMICmdlet Severity : Warning ScriptName : SuperCAT.ps1 Line : 129 Message : File 'SuperCAT.ps1' uses WMI cmdlet. For PowerShell 3.0 and above, use CIM cmdlet which perform the same tasks as the WMI cmdlets. The CIM cmdlets comply with WS-Management (WSMan) standards and with the Common Information Model (CIM) standard, which enables the cmdlets to use the same techniques to manage Windows computers and those running other operating systems. RuleName : PSAvoidUsingWMICmdlet Severity : Warning ScriptName : SuperCAT.ps1 Line : 130 Message : File 'SuperCAT.ps1' uses WMI cmdlet. For PowerShell 3.0 and above, use CIM cmdlet which perform the same tasks as the WMI cmdlets. The CIM cmdlets comply with WS-Management (WSMan) standards and with the Common Information Model (CIM) standard, which enables the cmdlets to use the same techniques to manage Windows computers and those running other operating systems. RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : SuperCAT.ps1 Line : 6 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : SuperCAT.ps1 Line : 7 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : export-offline-registry.ps1 Line : 8 Message : Line has trailing whitespace ```