You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Invoke-ScriptAnalyzer : Suppression Message Attribute error at line 66 in MSFT_xExchDatabaseAvailabilityGroupMember.psm1 : Cannot find any Targets DSCMachineStatus that match the Scope Function to apply the SuppressMessageAttribute.
I wonder whether this is correct, applying SuppressMessageAttribute with function scope, but actually targeting a variable ?
At \DSCResources\MSFT_xExchDatabaseAvailabilityGroupMember\MSFT_xExchDatabaseAvailabilityGroupMember.psm1
Interesting. I played around with this, and I think the problem is that Target can't be scoped to a specific PowerShell variable. This issue seems to confirm. It looks like there's three other places in the module that attempt this suppression as well. I'm thinking maybe we should move any code that sets $global:DSCMachineStatus to 1 into a helper function, and then suppress this rule for the entire function. What do you think?
I have been getting this error from PSSA.
Invoke-ScriptAnalyzer : Suppression Message Attribute error at line 66 in MSFT_xExchDatabaseAvailabilityGroupMember.psm1 : Cannot find any Targets DSCMachineStatus that match the Scope Function to apply the SuppressMessageAttribute.
I wonder whether this is correct, applying SuppressMessageAttribute with function scope, but actually targeting a variable ?
At \DSCResources\MSFT_xExchDatabaseAvailabilityGroupMember\MSFT_xExchDatabaseAvailabilityGroupMember.psm1
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssignments', '', Scope='Function', Target='DSCMachineStatus')]
The text was updated successfully, but these errors were encountered: