easitab / EPR.GlobalFunctions

Provide functions to be used in script executed by EasitProcessRunner
https://docs.easitgo.com/techspace/epr/globalfunctions/
Apache License 2.0
1 stars 0 forks source link

Add installer function #16

Closed easitanth closed 1 year ago

github-actions[bot] commented 1 year ago

PSScriptAnalyzer results:

Errors: [1], Warnings: [14], Information: [19]

``` RuleName : PSAvoidUsingConvertToSecureStringWithPlainText Severity : Error ScriptName : New-EPRInstallation.ps1 Line : 507 Message : File 'New-EPRInstallation.ps1' uses ConvertTo-SecureString with plaintext. This will expose secure information. Encrypted standard strings should be used instead. RuleName : PSUseProcessBlockForPipelineCommand Severity : Warning ScriptName : Get-SettingsFromFile.Tests.ps1 Line : 15 Message : Command accepts pipeline input but has not defined a process block. RuleName : PSUseProcessBlockForPipelineCommand Severity : Warning ScriptName : Get-SettingsFromFile.Tests.ps1 Line : 17 Message : Command accepts pipeline input but has not defined a process block. RuleName : PSAvoidUsingEmptyCatchBlock Severity : Warning ScriptName : New-EPRInstallation.ps1 Line : 348 Message : Empty catch block is used. Please use Write-Error or throw statements in catch blocks. RuleName : PSAvoidUsingEmptyCatchBlock Severity : Warning ScriptName : New-EPRInstallation.ps1 Line : 386 Message : Empty catch block is used. Please use Write-Error or throw statements in catch blocks. RuleName : PSAvoidUsingWriteHost Severity : Warning ScriptName : New-EPRInstallation.ps1 Line : 63 Message : File 'New-EPRInstallation.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-EPRInstallation.ps1 Line : 64 Message : File 'New-EPRInstallation.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-EPRInstallation.ps1 Line : 65 Message : File 'New-EPRInstallation.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-EPRInstallation.ps1 Line : 66 Message : File 'New-EPRInstallation.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 : PSAvoidGlobalVars Severity : Warning ScriptName : Write-CustomLog.ps1 Line : 95 Message : Found global variable 'global:LoggerSettings'. RuleName : PSUseProcessBlockForPipelineCommand Severity : Warning ScriptName : Write-CustomLog.ps1 Line : 77 Message : Command accepts pipeline input but has not defined a process block. RuleName : PSUseProcessBlockForPipelineCommand Severity : Warning ScriptName : Write-CustomLog.ps1 Line : 79 Message : Command accepts pipeline input but has not defined a process block. RuleName : PSAvoidAssignmentToAutomaticVariable Severity : Warning ScriptName : Convert-OUString.ps1 Line : 69 Message : The Variable 'Matches' is an automatic variable that is built into PowerShell, assigning to it might have undesired side effects. If assignment is not by design, please use a different name. RuleName : PSUseProcessBlockForPipelineCommand Severity : Warning ScriptName : Write-EPRInstallLog.ps1 Line : 31 Message : Command accepts pipeline input but has not defined a process block. RuleName : PSUseProcessBlockForPipelineCommand Severity : Warning ScriptName : Write-EPRInstallLog.ps1 Line : 33 Message : Command accepts pipeline input but has not defined a process block. RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : New-EPRInstallation.ps1 Line : 54 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : New-EPRInstallation.ps1 Line : 60 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : New-EPRInstallation.ps1 Line : 92 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : New-EPRInstallation.ps1 Line : 557 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : Write-CustomLog.ps1 Line : 16 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : Write-CustomLog.ps1 Line : 17 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : Write-CustomLog.ps1 Line : 19 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : Write-CustomLog.ps1 Line : 21 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : Convert-OUString.ps1 Line : 40 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : Get-SettingsFromFile.ps1 Line : 36 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : Get-SettingsFromFile.ps1 Line : 40 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : Get-SettingsFromFile.ps1 Line : 92 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : Get-SettingsFromFile.ps1 Line : 141 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : New-PostBody.ps1 Line : 30 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : New-PostBody.ps1 Line : 32 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : New-PostBody.ps1 Line : 34 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : New-PostBody.ps1 Line : 59 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : New-PostBody.ps1 Line : 61 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : Write-EPRInstallLog.ps1 Line : 43 Message : Line has trailing whitespace ```

github-actions[bot] commented 1 year ago

PSScriptAnalyzer results:

Errors: [1], Warnings: [14], Information: [19]

``` RuleName : PSAvoidUsingConvertToSecureStringWithPlainText Severity : Error ScriptName : New-EPRInstallation.ps1 Line : 507 Message : File 'New-EPRInstallation.ps1' uses ConvertTo-SecureString with plaintext. This will expose secure information. Encrypted standard strings should be used instead. RuleName : PSUseProcessBlockForPipelineCommand Severity : Warning ScriptName : Get-SettingsFromFile.Tests.ps1 Line : 15 Message : Command accepts pipeline input but has not defined a process block. RuleName : PSUseProcessBlockForPipelineCommand Severity : Warning ScriptName : Get-SettingsFromFile.Tests.ps1 Line : 17 Message : Command accepts pipeline input but has not defined a process block. RuleName : PSAvoidUsingEmptyCatchBlock Severity : Warning ScriptName : New-EPRInstallation.ps1 Line : 348 Message : Empty catch block is used. Please use Write-Error or throw statements in catch blocks. RuleName : PSAvoidUsingEmptyCatchBlock Severity : Warning ScriptName : New-EPRInstallation.ps1 Line : 386 Message : Empty catch block is used. Please use Write-Error or throw statements in catch blocks. RuleName : PSAvoidUsingWriteHost Severity : Warning ScriptName : New-EPRInstallation.ps1 Line : 63 Message : File 'New-EPRInstallation.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-EPRInstallation.ps1 Line : 64 Message : File 'New-EPRInstallation.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-EPRInstallation.ps1 Line : 65 Message : File 'New-EPRInstallation.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-EPRInstallation.ps1 Line : 66 Message : File 'New-EPRInstallation.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 : PSAvoidGlobalVars Severity : Warning ScriptName : Write-CustomLog.ps1 Line : 95 Message : Found global variable 'global:LoggerSettings'. RuleName : PSUseProcessBlockForPipelineCommand Severity : Warning ScriptName : Write-CustomLog.ps1 Line : 77 Message : Command accepts pipeline input but has not defined a process block. RuleName : PSUseProcessBlockForPipelineCommand Severity : Warning ScriptName : Write-CustomLog.ps1 Line : 79 Message : Command accepts pipeline input but has not defined a process block. RuleName : PSAvoidAssignmentToAutomaticVariable Severity : Warning ScriptName : Convert-OUString.ps1 Line : 69 Message : The Variable 'Matches' is an automatic variable that is built into PowerShell, assigning to it might have undesired side effects. If assignment is not by design, please use a different name. RuleName : PSUseProcessBlockForPipelineCommand Severity : Warning ScriptName : Write-EPRInstallLog.ps1 Line : 31 Message : Command accepts pipeline input but has not defined a process block. RuleName : PSUseProcessBlockForPipelineCommand Severity : Warning ScriptName : Write-EPRInstallLog.ps1 Line : 33 Message : Command accepts pipeline input but has not defined a process block. RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : New-EPRInstallation.ps1 Line : 54 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : New-EPRInstallation.ps1 Line : 60 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : New-EPRInstallation.ps1 Line : 92 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : New-EPRInstallation.ps1 Line : 557 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : Write-CustomLog.ps1 Line : 16 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : Write-CustomLog.ps1 Line : 17 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : Write-CustomLog.ps1 Line : 19 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : Write-CustomLog.ps1 Line : 21 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : Convert-OUString.ps1 Line : 40 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : Get-SettingsFromFile.ps1 Line : 36 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : Get-SettingsFromFile.ps1 Line : 40 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : Get-SettingsFromFile.ps1 Line : 92 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : Get-SettingsFromFile.ps1 Line : 141 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : New-PostBody.ps1 Line : 30 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : New-PostBody.ps1 Line : 32 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : New-PostBody.ps1 Line : 34 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : New-PostBody.ps1 Line : 59 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : New-PostBody.ps1 Line : 61 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : Write-EPRInstallLog.ps1 Line : 43 Message : Line has trailing whitespace ```

github-actions[bot] commented 1 year ago

PSScriptAnalyzer results:

Errors: [0], Warnings: [14], Information: [19]

``` RuleName : PSUseProcessBlockForPipelineCommand Severity : Warning ScriptName : Get-SettingsFromFile.Tests.ps1 Line : 15 Message : Command accepts pipeline input but has not defined a process block. RuleName : PSUseProcessBlockForPipelineCommand Severity : Warning ScriptName : Get-SettingsFromFile.Tests.ps1 Line : 17 Message : Command accepts pipeline input but has not defined a process block. RuleName : PSAvoidUsingEmptyCatchBlock Severity : Warning ScriptName : New-EPRInstallation.ps1 Line : 348 Message : Empty catch block is used. Please use Write-Error or throw statements in catch blocks. RuleName : PSAvoidUsingEmptyCatchBlock Severity : Warning ScriptName : New-EPRInstallation.ps1 Line : 386 Message : Empty catch block is used. Please use Write-Error or throw statements in catch blocks. RuleName : PSAvoidUsingWriteHost Severity : Warning ScriptName : New-EPRInstallation.ps1 Line : 63 Message : File 'New-EPRInstallation.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-EPRInstallation.ps1 Line : 64 Message : File 'New-EPRInstallation.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-EPRInstallation.ps1 Line : 65 Message : File 'New-EPRInstallation.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-EPRInstallation.ps1 Line : 66 Message : File 'New-EPRInstallation.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 : PSAvoidGlobalVars Severity : Warning ScriptName : Write-CustomLog.ps1 Line : 95 Message : Found global variable 'global:LoggerSettings'. RuleName : PSUseProcessBlockForPipelineCommand Severity : Warning ScriptName : Write-CustomLog.ps1 Line : 77 Message : Command accepts pipeline input but has not defined a process block. RuleName : PSUseProcessBlockForPipelineCommand Severity : Warning ScriptName : Write-CustomLog.ps1 Line : 79 Message : Command accepts pipeline input but has not defined a process block. RuleName : PSAvoidAssignmentToAutomaticVariable Severity : Warning ScriptName : Convert-OUString.ps1 Line : 69 Message : The Variable 'Matches' is an automatic variable that is built into PowerShell, assigning to it might have undesired side effects. If assignment is not by design, please use a different name. RuleName : PSUseProcessBlockForPipelineCommand Severity : Warning ScriptName : Write-EPRInstallLog.ps1 Line : 31 Message : Command accepts pipeline input but has not defined a process block. RuleName : PSUseProcessBlockForPipelineCommand Severity : Warning ScriptName : Write-EPRInstallLog.ps1 Line : 33 Message : Command accepts pipeline input but has not defined a process block. RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : New-EPRInstallation.ps1 Line : 54 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : New-EPRInstallation.ps1 Line : 60 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : New-EPRInstallation.ps1 Line : 92 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : New-EPRInstallation.ps1 Line : 558 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : Write-CustomLog.ps1 Line : 16 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : Write-CustomLog.ps1 Line : 17 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : Write-CustomLog.ps1 Line : 19 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : Write-CustomLog.ps1 Line : 21 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : Convert-OUString.ps1 Line : 40 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : Get-SettingsFromFile.ps1 Line : 36 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : Get-SettingsFromFile.ps1 Line : 40 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : Get-SettingsFromFile.ps1 Line : 92 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : Get-SettingsFromFile.ps1 Line : 141 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : New-PostBody.ps1 Line : 30 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : New-PostBody.ps1 Line : 32 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : New-PostBody.ps1 Line : 34 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : New-PostBody.ps1 Line : 59 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : New-PostBody.ps1 Line : 61 Message : Line has trailing whitespace RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : Write-EPRInstallLog.ps1 Line : 43 Message : Line has trailing whitespace ```