-
Notifications
You must be signed in to change notification settings - Fork 401
Closed
Description
PSSA is being run as part of the DSC resource validation process.
Many of the DSC resources contain samples that violate various rules, the most common being PSAvoidUsingConvertToSecureStringWithPlainText
.
We should be able to suppress these errors by adding a function decoration:
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")]
However, the SuppressMessageAttribute decorations only seem to suppress the rule violation message in a Function, not a DSC Configuration.
E.g. This suppresses correctly:
Function xFileUpload
{
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")]
param ([string] $decryptedPassword)
$securePassword = ConvertTo-SecureString $decryptedPassword -AsPlainText -Force
}
Rule violation suppression does not work:
Configuration xFileUpload
{
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")]
param ([string] $decryptedPassword)
$securePassword = ConvertTo-SecureString $decryptedPassword -AsPlainText -Force
}
Many of the current community DSC resources can't be updated (without causing build failures) due to this.