Closed AdhocAdam closed 2 years ago
PSScriptAnalyzer results:
``` RuleName : PSReviewUnusedParameter Severity : Warning ScriptName : smletsExchangeConnector.ps1 Line : 3210 Message : The parameter 'MessageClass' has been declared but not used. RuleName : PSUseShouldProcessForStateChangingFunctions Severity : Warning ScriptName : smletsExchangeConnector.ps1 Line : 192 Message : Function 'New-SMEXCOEvent' has verb that could change system state. Therefore, the function has to support 'ShouldProcess'. RuleName : PSUseShouldProcessForStateChangingFunctions Severity : Warning ScriptName : smletsExchangeConnector.ps1 Line : 883 Message : Function 'New-WorkItem' has verb that could change system state. Th erefore, the function has to support 'ShouldProcess'. RuleName : PSUseShouldProcessForStateChangingFunctions Severity : Warning ScriptName : smletsExchangeConnector.ps1 Line : 1464 Message : Function 'Update-WorkItem' has verb that could change system state. Therefore, the function has to support 'ShouldProcess'. RuleName : PSUseShouldProcessForStateChangingFunctions Severity : Warning ScriptName : smletsExchangeConnector.ps1 Line : 2633 Message : Function 'Set-AssignedToPerSupportGroup' has verb that could change system state. Therefore, the function has to support 'ShouldProces s'. RuleName : PSUseShouldProcessForStateChangingFunctions Severity : Warning ScriptName : smletsExchangeConnector.ps1 Line : 2712 Message : Function 'New-CMDBUser' has verb that could change system state. Th erefore, the function has to support 'ShouldProcess'. RuleName : PSUseShouldProcessForStateChangingFunctions Severity : Warning ScriptName : smletsExchangeConnector.ps1 Line : 3111 Message : Function 'Remove-CiresonWatchListUser' has verb that could change s ystem state. Therefore, the function has to support 'ShouldProcess' . RuleName : PSUseShouldProcessForStateChangingFunctions Severity : Warning ScriptName : smletsExchangeConnector.ps1 Line : 3145 Message : Function 'Set-WorkItemScheduledTime' has verb that could change sys tem state. Therefore, the function has to support 'ShouldProcess'. RuleName : PSUseShouldProcessForStateChangingFunctions Severity : Warning ScriptName : smletsExchangeConnector.ps1 Line : 3595 Message : Function 'Set-CoreSCSMAnnouncement' has verb that could change syst em state. Therefore, the function has to support 'ShouldProcess'. RuleName : PSUseShouldProcessForStateChangingFunctions Severity : Warning ScriptName : smletsExchangeConnector.ps1 Line : 3660 Message : Function 'Set-CiresonPortalAnnouncement' has verb that could change system state. Therefore, the function has to support 'ShouldProces s'. RuleName : PSUseShouldProcessForStateChangingFunctions Severity : Warning ScriptName : smletsExchangeConnector.ps1 Line : 4170 Message : Function 'Update-SCSMPropertyCollection' has verb that could change system state. Therefore, the function has to support 'ShouldProces s'. RuleName : PSUseShouldProcessForStateChangingFunctions Severity : Warning ScriptName : smletsExchangeConnector.ps1 Line : 4204 Message : Function 'Set-SCSMTemplate' has verb that could change system state . Therefore, the function has to support 'ShouldProcess'. RuleName : PSUseShouldProcessForStateChangingFunctions Severity : Warning ScriptName : smletsExchangeConnector.ps1 Line : 4223 Message : Function 'Remove-PII' has verb that could change system state. Ther efore, the function has to support 'ShouldProcess'. RuleName : PSUseUsingScopeModifierInNewRunspaces Severity : Warning ScriptName : smletsExchangeConnector.ps1 Line : 4287 Message : The variable '$appName' is not declared within this ScriptBlock, an d is missing the 'Using:' scope modifier. RuleName : PSUseUsingScopeModifierInNewRunspaces Severity : Warning ScriptName : smletsExchangeConnector.ps1 Line : 4311 Message : The variable '$unhealthySCOMApp' is not declared within this Script Block, and is missing the 'Using:' scope modifier. RuleName : PSAvoidTrailingWhitespace Severity : Information ScriptName : smletsExchangeConnector.ps1 Line : 4903 Message : Line has trailing whitespace RuleName : PSUseOutputTypeCorrectly Severity : Information ScriptName : smletsExchangeConnector.ps1 Line : 3056 Message : The cmdlet 'Get-CiresonSuggestionURL' returns an object of type 'Sy stem.Object[]' but this type is not declared in the OutputType attr ibute. ```
PSScriptAnalyzer results:
``` RuleName : PSReviewUnusedParameter Severity : Warning ScriptName : smletsExchangeConnector.ps1 Line : 3210 Message : The parameter 'MessageClass' has been declared but not used. RuleName : PSUseShouldProcessForStateChangingFunctions Severity : Warning ScriptName : smletsExchangeConnector.ps1 Line : 192 Message : Function 'New-SMEXCOEvent' has verb that could change system state. Therefore, the function has to support 'ShouldProcess'. RuleName : PSUseShouldProcessForStateChangingFunctions Severity : Warning ScriptName : smletsExchangeConnector.ps1 Line : 883 Message : Function 'New-WorkItem' has verb that could change system state. Th erefore, the function has to support 'ShouldProcess'. RuleName : PSUseShouldProcessForStateChangingFunctions Severity : Warning ScriptName : smletsExchangeConnector.ps1 Line : 1464 Message : Function 'Update-WorkItem' has verb that could change system state. Therefore, the function has to support 'ShouldProcess'. RuleName : PSUseShouldProcessForStateChangingFunctions Severity : Warning ScriptName : smletsExchangeConnector.ps1 Line : 2633 Message : Function 'Set-AssignedToPerSupportGroup' has verb that could change system state. Therefore, the function has to support 'ShouldProces s'. RuleName : PSUseShouldProcessForStateChangingFunctions Severity : Warning ScriptName : smletsExchangeConnector.ps1 Line : 2712 Message : Function 'New-CMDBUser' has verb that could change system state. Th erefore, the function has to support 'ShouldProcess'. RuleName : PSUseShouldProcessForStateChangingFunctions Severity : Warning ScriptName : smletsExchangeConnector.ps1 Line : 3111 Message : Function 'Remove-CiresonWatchListUser' has verb that could change s ystem state. Therefore, the function has to support 'ShouldProcess' . RuleName : PSUseShouldProcessForStateChangingFunctions Severity : Warning ScriptName : smletsExchangeConnector.ps1 Line : 3145 Message : Function 'Set-WorkItemScheduledTime' has verb that could change sys tem state. Therefore, the function has to support 'ShouldProcess'. RuleName : PSUseShouldProcessForStateChangingFunctions Severity : Warning ScriptName : smletsExchangeConnector.ps1 Line : 3595 Message : Function 'Set-CoreSCSMAnnouncement' has verb that could change syst em state. Therefore, the function has to support 'ShouldProcess'. RuleName : PSUseShouldProcessForStateChangingFunctions Severity : Warning ScriptName : smletsExchangeConnector.ps1 Line : 3660 Message : Function 'Set-CiresonPortalAnnouncement' has verb that could change system state. Therefore, the function has to support 'ShouldProces s'. RuleName : PSUseShouldProcessForStateChangingFunctions Severity : Warning ScriptName : smletsExchangeConnector.ps1 Line : 4170 Message : Function 'Update-SCSMPropertyCollection' has verb that could change system state. Therefore, the function has to support 'ShouldProces s'. RuleName : PSUseShouldProcessForStateChangingFunctions Severity : Warning ScriptName : smletsExchangeConnector.ps1 Line : 4204 Message : Function 'Set-SCSMTemplate' has verb that could change system state . Therefore, the function has to support 'ShouldProcess'. RuleName : PSUseShouldProcessForStateChangingFunctions Severity : Warning ScriptName : smletsExchangeConnector.ps1 Line : 4223 Message : Function 'Remove-PII' has verb that could change system state. Ther efore, the function has to support 'ShouldProcess'. RuleName : PSUseUsingScopeModifierInNewRunspaces Severity : Warning ScriptName : smletsExchangeConnector.ps1 Line : 4287 Message : The variable '$appName' is not declared within this ScriptBlock, an d is missing the 'Using:' scope modifier. RuleName : PSUseUsingScopeModifierInNewRunspaces Severity : Warning ScriptName : smletsExchangeConnector.ps1 Line : 4311 Message : The variable '$unhealthySCOMApp' is not declared within this Script Block, and is missing the 'Using:' scope modifier. RuleName : PSUseOutputTypeCorrectly Severity : Information ScriptName : smletsExchangeConnector.ps1 Line : 3056 Message : The cmdlet 'Get-CiresonSuggestionURL' returns an object of type 'Sy stem.Object[]' but this type is not declared in the OutputType attr ibute. ```
Per MimeKit documentation, the output of the following is of type DigitalSignatureCollection:
And documentation per DigitalSignatureCollection states:
As a result, $isVerifiedSig is not the best choice of variable naming and as such is moving to $digitalSignatures along with a couple logging events.