From 06732fd9027110210a26ad1012572c0c41d2003c Mon Sep 17 00:00:00 2001 From: Kevin Marquette Date: Wed, 17 Jan 2018 17:34:14 -0800 Subject: [PATCH 1/2] Add Justification to the first example --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 72478b593..5e24812a7 100644 --- a/README.md +++ b/README.md @@ -147,12 +147,12 @@ Suppressing Rules ================= You can suppress a rule by decorating a script/function or script/function parameter with .NET's [SuppressMessageAttribute](https://msdn.microsoft.com/en-us/library/system.diagnostics.codeanalysis.suppressmessageattribute.aspx). -`SuppressMessageAttribute`'s constructor takes two parameters: a category and a check ID. Set the `categoryID` parameter to the name of the rule you want to suppress and set the `checkID` parameter to a null or empty string: +`SuppressMessageAttribute`'s constructor takes two parameters: a category and a check ID. Set the `categoryID` parameter to the name of the rule you want to suppress and set the `checkID` parameter to a null or empty string. You can optionally add a third named parameter with a justification for suppressing the message. ``` PowerShell function SuppressMe() { - [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSProvideCommentHelp", "")] + [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSProvideCommentHelp", "", Justification="Just an example")] param() Write-Verbose -Message "I'm making a difference!" From fbc504692a15fbc882b8d738b336c2303adb3757 Mon Sep 17 00:00:00 2001 From: Kevin Marquette Date: Wed, 17 Jan 2018 17:37:41 -0800 Subject: [PATCH 2/2] added colon --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5e24812a7..877a2de68 100644 --- a/README.md +++ b/README.md @@ -147,7 +147,7 @@ Suppressing Rules ================= You can suppress a rule by decorating a script/function or script/function parameter with .NET's [SuppressMessageAttribute](https://msdn.microsoft.com/en-us/library/system.diagnostics.codeanalysis.suppressmessageattribute.aspx). -`SuppressMessageAttribute`'s constructor takes two parameters: a category and a check ID. Set the `categoryID` parameter to the name of the rule you want to suppress and set the `checkID` parameter to a null or empty string. You can optionally add a third named parameter with a justification for suppressing the message. +`SuppressMessageAttribute`'s constructor takes two parameters: a category and a check ID. Set the `categoryID` parameter to the name of the rule you want to suppress and set the `checkID` parameter to a null or empty string. You can optionally add a third named parameter with a justification for suppressing the message: ``` PowerShell function SuppressMe()