From 0be5a01d623daa6f54bbf84891279c0704bb0ae0 Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Tue, 19 Oct 2021 14:38:18 -0500 Subject: [PATCH] Add metadata to docs (#1731) --- docs/Cmdlets/Get-ScriptAnalyzerRule.md | 3 +- docs/Cmdlets/Invoke-Formatter.md | 3 +- docs/Cmdlets/Invoke-ScriptAnalyzer.md | 3 +- docs/Cmdlets/PSScriptAnalyzer.md | 11 ++-- docs/Rules/AlignAssignmentStatement.md | 9 ++- .../AvoidAssignmentToAutomaticVariable.md | 7 +++ .../AvoidDefaultValueForMandatoryParameter.md | 7 +++ .../Rules/AvoidDefaultValueSwitchParameter.md | 7 +++ docs/Rules/AvoidGlobalAliases.md | 7 +++ docs/Rules/AvoidGlobalFunctions.md | 7 +++ docs/Rules/AvoidGlobalVars.md | 7 +++ docs/Rules/AvoidInvokingEmptyMembers.md | 7 +++ docs/Rules/AvoidLongLines.md | 7 +++ docs/Rules/AvoidMultipleTypeAttributes.md | 7 +++ .../AvoidNullOrEmptyHelpMessageAttribute.md | 7 +++ docs/Rules/AvoidOverwritingBuiltInCmdlets.md | 7 +++ docs/Rules/AvoidShouldContinueWithoutForce.md | 7 +++ docs/Rules/AvoidTrailingWhitespace.md | 7 +++ docs/Rules/AvoidUsingCmdletAliases.md | 7 +++ docs/Rules/AvoidUsingComputerNameHardcoded.md | 11 +++- ...UsingConvertToSecureStringWithPlainText.md | 7 +++ .../AvoidUsingDeprecatedManifestFields.md | 7 +++ ...AvoidUsingDoubleQuotesForConstantString.md | 7 +++ docs/Rules/AvoidUsingEmptyCatchBlock.md | 7 +++ docs/Rules/AvoidUsingInvokeExpression.md | 7 +++ docs/Rules/AvoidUsingPlainTextForPassword.md | 7 +++ docs/Rules/AvoidUsingPositionalParameters.md | 7 +++ .../AvoidUsingUsernameAndPasswordParams.md | 7 +++ docs/Rules/AvoidUsingWMICmdlet.md | 7 +++ docs/Rules/AvoidUsingWriteHost.md | 7 +++ docs/Rules/DSCDscExamplesPresent.md | 7 +++ docs/Rules/DSCDscTestsPresent.md | 7 +++ .../DSCReturnCorrectTypesForDSCFunctions.md | 11 +++- .../DSCStandardDSCFunctionsInResource.md | 12 +++- ...SCUseIdenticalMandatoryParametersForDSC.md | 7 +++ docs/Rules/DSCUseIdenticalParametersForDSC.md | 7 +++ .../DSCUseVerboseMessageInDSCResource.md | 7 +++ docs/Rules/MisleadingBacktick.md | 7 +++ docs/Rules/MissingModuleManifestField.md | 7 +++ docs/Rules/PlaceCloseBrace.md | 7 +++ docs/Rules/PlaceOpenBrace.md | 7 +++ .../PossibleIncorrectComparisonWithNull.md | 7 +++ ...sibleIncorrectUsageOfAssignmentOperator.md | 13 +++- ...ibleIncorrectUsageOfRedirectionOperator.md | 7 +++ docs/Rules/ProvideCommentHelp.md | 13 +++- docs/Rules/README.md | 11 +++- docs/Rules/ReservedCmdletChar.md | 7 +++ docs/Rules/ReservedParams.md | 7 +++ docs/Rules/ReviewUnusedParameter.md | 7 +++ docs/Rules/ShouldProcess.md | 7 +++ docs/Rules/UseApprovedVerbs.md | 9 ++- docs/Rules/UseBOMForUnicodeEncodedFile.md | 7 +++ docs/Rules/UseCmdletCorrectly.md | 7 +++ docs/Rules/UseCompatibleCmdlets.md | 7 +++ docs/Rules/UseCompatibleCommands.md | 7 +++ docs/Rules/UseCompatibleSyntax.md | 10 ++- docs/Rules/UseCompatibleTypes.md | 7 +++ docs/Rules/UseConsistentIndentation.md | 7 +++ docs/Rules/UseConsistentWhitespace.md | 63 ++++++++++--------- docs/Rules/UseCorrectCasing.md | 7 +++ .../UseDeclaredVarsMoreThanAssignments.md | 7 +++ .../UseLiteralInitializerForHashtable.md | 7 +++ docs/Rules/UseOutputTypeCorrectly.md | 7 +++ docs/Rules/UsePSCredentialType.md | 7 +++ .../UseProcessBlockForPipelineCommand.md | 7 +++ ...eShouldProcessForStateChangingFunctions.md | 7 +++ docs/Rules/UseSingularNouns.md | 10 ++- docs/Rules/UseSupportsShouldProcess.md | 9 ++- docs/Rules/UseToExportFieldsInManifest.md | 11 +++- docs/Rules/UseUTF8EncodingForHelpFile.md | 7 +++ .../UseUsingScopeModifierInNewRunspaces.md | 9 ++- 71 files changed, 530 insertions(+), 62 deletions(-) diff --git a/docs/Cmdlets/Get-ScriptAnalyzerRule.md b/docs/Cmdlets/Get-ScriptAnalyzerRule.md index cc7035b2e..ccb56c654 100644 --- a/docs/Cmdlets/Get-ScriptAnalyzerRule.md +++ b/docs/Cmdlets/Get-ScriptAnalyzerRule.md @@ -1,6 +1,7 @@ ---- +--- external help file: Microsoft.Windows.PowerShell.ScriptAnalyzer.dll-Help.xml Module Name: PSScriptAnalyzer +ms.custom: PSSA v1.20.0 ms.date: 10/07/2021 online version: https://docs.microsoft.com/powershell/module/psscriptanalyzer/get-scriptanalyzerrule?view=ps-modules&wt.mc_id=ps-gethelp schema: 2.0.0 diff --git a/docs/Cmdlets/Invoke-Formatter.md b/docs/Cmdlets/Invoke-Formatter.md index c66830adb..7587d1af5 100644 --- a/docs/Cmdlets/Invoke-Formatter.md +++ b/docs/Cmdlets/Invoke-Formatter.md @@ -1,6 +1,7 @@ ---- +--- external help file: Microsoft.Windows.PowerShell.ScriptAnalyzer.dll-Help.xml Module Name: PSScriptAnalyzer +ms.custom: PSSA v1.20.0 ms.date: 10/07/2021 online version: https://docs.microsoft.com/powershell/module/psscriptanalyzer/invoke-formatter?view=ps-modules&wt.mc_id=ps-gethelp schema: 2.0.0 diff --git a/docs/Cmdlets/Invoke-ScriptAnalyzer.md b/docs/Cmdlets/Invoke-ScriptAnalyzer.md index 54fe2d07c..2263f165b 100644 --- a/docs/Cmdlets/Invoke-ScriptAnalyzer.md +++ b/docs/Cmdlets/Invoke-ScriptAnalyzer.md @@ -1,6 +1,7 @@ ---- +--- external help file: Microsoft.Windows.PowerShell.ScriptAnalyzer.dll-Help.xml Module Name: PSScriptAnalyzer +ms.custom: PSSA v1.20.0 ms.date: 10/07/2021 online version: https://docs.microsoft.com/powershell/module/psscriptanalyzer/invoke-scriptanalyzer?view=ps-modules&wt.mc_id=ps-gethelp schema: 2.0.0 diff --git a/docs/Cmdlets/PSScriptAnalyzer.md b/docs/Cmdlets/PSScriptAnalyzer.md index 10ebbe44f..557cb2ee6 100644 --- a/docs/Cmdlets/PSScriptAnalyzer.md +++ b/docs/Cmdlets/PSScriptAnalyzer.md @@ -1,10 +1,11 @@ ---- -Module Name: PSScriptAnalyzer -Module Guid: d6245802-193d-4068-a631-8863a4342a18 -ms.date: 10/07/2021 -Download Help Link: https://aka.ms/ps-modules-help +--- +Download Help Link: https://aka.ms/ps-modules-help Help Version: 1.20.0 Locale: en-US +Module Guid: d6245802-193d-4068-a631-8863a4342a18 +Module Name: PSScriptAnalyzer +ms.custom: PSSA v1.20.0 +ms.date: 10/07/2021 --- # PSScriptAnalyzer Module diff --git a/docs/Rules/AlignAssignmentStatement.md b/docs/Rules/AlignAssignmentStatement.md index 948092848..cb98d7fb3 100644 --- a/docs/Rules/AlignAssignmentStatement.md +++ b/docs/Rules/AlignAssignmentStatement.md @@ -1,4 +1,11 @@ -# AlignAssignmentStatement +--- +description: Align assignment statement +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: AlignAssignmentStatement +--- +# AlignAssignmentStatement **Severity Level: Warning** diff --git a/docs/Rules/AvoidAssignmentToAutomaticVariable.md b/docs/Rules/AvoidAssignmentToAutomaticVariable.md index 6d2f741e1..e72c2f5db 100644 --- a/docs/Rules/AvoidAssignmentToAutomaticVariable.md +++ b/docs/Rules/AvoidAssignmentToAutomaticVariable.md @@ -1,3 +1,10 @@ +--- +description: Changing automatic variables might have undesired side effects +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: AvoidAssignmentToAutomaticVariable +--- # AvoidAssignmentToAutomaticVariable **Severity Level: Warning** diff --git a/docs/Rules/AvoidDefaultValueForMandatoryParameter.md b/docs/Rules/AvoidDefaultValueForMandatoryParameter.md index 9c45e53f2..756b59c51 100644 --- a/docs/Rules/AvoidDefaultValueForMandatoryParameter.md +++ b/docs/Rules/AvoidDefaultValueForMandatoryParameter.md @@ -1,3 +1,10 @@ +--- +description: Avoid Default Value For Mandatory Parameter +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: AvoidDefaultValueForMandatoryParameter +--- # AvoidDefaultValueForMandatoryParameter **Severity Level: Warning** diff --git a/docs/Rules/AvoidDefaultValueSwitchParameter.md b/docs/Rules/AvoidDefaultValueSwitchParameter.md index 428ff7d64..01bd20bc1 100644 --- a/docs/Rules/AvoidDefaultValueSwitchParameter.md +++ b/docs/Rules/AvoidDefaultValueSwitchParameter.md @@ -1,3 +1,10 @@ +--- +description: Switch Parameters Should Not Default To True +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: AvoidDefaultValueSwitchParameter +--- # AvoidDefaultValueSwitchParameter **Severity Level: Warning** diff --git a/docs/Rules/AvoidGlobalAliases.md b/docs/Rules/AvoidGlobalAliases.md index c4708c86a..8ec95d866 100644 --- a/docs/Rules/AvoidGlobalAliases.md +++ b/docs/Rules/AvoidGlobalAliases.md @@ -1,3 +1,10 @@ +--- +description: Avoid global aliases. +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: AvoidGlobalAliases +--- # AvoidGlobalAliases **Severity Level: Warning** diff --git a/docs/Rules/AvoidGlobalFunctions.md b/docs/Rules/AvoidGlobalFunctions.md index 2d8a32b0a..5b5cc47f1 100644 --- a/docs/Rules/AvoidGlobalFunctions.md +++ b/docs/Rules/AvoidGlobalFunctions.md @@ -1,3 +1,10 @@ +--- +description: Avoid global functions and aliases +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: AvoidGlobalFunctions +--- # AvoidGlobalFunctions **Severity Level: Warning** diff --git a/docs/Rules/AvoidGlobalVars.md b/docs/Rules/AvoidGlobalVars.md index 4de23cbe7..7a6d09402 100644 --- a/docs/Rules/AvoidGlobalVars.md +++ b/docs/Rules/AvoidGlobalVars.md @@ -1,3 +1,10 @@ +--- +description: No Global Variables +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: AvoidGlobalVars +--- # AvoidGlobalVars **Severity Level: Warning** diff --git a/docs/Rules/AvoidInvokingEmptyMembers.md b/docs/Rules/AvoidInvokingEmptyMembers.md index e48aa42d6..f3e4f7f33 100644 --- a/docs/Rules/AvoidInvokingEmptyMembers.md +++ b/docs/Rules/AvoidInvokingEmptyMembers.md @@ -1,3 +1,10 @@ +--- +description: Avoid Invoking Empty Members +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: AvoidInvokingEmptyMembers +--- # AvoidInvokingEmptyMembers **Severity Level: Warning** diff --git a/docs/Rules/AvoidLongLines.md b/docs/Rules/AvoidLongLines.md index b90929819..4f460749a 100644 --- a/docs/Rules/AvoidLongLines.md +++ b/docs/Rules/AvoidLongLines.md @@ -1,3 +1,10 @@ +--- +description: Avoid long lines +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: AvoidLongLines +--- # AvoidLongLines **Severity Level: Warning** diff --git a/docs/Rules/AvoidMultipleTypeAttributes.md b/docs/Rules/AvoidMultipleTypeAttributes.md index 8e8209a9b..f0c25e4e8 100644 --- a/docs/Rules/AvoidMultipleTypeAttributes.md +++ b/docs/Rules/AvoidMultipleTypeAttributes.md @@ -1,3 +1,10 @@ +--- +description: Avoid multiple type specifiers on parameters. +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: AvoidMultipleTypeAttributes +--- # AvoidMultipleTypeAttributes **Severity Level: Warning** diff --git a/docs/Rules/AvoidNullOrEmptyHelpMessageAttribute.md b/docs/Rules/AvoidNullOrEmptyHelpMessageAttribute.md index 2421acaa0..9f07ddc53 100644 --- a/docs/Rules/AvoidNullOrEmptyHelpMessageAttribute.md +++ b/docs/Rules/AvoidNullOrEmptyHelpMessageAttribute.md @@ -1,3 +1,10 @@ +--- +description: Avoid using null or empty HelpMessage parameter attribute. +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: AvoidNullOrEmptyHelpMessageAttribute +--- # AvoidNullOrEmptyHelpMessageAttribute **Severity Level: Warning** diff --git a/docs/Rules/AvoidOverwritingBuiltInCmdlets.md b/docs/Rules/AvoidOverwritingBuiltInCmdlets.md index 8a8ed8ec4..ef3f627ec 100644 --- a/docs/Rules/AvoidOverwritingBuiltInCmdlets.md +++ b/docs/Rules/AvoidOverwritingBuiltInCmdlets.md @@ -1,3 +1,10 @@ +--- +description: Avoid overwriting built in cmdlets +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: AvoidOverwritingBuiltInCmdlets +--- # AvoidOverwritingBuiltInCmdlets **Severity Level: Warning** diff --git a/docs/Rules/AvoidShouldContinueWithoutForce.md b/docs/Rules/AvoidShouldContinueWithoutForce.md index fd27a1979..7f9a2e401 100644 --- a/docs/Rules/AvoidShouldContinueWithoutForce.md +++ b/docs/Rules/AvoidShouldContinueWithoutForce.md @@ -1,3 +1,10 @@ +--- +description: Avoid Using ShouldContinue Without Boolean Force Parameter +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: AvoidShouldContinueWithoutForce +--- # AvoidShouldContinueWithoutForce **Severity Level: Warning** diff --git a/docs/Rules/AvoidTrailingWhitespace.md b/docs/Rules/AvoidTrailingWhitespace.md index 8e805b25b..8e172b403 100644 --- a/docs/Rules/AvoidTrailingWhitespace.md +++ b/docs/Rules/AvoidTrailingWhitespace.md @@ -1,3 +1,10 @@ +--- +description: Avoid trailing whitespace +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: AvoidTrailingWhitespace +--- # AvoidTrailingWhitespace **Severity Level: Information** diff --git a/docs/Rules/AvoidUsingCmdletAliases.md b/docs/Rules/AvoidUsingCmdletAliases.md index 691986e5b..defe60cfc 100644 --- a/docs/Rules/AvoidUsingCmdletAliases.md +++ b/docs/Rules/AvoidUsingCmdletAliases.md @@ -1,3 +1,10 @@ +--- +description: Avoid Using Cmdlet Aliases or omitting the 'Get-' prefix. +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: AvoidUsingCmdletAliases +--- # AvoidUsingCmdletAliases **Severity Level: Warning** diff --git a/docs/Rules/AvoidUsingComputerNameHardcoded.md b/docs/Rules/AvoidUsingComputerNameHardcoded.md index 995c69b75..423f23e15 100644 --- a/docs/Rules/AvoidUsingComputerNameHardcoded.md +++ b/docs/Rules/AvoidUsingComputerNameHardcoded.md @@ -1,3 +1,10 @@ +--- +description: Avoid Using ComputerName Hardcoded +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: AvoidUsingComputerNameHardcoded +--- # AvoidUsingComputerNameHardcoded **Severity Level: Error** @@ -11,7 +18,7 @@ The names of computers should never be hard coded as this will expose sensitive Remove hard coded computer names. -## Example +## Example 1 ### Wrong @@ -31,7 +38,7 @@ Function Invoke-MyCommand ($ComputerName) } ``` -## Example +## Example 2 ### Wrong diff --git a/docs/Rules/AvoidUsingConvertToSecureStringWithPlainText.md b/docs/Rules/AvoidUsingConvertToSecureStringWithPlainText.md index 9c400c5f8..c269d2676 100644 --- a/docs/Rules/AvoidUsingConvertToSecureStringWithPlainText.md +++ b/docs/Rules/AvoidUsingConvertToSecureStringWithPlainText.md @@ -1,3 +1,10 @@ +--- +description: Avoid Using SecureString With Plain Text +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: AvoidUsingConvertToSecureStringWithPlainText +--- # AvoidUsingConvertToSecureStringWithPlainText **Severity Level: Error** diff --git a/docs/Rules/AvoidUsingDeprecatedManifestFields.md b/docs/Rules/AvoidUsingDeprecatedManifestFields.md index c65041e6b..ac42739cc 100644 --- a/docs/Rules/AvoidUsingDeprecatedManifestFields.md +++ b/docs/Rules/AvoidUsingDeprecatedManifestFields.md @@ -1,3 +1,10 @@ +--- +description: Avoid Using Deprecated Manifest Fields +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: AvoidUsingDeprecatedManifestFields +--- # AvoidUsingDeprecatedManifestFields **Severity Level: Warning** diff --git a/docs/Rules/AvoidUsingDoubleQuotesForConstantString.md b/docs/Rules/AvoidUsingDoubleQuotesForConstantString.md index f18361718..9d1730f24 100644 --- a/docs/Rules/AvoidUsingDoubleQuotesForConstantString.md +++ b/docs/Rules/AvoidUsingDoubleQuotesForConstantString.md @@ -1,3 +1,10 @@ +--- +description: Avoid using double quotes if the string is constant. +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: AvoidUsingDoubleQuotesForConstantString +--- # AvoidUsingDoubleQuotesForConstantString **Severity Level: Information** diff --git a/docs/Rules/AvoidUsingEmptyCatchBlock.md b/docs/Rules/AvoidUsingEmptyCatchBlock.md index 474db4d1c..a49d8eeac 100644 --- a/docs/Rules/AvoidUsingEmptyCatchBlock.md +++ b/docs/Rules/AvoidUsingEmptyCatchBlock.md @@ -1,3 +1,10 @@ +--- +description: Avoid Using Empty Catch Block +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: AvoidUsingEmptyCatchBlock +--- # AvoidUsingEmptyCatchBlock **Severity Level: Warning** diff --git a/docs/Rules/AvoidUsingInvokeExpression.md b/docs/Rules/AvoidUsingInvokeExpression.md index 3008f0cab..eedf8126a 100644 --- a/docs/Rules/AvoidUsingInvokeExpression.md +++ b/docs/Rules/AvoidUsingInvokeExpression.md @@ -1,3 +1,10 @@ +--- +description: Avoid Using Invoke-Expression +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: AvoidUsingInvokeExpression +--- # AvoidUsingInvokeExpression **Severity Level: Warning** diff --git a/docs/Rules/AvoidUsingPlainTextForPassword.md b/docs/Rules/AvoidUsingPlainTextForPassword.md index 793d12113..f2b8478f1 100644 --- a/docs/Rules/AvoidUsingPlainTextForPassword.md +++ b/docs/Rules/AvoidUsingPlainTextForPassword.md @@ -1,3 +1,10 @@ +--- +description: Avoid Using Plain Text For Password Parameter +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: AvoidUsingPlainTextForPassword +--- # AvoidUsingPlainTextForPassword **Severity Level: Warning** diff --git a/docs/Rules/AvoidUsingPositionalParameters.md b/docs/Rules/AvoidUsingPositionalParameters.md index f1169aa5c..4c31edefb 100644 --- a/docs/Rules/AvoidUsingPositionalParameters.md +++ b/docs/Rules/AvoidUsingPositionalParameters.md @@ -1,3 +1,10 @@ +--- +description: Avoid Using Positional Parameters +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: AvoidUsingPositionalParameters +--- # AvoidUsingPositionalParameters ** Severity Level: Information ** diff --git a/docs/Rules/AvoidUsingUsernameAndPasswordParams.md b/docs/Rules/AvoidUsingUsernameAndPasswordParams.md index 9ab524d73..f2fc0d222 100644 --- a/docs/Rules/AvoidUsingUsernameAndPasswordParams.md +++ b/docs/Rules/AvoidUsingUsernameAndPasswordParams.md @@ -1,3 +1,10 @@ +--- +description: Avoid Using Username and Password Parameters +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: AvoidUsingUsernameAndPasswordParams +--- # AvoidUsingUsernameAndPasswordParams **Severity Level: Error** diff --git a/docs/Rules/AvoidUsingWMICmdlet.md b/docs/Rules/AvoidUsingWMICmdlet.md index 7e9ffa390..3a934b2cc 100644 --- a/docs/Rules/AvoidUsingWMICmdlet.md +++ b/docs/Rules/AvoidUsingWMICmdlet.md @@ -1,3 +1,10 @@ +--- +description: Avoid Using Get-WMIObject, Remove-WMIObject, Invoke-WmiMethod, Register-WmiEvent, Set-WmiInstance +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: AvoidUsingWMICmdlet +--- # AvoidUsingWMICmdlet **Severity Level: Warning** diff --git a/docs/Rules/AvoidUsingWriteHost.md b/docs/Rules/AvoidUsingWriteHost.md index 0322fc564..96cf22ad0 100644 --- a/docs/Rules/AvoidUsingWriteHost.md +++ b/docs/Rules/AvoidUsingWriteHost.md @@ -1,3 +1,10 @@ +--- +description: Avoid Using Write-Host +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: AvoidUsingWriteHost +--- # AvoidUsingWriteHost **Severity Level: Warning** diff --git a/docs/Rules/DSCDscExamplesPresent.md b/docs/Rules/DSCDscExamplesPresent.md index 8fc0cc475..b01820876 100644 --- a/docs/Rules/DSCDscExamplesPresent.md +++ b/docs/Rules/DSCDscExamplesPresent.md @@ -1,3 +1,10 @@ +--- +description: DSC examples are present +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: DSCDscExamplesPresent +--- # DscExamplesPresent **Severity Level: Information** diff --git a/docs/Rules/DSCDscTestsPresent.md b/docs/Rules/DSCDscTestsPresent.md index 4cec783c4..4b1d66fe2 100644 --- a/docs/Rules/DSCDscTestsPresent.md +++ b/docs/Rules/DSCDscTestsPresent.md @@ -1,3 +1,10 @@ +--- +description: Dsc tests are present +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: DSCDscTestsPresent +--- # DscTestsPresent **Severity Level: Information** diff --git a/docs/Rules/DSCReturnCorrectTypesForDSCFunctions.md b/docs/Rules/DSCReturnCorrectTypesForDSCFunctions.md index 2f4574caa..3c9f9eb52 100644 --- a/docs/Rules/DSCReturnCorrectTypesForDSCFunctions.md +++ b/docs/Rules/DSCReturnCorrectTypesForDSCFunctions.md @@ -1,3 +1,10 @@ +--- +description: Return Correct Types For DSC Functions +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: DSCReturnCorrectTypesForDSCFunctions +--- # ReturnCorrectTypesForDSCFunctions **Severity Level: Information** @@ -22,7 +29,7 @@ For class based resources: Ensure that each function returns the correct type. -## Example +## Example 1 ### Wrong @@ -100,7 +107,7 @@ function Test-TargetResource } ``` -## Example +## Example 2 ### Wrong diff --git a/docs/Rules/DSCStandardDSCFunctionsInResource.md b/docs/Rules/DSCStandardDSCFunctionsInResource.md index a1bfa20be..dde0f8876 100644 --- a/docs/Rules/DSCStandardDSCFunctionsInResource.md +++ b/docs/Rules/DSCStandardDSCFunctionsInResource.md @@ -1,3 +1,10 @@ +--- +description: Use Standard Get/Set/Test TargetResource functions in DSC Resource +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: DSCStandardDSCFunctionsInResource +--- # StandardDSCFunctionsInResource **Severity Level: Error** @@ -22,7 +29,7 @@ For class based resources: Add the missing functions to the resource. -## Example +## Example 1 ### Wrong @@ -50,6 +57,7 @@ function Set-TargetResource ... } ``` + ### Correct ```powershell @@ -89,7 +97,7 @@ function Test-TargetResource } ``` -## Example +## Example 2 ### Wrong diff --git a/docs/Rules/DSCUseIdenticalMandatoryParametersForDSC.md b/docs/Rules/DSCUseIdenticalMandatoryParametersForDSC.md index 6a20dbcf2..64a3d7305 100644 --- a/docs/Rules/DSCUseIdenticalMandatoryParametersForDSC.md +++ b/docs/Rules/DSCUseIdenticalMandatoryParametersForDSC.md @@ -1,3 +1,10 @@ +--- +description: Use identical mandatory parameters for DSC Get/Test/Set TargetResource functions +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: DSCUseIdenticalMandatoryParametersForDSC +--- # UseIdenticalMandatoryParametersForDSC **Severity Level: Error** diff --git a/docs/Rules/DSCUseIdenticalParametersForDSC.md b/docs/Rules/DSCUseIdenticalParametersForDSC.md index 8c3d03a50..3282278fa 100644 --- a/docs/Rules/DSCUseIdenticalParametersForDSC.md +++ b/docs/Rules/DSCUseIdenticalParametersForDSC.md @@ -1,3 +1,10 @@ +--- +description: Use Identical Parameters For DSC Test and Set Functions +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: DSCUseIdenticalParametersForDSC +--- # UseIdenticalParametersForDSC **Severity Level: Error** diff --git a/docs/Rules/DSCUseVerboseMessageInDSCResource.md b/docs/Rules/DSCUseVerboseMessageInDSCResource.md index 019b2dbc9..b491152cc 100644 --- a/docs/Rules/DSCUseVerboseMessageInDSCResource.md +++ b/docs/Rules/DSCUseVerboseMessageInDSCResource.md @@ -1,3 +1,10 @@ +--- +description: Use verbose message in DSC resource +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: DSCUseVerboseMessageInDSCResource +--- # UseVerboseMessageInDSCResource **Severity Level: Information** diff --git a/docs/Rules/MisleadingBacktick.md b/docs/Rules/MisleadingBacktick.md index da36ef77c..10bb962b6 100644 --- a/docs/Rules/MisleadingBacktick.md +++ b/docs/Rules/MisleadingBacktick.md @@ -1,3 +1,10 @@ +--- +description: Misleading Backtick +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: MisleadingBacktick +--- # MisleadingBacktick **Severity Level: Warning** diff --git a/docs/Rules/MissingModuleManifestField.md b/docs/Rules/MissingModuleManifestField.md index 82cfc41d9..da7a7fae6 100644 --- a/docs/Rules/MissingModuleManifestField.md +++ b/docs/Rules/MissingModuleManifestField.md @@ -1,3 +1,10 @@ +--- +description: Module Manifest Fields +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: MissingModuleManifestField +--- # MissingModuleManifestField **Severity Level: Warning** diff --git a/docs/Rules/PlaceCloseBrace.md b/docs/Rules/PlaceCloseBrace.md index 970933549..ef48fe16a 100644 --- a/docs/Rules/PlaceCloseBrace.md +++ b/docs/Rules/PlaceCloseBrace.md @@ -1,3 +1,10 @@ +--- +description: Place close braces +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: PlaceCloseBrace +--- # PlaceCloseBrace **Severity Level: Warning** diff --git a/docs/Rules/PlaceOpenBrace.md b/docs/Rules/PlaceOpenBrace.md index e50d13ca9..181398b4f 100644 --- a/docs/Rules/PlaceOpenBrace.md +++ b/docs/Rules/PlaceOpenBrace.md @@ -1,3 +1,10 @@ +--- +description: Place open braces consistently +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: PlaceOpenBrace +--- # PlaceOpenBrace **Severity Level: Warning** diff --git a/docs/Rules/PossibleIncorrectComparisonWithNull.md b/docs/Rules/PossibleIncorrectComparisonWithNull.md index 6bd5a0db2..83f64b652 100644 --- a/docs/Rules/PossibleIncorrectComparisonWithNull.md +++ b/docs/Rules/PossibleIncorrectComparisonWithNull.md @@ -1,3 +1,10 @@ +--- +description: Null Comparison +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: PossibleIncorrectComparisonWithNull +--- # PossibleIncorrectComparisonWithNull **Severity Level: Warning** diff --git a/docs/Rules/PossibleIncorrectUsageOfAssignmentOperator.md b/docs/Rules/PossibleIncorrectUsageOfAssignmentOperator.md index 40b2d9159..37205663f 100644 --- a/docs/Rules/PossibleIncorrectUsageOfAssignmentOperator.md +++ b/docs/Rules/PossibleIncorrectUsageOfAssignmentOperator.md @@ -1,12 +1,19 @@ +--- +description: Equal sign is not an assignment operator. Did you mean the equality operator \'-eq\'? +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: PossibleIncorrectUsageOfAssignmentOperator +--- # PossibleIncorrectUsageOfAssignmentOperator **Severity Level: Information** ## Description -In many programming languages, the equality operator is denoted as `==` or `=`, but `PowerShell` uses `-eq`. Therefore, it can easily happen that the wrong operator is -used unintentionally. This rule catches a few special cases where the likelihood of that is quite -high. +In many programming languages, the equality operator is denoted as `==` or `=`, but `PowerShell` +uses `-eq`. Therefore, it can easily happen that the wrong operator is used unintentionally. This +rule catches a few special cases where the likelihood of that is quite high. The rule looks for usages of `==` and `=` operators inside `if`, `else if`, `while` and `do-while` statements but it does not warn if any kind of command or expression is used at the right hand side diff --git a/docs/Rules/PossibleIncorrectUsageOfRedirectionOperator.md b/docs/Rules/PossibleIncorrectUsageOfRedirectionOperator.md index 0a3cdb87a..08ddc165f 100644 --- a/docs/Rules/PossibleIncorrectUsageOfRedirectionOperator.md +++ b/docs/Rules/PossibleIncorrectUsageOfRedirectionOperator.md @@ -1,3 +1,10 @@ +--- +description: \'>\' is not a comparison operator. Use \'-gt\' (greater than) or \'-ge\' (greater or equal). +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: PossibleIncorrectUsageOfRedirectionOperator +--- # PossibleIncorrectUsageOfRedirectionOperator **Severity Level: Information** diff --git a/docs/Rules/ProvideCommentHelp.md b/docs/Rules/ProvideCommentHelp.md index c250bc2b4..9e9a4305a 100644 --- a/docs/Rules/ProvideCommentHelp.md +++ b/docs/Rules/ProvideCommentHelp.md @@ -1,3 +1,10 @@ +--- +description: Basic Comment Help +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: ProvideCommentHelp +--- # ProvideCommentHelp **Severity Level: Info** @@ -10,9 +17,9 @@ presence of comment based help and not on the validity or format. For assistance on comment based help, use the command `Get-Help about_comment_based_help` or the following articles: -- [Writing Comment-based Help](https://docs.microsoft.com/powershell/scripting/developer/help/writing-comment-based-help-topics) -- [Writing Help for PowerShell Cmdlets](https://docs.microsoft.com/powershell/scripting/developer/help/writing-help-for-windows-powershell-cmdlets) -- [Create XML-based help using PlatyPS](https://docs.microsoft.com/powershell/scripting/dev-cross-plat/create-help-using-platyps) +- [Writing Comment-based Help](/powershell/scripting/developer/help/writing-comment-based-help-topics) +- [Writing Help for PowerShell Cmdlets](/powershell/scripting/developer/help/writing-help-for-windows-powershell-cmdlets) +- [Create XML-based help using PlatyPS](/powershell/scripting/dev-cross-plat/create-help-using-platyps) ## Configuration diff --git a/docs/Rules/README.md b/docs/Rules/README.md index 5eabee967..e695e7039 100644 --- a/docs/Rules/README.md +++ b/docs/Rules/README.md @@ -1,6 +1,13 @@ +--- +description: List of PSScriptAnalyzer rules +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: List of PSScriptAnalyzer rules +--- # PSScriptAnalyzer Rules -## Table of Contents +The PSScriptAnalyzer contains the following rule definitions. | Rule | Severity | Enabled by default | Configurable | | ------------------------------------------------------------------------------------------------- | ----------- | :----------------: | :-------------: | @@ -65,7 +72,7 @@ | [UseProcessBlockForPipelineCommand](./UseProcessBlockForPipelineCommand.md) | Warning | Yes | | | [UsePSCredentialType](./UsePSCredentialType.md) | Warning | Yes | | | [UseShouldProcessForStateChangingFunctions](./UseShouldProcessForStateChangingFunctions.md) | Warning | Yes | | -| [UseSingularNouns1](./UseSingularNouns.md) | Warning | Yes | | +| [UseSingularNouns](./UseSingularNouns.md) | Warning | Yes | | | [UseSupportsShouldProcess](./UseSupportsShouldProcess.md) | Warning | Yes | | | [UseToExportFieldsInManifest](./UseToExportFieldsInManifest.md) | Warning | Yes | | | [UseUsingScopeModifierInNewRunspaces](./UseUsingScopeModifierInNewRunspaces.md) | Warning | Yes | | diff --git a/docs/Rules/ReservedCmdletChar.md b/docs/Rules/ReservedCmdletChar.md index c6b026bd4..49e405a01 100644 --- a/docs/Rules/ReservedCmdletChar.md +++ b/docs/Rules/ReservedCmdletChar.md @@ -1,3 +1,10 @@ +--- +description: Reserved Cmdlet Chars +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: ReservedCmdletChar +--- # ReservedCmdletChar **Severity Level: Error** diff --git a/docs/Rules/ReservedParams.md b/docs/Rules/ReservedParams.md index 923be9a87..cda63560a 100644 --- a/docs/Rules/ReservedParams.md +++ b/docs/Rules/ReservedParams.md @@ -1,3 +1,10 @@ +--- +description: Reserved Parameters +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: ReservedParams +--- # ReservedParams **Severity Level: Error** diff --git a/docs/Rules/ReviewUnusedParameter.md b/docs/Rules/ReviewUnusedParameter.md index 72095552c..c94407207 100644 --- a/docs/Rules/ReviewUnusedParameter.md +++ b/docs/Rules/ReviewUnusedParameter.md @@ -1,3 +1,10 @@ +--- +description: ReviewUnusedParameter +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: ReviewUnusedParameter +--- # ReviewUnusedParameter **Severity Level: Warning** diff --git a/docs/Rules/ShouldProcess.md b/docs/Rules/ShouldProcess.md index 053627f1f..013fd2e77 100644 --- a/docs/Rules/ShouldProcess.md +++ b/docs/Rules/ShouldProcess.md @@ -1,3 +1,10 @@ +--- +description: Should Process +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: ShouldProcess +--- # ShouldProcess **Severity Level: Warning** diff --git a/docs/Rules/UseApprovedVerbs.md b/docs/Rules/UseApprovedVerbs.md index 5627e9452..3d71188d8 100644 --- a/docs/Rules/UseApprovedVerbs.md +++ b/docs/Rules/UseApprovedVerbs.md @@ -1,3 +1,10 @@ +--- +description: Cmdlet Verbs +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: UseApprovedVerbs +--- # UseApprovedVerbs **Severity Level: Warning** @@ -9,7 +16,7 @@ All cmdlets must used approved verbs. Approved verbs can be found by running the command `Get-Verb`. Additional documentation on approved verbs can be found in the microsoft docs page -[Approved Verbs for PowerShell Commands](https://docs.microsoft.com/powershell/scripting/developer/cmdlet/approved-verbs-for-windows-powershell-commands). +[Approved Verbs for PowerShell Commands](/powershell/scripting/developer/cmdlet/approved-verbs-for-windows-powershell-commands). Some unapproved verbs are documented on the approved verbs page and point to approved alternatives. Try searching for the verb you used to find its approved form. For example, searching for `Read`, `Open`, or `Search` leads you to `Get`. diff --git a/docs/Rules/UseBOMForUnicodeEncodedFile.md b/docs/Rules/UseBOMForUnicodeEncodedFile.md index cc287eadc..56e1fa121 100644 --- a/docs/Rules/UseBOMForUnicodeEncodedFile.md +++ b/docs/Rules/UseBOMForUnicodeEncodedFile.md @@ -1,3 +1,10 @@ +--- +description: Use BOM encoding for non-ASCII files +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: UseBOMForUnicodeEncodedFile +--- # UseBOMForUnicodeEncodedFile **Severity Level: Warning** diff --git a/docs/Rules/UseCmdletCorrectly.md b/docs/Rules/UseCmdletCorrectly.md index e7558d37c..5786c2622 100644 --- a/docs/Rules/UseCmdletCorrectly.md +++ b/docs/Rules/UseCmdletCorrectly.md @@ -1,3 +1,10 @@ +--- +description: Use Cmdlet Correctly +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: UseCmdletCorrectly +--- # UseCmdletCorrectly **Severity Level: Warning** diff --git a/docs/Rules/UseCompatibleCmdlets.md b/docs/Rules/UseCompatibleCmdlets.md index a2ae7fe43..931a67d82 100644 --- a/docs/Rules/UseCompatibleCmdlets.md +++ b/docs/Rules/UseCompatibleCmdlets.md @@ -1,3 +1,10 @@ +--- +description: Use compatible cmdlets +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: UseCompatibleCmdlets +--- # UseCompatibleCmdlets **Severity Level: Warning** diff --git a/docs/Rules/UseCompatibleCommands.md b/docs/Rules/UseCompatibleCommands.md index 0da44c8b0..5a0708d18 100644 --- a/docs/Rules/UseCompatibleCommands.md +++ b/docs/Rules/UseCompatibleCommands.md @@ -1,3 +1,10 @@ +--- +description: Use compatible commands +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: UseCompatibleCommands +--- # UseCompatibleCommands **Severity Level: Warning** diff --git a/docs/Rules/UseCompatibleSyntax.md b/docs/Rules/UseCompatibleSyntax.md index c299dfb36..b2d7aeb1d 100644 --- a/docs/Rules/UseCompatibleSyntax.md +++ b/docs/Rules/UseCompatibleSyntax.md @@ -1,3 +1,10 @@ +--- +description: Use compatible syntax +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: UseCompatibleSyntax +--- # UseCompatibleSyntax **Severity Level: Warning** @@ -6,7 +13,8 @@ This rule identifies syntax elements that are incompatible with targeted PowerShell versions. -It cannot identify syntax elements incompatible with PowerShell 3 or 4 when run from those PowerShell versions because they aren't able to parse the incompatible syntaxes. +It cannot identify syntax elements incompatible with PowerShell 3 or 4 when run from those +PowerShell versions because they aren't able to parse the incompatible syntaxes. ```powershell @{ diff --git a/docs/Rules/UseCompatibleTypes.md b/docs/Rules/UseCompatibleTypes.md index f1574697a..6ea6e2565 100644 --- a/docs/Rules/UseCompatibleTypes.md +++ b/docs/Rules/UseCompatibleTypes.md @@ -1,3 +1,10 @@ +--- +description: Use compatible types +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: UseCompatibleTypes +--- # UseCompatibleTypes **Severity Level: Warning** diff --git a/docs/Rules/UseConsistentIndentation.md b/docs/Rules/UseConsistentIndentation.md index 48458a423..d593c581f 100644 --- a/docs/Rules/UseConsistentIndentation.md +++ b/docs/Rules/UseConsistentIndentation.md @@ -1,3 +1,10 @@ +--- +description: Use consistent indentation +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: UseConsistentIndentation +--- # UseConsistentIndentation **Severity Level: Warning** diff --git a/docs/Rules/UseConsistentWhitespace.md b/docs/Rules/UseConsistentWhitespace.md index 999a16190..5544e3644 100644 --- a/docs/Rules/UseConsistentWhitespace.md +++ b/docs/Rules/UseConsistentWhitespace.md @@ -1,74 +1,77 @@ +--- +description: Use whitespaces +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: UseConsistentWhitespace +--- # UseConsistentWhitespace **Severity Level: Warning** ## Description -# Parameters - -**Note**: This rule is not enabled by default. The user needs to enable it through settings. +This rule is not enabled by default. The user needs to enable it through settings. ## Configuration ```powershell - Rules = @{ - PSUseConsistentWhitespace = @{ - Enable = $true - CheckInnerBrace = $true - CheckOpenBrace = $true - CheckOpenParen = $true - CheckOperator = $true - CheckPipe = $true - CheckPipeForRedundantWhitespace = $false - CheckSeparator = $true - CheckParameter = $false - IgnoreAssignmentOperatorInsideHashTable = $false - } +Rules = @{ + PSUseConsistentWhitespace = @{ + Enable = $true + CheckInnerBrace = $true + CheckOpenBrace = $true + CheckOpenParen = $true + CheckOperator = $true + CheckPipe = $true + CheckPipeForRedundantWhitespace = $false + CheckSeparator = $true + CheckParameter = $false + IgnoreAssignmentOperatorInsideHashTable = $false } +} ``` -### Parameters - -#### Enable: bool (Default value is `$false`) +### Enable: bool (Default value is `$false`) Enable or disable the rule during ScriptAnalyzer invocation. -#### CheckInnerBrace: bool (Default value is `$true`) +### CheckInnerBrace: bool (Default value is `$true`) Checks if there is a space after the opening brace and a space before the closing brace. E.g. `if ($true) { foo }` instead of `if ($true) {bar}`. -#### CheckOpenBrace: bool (Default value is `$true`) +### CheckOpenBrace: bool (Default value is `$true`) Checks if there is a space between a keyword and its corresponding open brace. E.g. `foo { }` instead of `foo{ }`. If an open brace is preceded by an open parenthesis, then no space is required. -#### CheckOpenParen: bool (Default value is `$true`) +### CheckOpenParen: bool (Default value is `$true`) Checks if there is space between a keyword and its corresponding open parenthesis. E.g. `if (true)` instead of `if(true)`. -#### CheckOperator: bool (Default value is `$true`) +### CheckOperator: bool (Default value is `$true`) Checks if a binary or unary operator is surrounded on both sides by a space. E.g. `$x = 1` instead of `$x=1`. -#### CheckSeparator: bool (Default value is `$true`) +### CheckSeparator: bool (Default value is `$true`) Checks if a comma or a semicolon is followed by a space. E.g. `@(1, 2, 3)` or `@{a = 1; b = 2}` instead of `@(1,2,3)` or `@{a = 1;b = 2}`. -#### CheckPipe: bool (Default value is `$true`) +### CheckPipe: bool (Default value is `$true`) Checks if a pipe is surrounded on both sides by a space but ignores redundant whitespace. E.g. `foo | bar` instead of `foo|bar`. -#### CheckPipeForRedundantWhitespace : bool (Default value is `$false`) +### CheckPipeForRedundantWhitespace : bool (Default value is `$false`) Checks if a pipe is surrounded by redundant whitespace (i.e. more than 1 whitespace). E.g. `foo | bar` instead of `foo | bar`. -#### CheckParameter: bool (Default value is `$false` at the moment due to the setting being new) +### CheckParameter: bool (Default value is `$false` at the moment due to the setting being new) Checks if there is more than one space between parameters and values. E.g. `foo -bar $baz -bat` instead of `foo -bar $baz -bat`. This eliminates redundant whitespace that was probably added @@ -76,8 +79,8 @@ unintentionally. The rule does not check for whitespace between parameter and va syntax `-ParameterName:$ParameterValue` is used as some users prefer either 0 or 1 whitespace in this case. -#### IgnoreAssignmentOperatorInsideHashTable: bool (Default value is `$false`) +### IgnoreAssignmentOperatorInsideHashTable: bool (Default value is `$false`) When `CheckOperator` is set, ignore whitespace around assignment operators within multi-line hash -tables. Set this option in order to use the `AlignAssignmentStatement` rule but still check -whitespace around operators everywhere else. \ No newline at end of file +tables. Set this option to use the `AlignAssignmentStatement` rule and still check whitespace around +operators everywhere else. diff --git a/docs/Rules/UseCorrectCasing.md b/docs/Rules/UseCorrectCasing.md index b5a1d1038..b35954c7a 100644 --- a/docs/Rules/UseCorrectCasing.md +++ b/docs/Rules/UseCorrectCasing.md @@ -1,3 +1,10 @@ +--- +description: Use exact casing of cmdlet/function/parameter name. +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: UseCorrectCasing +--- # UseCorrectCasing **Severity Level: Information** diff --git a/docs/Rules/UseDeclaredVarsMoreThanAssignments.md b/docs/Rules/UseDeclaredVarsMoreThanAssignments.md index 48e36991c..ce787ebf3 100644 --- a/docs/Rules/UseDeclaredVarsMoreThanAssignments.md +++ b/docs/Rules/UseDeclaredVarsMoreThanAssignments.md @@ -1,3 +1,10 @@ +--- +description: Extra Variables +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: UseDeclaredVarsMoreThanAssignments +--- # UseDeclaredVarsMoreThanAssignments **Severity Level: Warning** diff --git a/docs/Rules/UseLiteralInitializerForHashtable.md b/docs/Rules/UseLiteralInitializerForHashtable.md index 8014ff22e..b8ce225d0 100644 --- a/docs/Rules/UseLiteralInitializerForHashtable.md +++ b/docs/Rules/UseLiteralInitializerForHashtable.md @@ -1,3 +1,10 @@ +--- +description: Create hashtables with literal initializers +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: UseLiteralInitializerForHashtable +--- # UseLiteralInitializerForHashtable **Severity Level: Warning** diff --git a/docs/Rules/UseOutputTypeCorrectly.md b/docs/Rules/UseOutputTypeCorrectly.md index c981000de..c151271ea 100644 --- a/docs/Rules/UseOutputTypeCorrectly.md +++ b/docs/Rules/UseOutputTypeCorrectly.md @@ -1,3 +1,10 @@ +--- +description: Use OutputType Correctly +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: UseOutputTypeCorrectly +--- # UseOutputTypeCorrectly **Severity Level: Information** diff --git a/docs/Rules/UsePSCredentialType.md b/docs/Rules/UsePSCredentialType.md index 07ffcb2ae..756e6b265 100644 --- a/docs/Rules/UsePSCredentialType.md +++ b/docs/Rules/UsePSCredentialType.md @@ -1,3 +1,10 @@ +--- +description: Use PSCredential type. +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: UsePSCredentialType +--- # UsePSCredentialType **Severity Level: Warning** diff --git a/docs/Rules/UseProcessBlockForPipelineCommand.md b/docs/Rules/UseProcessBlockForPipelineCommand.md index f0d5a4748..b16b07ce1 100644 --- a/docs/Rules/UseProcessBlockForPipelineCommand.md +++ b/docs/Rules/UseProcessBlockForPipelineCommand.md @@ -1,3 +1,10 @@ +--- +description: Use process block for command that accepts input from pipeline. +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: UseProcessBlockForPipelineCommand +--- # UseProcessBlockForPipelineCommand **Severity Level: Warning** diff --git a/docs/Rules/UseShouldProcessForStateChangingFunctions.md b/docs/Rules/UseShouldProcessForStateChangingFunctions.md index 8835c77c0..b763a2d1a 100644 --- a/docs/Rules/UseShouldProcessForStateChangingFunctions.md +++ b/docs/Rules/UseShouldProcessForStateChangingFunctions.md @@ -1,3 +1,10 @@ +--- +description: Use ShouldProcess For State Changing Functions +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: UseShouldProcessForStateChangingFunctions +--- # UseShouldProcessForStateChangingFunctions **Severity Level: Warning** diff --git a/docs/Rules/UseSingularNouns.md b/docs/Rules/UseSingularNouns.md index 1ff3b8ba6..b885a22cf 100644 --- a/docs/Rules/UseSingularNouns.md +++ b/docs/Rules/UseSingularNouns.md @@ -1,3 +1,10 @@ +--- +description: Cmdlet Singular Noun +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: UseSingularNouns +--- # UseSingularNouns **Severity Level: Warning** @@ -6,9 +13,6 @@ PowerShell team best practices state cmdlets should use singular nouns and not plurals. -**NOTE** This rule is not available in PowerShell Core due to the **PluralizationService** API that -the rule uses internally. - ## How Change plurals to singular. diff --git a/docs/Rules/UseSupportsShouldProcess.md b/docs/Rules/UseSupportsShouldProcess.md index c937cf0dd..16b489ee7 100644 --- a/docs/Rules/UseSupportsShouldProcess.md +++ b/docs/Rules/UseSupportsShouldProcess.md @@ -1,4 +1,11 @@ -# UseSupportsShouldProcess +--- +description: Use SupportsShouldProcess +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: UseSupportsShouldProcess +--- +# UseSupportsShouldProcess **Severity Level: Warning** diff --git a/docs/Rules/UseToExportFieldsInManifest.md b/docs/Rules/UseToExportFieldsInManifest.md index 4358756d6..469abbf8f 100644 --- a/docs/Rules/UseToExportFieldsInManifest.md +++ b/docs/Rules/UseToExportFieldsInManifest.md @@ -1,3 +1,10 @@ +--- +description: Use the *ToExport module manifest fields. +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: UseToExportFieldsInManifest +--- # UseToExportFieldsInManifest **Severity Level: Warning** @@ -19,7 +26,7 @@ module auto-discovery. Use an explicit list in the entries. -## Example +## Example 1 Suppose there are no functions in your module to export. Then, @@ -35,7 +42,7 @@ FunctionsToExport = $null FunctionToExport = @() ``` -## Example +## Example 2 Suppose there are only two functions in your module, `Get-Foo` and `Set-Foo` that you want to export. Then, diff --git a/docs/Rules/UseUTF8EncodingForHelpFile.md b/docs/Rules/UseUTF8EncodingForHelpFile.md index b1ef86e98..6db26d407 100644 --- a/docs/Rules/UseUTF8EncodingForHelpFile.md +++ b/docs/Rules/UseUTF8EncodingForHelpFile.md @@ -1,3 +1,10 @@ +--- +description: Use UTF8 Encoding For Help File +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: UseUTF8EncodingForHelpFile +--- # UseUTF8EncodingForHelpFile **Severity Level: Warning** diff --git a/docs/Rules/UseUsingScopeModifierInNewRunspaces.md b/docs/Rules/UseUsingScopeModifierInNewRunspaces.md index 419faae28..65de58edd 100644 --- a/docs/Rules/UseUsingScopeModifierInNewRunspaces.md +++ b/docs/Rules/UseUsingScopeModifierInNewRunspaces.md @@ -1,3 +1,10 @@ +--- +description: Use 'Using:' scope modifier in RunSpace ScriptBlocks +ms.custom: PSSA v1.20.0 +ms.date: 10/18/2021 +ms.topic: reference +title: UseUsingScopeModifierInNewRunspaces +--- # UseUsingScopeModifierInNewRunspaces **Severity Level: Warning** @@ -61,4 +68,4 @@ Workflow { $foo = "foo" Start-ThreadJob -ScriptBlock { $using:foo } Start-Job -ScriptBlock {$using:foo } -``` \ No newline at end of file +```