AsBuiltReport / AsBuiltReport.Core

Repository for AsBuiltReport core module
https://www.asbuiltreport.com
MIT License
54 stars 23 forks source link

v1.2.0 #40

Closed tpcarman closed 2 years ago

tpcarman commented 2 years ago

Description

Added

Changed

Motivation and Context

Add alternative parameters to support API Tokens and MultiFactor Authentication methods for connecting to target systems.

How Has This Been Tested?

Tested on multiple environments which utilise API Tokens and MFA

Types of changes

Checklist:

github-actions[bot] commented 2 years ago

PSScriptAnalyzer results:

Errors: [2], Warnings: [28], Information: [12]

``` RuleName : PSAvoidUsingUsernameAndPasswordParams Severity : Error ScriptName : New-AsBuiltReport.ps1 Line : 132 Message : Function 'New-AsBuiltReport' has both Username and Password parameters. Either set the type of the Password parameter to SecureString or replace the Username and Password parameters with a Credential parameter of type PSCredential. If using a Credential parameter in PowerShell 4.0 or earlier, please define a credential transformation attribute after the PSCredential type attribute. RuleName : PSAvoidUsingConvertToSecureStringWithPlainText Severity : Error ScriptName : New-AsBuiltReport.ps1 Line : 247 Message : File 'New-AsBuiltReport.ps1' uses ConvertTo-SecureString with plaintext. This will expose secure information. Encrypted standard strings should be used instead. RuleName : PSPossibleIncorrectComparisonWithNull Severity : Warning ScriptName : New-AsBuiltConfig.ps1 Line : 80 Message : $null should be on the left side of equality comparisons. RuleName : PSPossibleIncorrectComparisonWithNull Severity : Warning ScriptName : New-AsBuiltConfig.ps1 Line : 85 Message : $null should be on the left side of equality comparisons. RuleName : PSPossibleIncorrectComparisonWithNull Severity : Warning ScriptName : New-AsBuiltConfig.ps1 Line : 90 Message : $null should be on the left side of equality comparisons. RuleName : PSPossibleIncorrectComparisonWithNull Severity : Warning ScriptName : New-AsBuiltConfig.ps1 Line : 113 Message : $null should be on the left side of equality comparisons. RuleName : PSPossibleIncorrectComparisonWithNull Severity : Warning ScriptName : New-AsBuiltConfig.ps1 Line : 126 Message : $null should be on the left side of equality comparisons. RuleName : PSAvoidUsingWriteHost Severity : Warning ScriptName : New-AsBuiltConfig.ps1 Line : 24 Message : File 'New-AsBuiltConfig.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. RuleName : PSAvoidUsingWriteHost Severity : Warning ScriptName : New-AsBuiltConfig.ps1 Line : 25 Message : File 'New-AsBuiltConfig.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. RuleName : PSAvoidUsingWriteHost Severity : Warning ScriptName : New-AsBuiltConfig.ps1 Line : 26 Message : File 'New-AsBuiltConfig.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. RuleName : PSAvoidUsingWriteHost Severity : Warning ScriptName : New-AsBuiltConfig.ps1 Line : 39 Message : File 'New-AsBuiltConfig.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. RuleName : PSAvoidUsingWriteHost Severity : Warning ScriptName : New-AsBuiltConfig.ps1 Line : 40 Message : File 'New-AsBuiltConfig.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. RuleName : PSAvoidUsingWriteHost Severity : Warning ScriptName : New-AsBuiltConfig.ps1 Line : 41 Message : File 'New-AsBuiltConfig.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. RuleName : PSAvoidUsingWriteHost Severity : Warning ScriptName : New-AsBuiltConfig.ps1 Line : 69 Message : File 'New-AsBuiltConfig.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. RuleName : PSAvoidUsingWriteHost Severity : Warning ScriptName : New-AsBuiltConfig.ps1 Line : 70 Message : File 'New-AsBuiltConfig.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. RuleName : PSAvoidUsingWriteHost Severity : Warning ScriptName : New-AsBuiltConfig.ps1 Line : 71 Message : File 'New-AsBuiltConfig.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. RuleName : PSAvoidUsingWriteHost Severity : Warning ScriptName : New-AsBuiltConfig.ps1 Line : 145 Message : File 'New-AsBuiltConfig.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. RuleName : PSAvoidUsingWriteHost Severity : Warning ScriptName : New-AsBuiltConfig.ps1 Line : 146 Message : File 'New-AsBuiltConfig.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. RuleName : PSAvoidUsingWriteHost Severity : Warning ScriptName : New-AsBuiltConfig.ps1 Line : 147 Message : File 'New-AsBuiltConfig.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. RuleName : PSAvoidUsingWriteHost Severity : Warning ScriptName : New-AsBuiltConfig.ps1 Line : 201 Message : File 'New-AsBuiltConfig.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. RuleName : PSAvoidUsingWriteHost Severity : Warning ScriptName : New-AsBuiltConfig.ps1 Line : 202 Message : File 'New-AsBuiltConfig.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. RuleName : PSAvoidUsingWriteHost Severity : Warning ScriptName : New-AsBuiltConfig.ps1 Line : 203 Message : File 'New-AsBuiltConfig.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. RuleName : PSUseShouldProcessForStateChangingFunctions Severity : Warning ScriptName : New-AsBuiltConfig.ps1 Line : 1 Message : Function 'New-AsBuiltConfig' has verb that could change system state. Therefore, the function has to support 'ShouldProcess'. RuleName : PSAvoidUsingPlainTextForPassword Severity : Warning ScriptName : New-AsBuiltReport.ps1 Line : 141 Message : Parameter '$Password' should use SecureString, otherwise this will expose sensitive information. See ConvertTo-SecureString for more information. RuleName : PSAvoidUsingWriteHost Severity : Warning ScriptName : New-AsBuiltReport.ps1 Line : 338 Message : File 'New-AsBuiltReport.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. RuleName : PSAvoidUsingWriteHost Severity : Warning ScriptName : New-AsBuiltReport.ps1 Line : 339 Message : File 'New-AsBuiltReport.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. RuleName : PSAvoidUsingWriteHost Severity : Warning ScriptName : New-AsBuiltReport.ps1 Line : 340 Message : File 'New-AsBuiltReport.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. RuleName : PSAvoidUsingWriteHost Severity : Warning ScriptName : New-AsBuiltReport.ps1 Line : 373 Message : File 'New-AsBuiltReport.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. RuleName : PSUseShouldProcessForStateChangingFunctions Severity : Warning ScriptName : New-AsBuiltReport.ps1 Line : 1 Message : Function 'New-AsBuiltReport' has verb that could change system state. Therefore, the function has to support 'ShouldProcess'. RuleName : PSUseShouldProcessForStateChangingFunctions Severity : Warning ScriptName : New-AsBuiltReportConfig.ps1 Line : 1 Message : Function 'New-AsBuiltReportConfig' has verb that could change system state. Therefore, the function has to support 'ShouldProcess'. RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : New-AsBuiltConfig.ps1 Line : 3 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : New-AsBuiltConfig.ps1 Line : 10 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : New-AsBuiltConfig.ps1 Line : 81 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : New-AsBuiltConfig.ps1 Line : 93 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : New-AsBuiltConfig.ps1 Line : 114 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : New-AsBuiltConfig.ps1 Line : 122 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : New-AsBuiltConfig.ps1 Line : 229 Message : Line has trailing whitespace RuleName : PSUseOutputTypeCorrectly Severity : Information ScriptName : New-AsBuiltConfig.ps1 Line : 252 Message : The cmdlet 'New-AsBuiltConfig' returns an object of type 'System.Collections.Hashtable' but this type is not declared in the OutputType attribute. RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : New-AsBuiltReportConfig.ps1 Line : 3 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : New-AsBuiltReportConfig.ps1 Line : 17 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : New-AsBuiltReportConfig.ps1 Line : 20 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : New-AsBuiltReportConfig.ps1 Line : 49 Message : Line has trailing whitespace ```