Skip to content
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Align assignment statement
ms.custom: PSSA v1.20.0
ms.custom: PSSA v1.21.0
ms.date: 10/18/2021
ms.topic: reference
title: AlignAssignmentStatement
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Changing automatic variables might have undesired side effects
ms.custom: PSSA v1.20.0
ms.custom: PSSA v1.21.0
ms.date: 10/18/2021
ms.topic: reference
title: AvoidAssignmentToAutomaticVariable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Avoid Default Value For Mandatory Parameter
ms.custom: PSSA v1.20.0
ms.custom: PSSA v1.21.0
ms.date: 10/18/2021
ms.topic: reference
title: AvoidDefaultValueForMandatoryParameter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Switch Parameters Should Not Default To True
ms.custom: PSSA v1.20.0
ms.custom: PSSA v1.21.0
ms.date: 10/18/2021
ms.topic: reference
title: AvoidDefaultValueSwitchParameter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Avoid global aliases.
ms.custom: PSSA v1.20.0
ms.custom: PSSA v1.21.0
ms.date: 10/18/2021
ms.topic: reference
title: AvoidGlobalAliases
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Avoid global functions and aliases
ms.custom: PSSA v1.20.0
ms.custom: PSSA v1.21.0
ms.date: 10/18/2021
ms.topic: reference
title: AvoidGlobalFunctions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: No Global Variables
ms.custom: PSSA v1.20.0
ms.custom: PSSA v1.21.0
ms.date: 10/18/2021
ms.topic: reference
title: AvoidGlobalVars
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Avoid Invoking Empty Members
ms.custom: PSSA v1.20.0
ms.custom: PSSA v1.21.0
ms.date: 10/18/2021
ms.topic: reference
title: AvoidInvokingEmptyMembers
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Avoid long lines
ms.custom: PSSA v1.20.0
ms.custom: PSSA v1.21.0
ms.date: 10/18/2021
ms.topic: reference
title: AvoidLongLines
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Avoid multiple type specifiers on parameters.
ms.custom: PSSA v1.20.0
ms.custom: PSSA v1.21.0
ms.date: 10/18/2021
ms.topic: reference
title: AvoidMultipleTypeAttributes
Expand All @@ -12,7 +12,7 @@ title: AvoidMultipleTypeAttributes
## Description

Parameters should not have more than one type specifier. Multiple type specifiers on parameters
cause runtime errors.
can cause runtime errors.

## How

Expand All @@ -28,14 +28,10 @@ function Test-Script
[CmdletBinding()]
Param
(
[String]
$Param1,

[switch]
[bool]
[int]
$Switch
)
...
}
```

Expand All @@ -47,12 +43,8 @@ function Test-Script
[CmdletBinding()]
Param
(
[String]
$Param1,

[switch]
$Switch
)
...
}
```
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Avoid using null or empty HelpMessage parameter attribute.
ms.custom: PSSA v1.20.0
ms.custom: PSSA v1.21.0
ms.date: 10/18/2021
ms.topic: reference
title: AvoidNullOrEmptyHelpMessageAttribute
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Avoid overwriting built in cmdlets
ms.custom: PSSA v1.20.0
ms.custom: PSSA v1.21.0
ms.date: 10/18/2021
ms.topic: reference
title: AvoidOverwritingBuiltInCmdlets
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
---
description: Avoid semicolons as line terminators
ms.custom: PSSA v1.21.0
ms.date: 07/25/2022
ms.date: 06/15/2022
ms.topic: reference
title: AvoidSemicolonsAsLineTerminators
---

# AvoidSemicolonsAsLineTerminators

**Severity Level: Warning**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Avoid Using ShouldContinue Without Boolean Force Parameter
ms.custom: PSSA v1.20.0
ms.custom: PSSA v1.21.0
ms.date: 10/18/2021
ms.topic: reference
title: AvoidShouldContinueWithoutForce
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Avoid trailing whitespace
ms.custom: PSSA v1.20.0
ms.custom: PSSA v1.21.0
ms.date: 10/18/2021
ms.topic: reference
title: AvoidTrailingWhitespace
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Avoid Using Cmdlet Aliases or omitting the 'Get-' prefix.
ms.custom: PSSA v1.20.0
ms.custom: PSSA v1.21.0
ms.date: 10/18/2021
ms.topic: reference
title: AvoidUsingCmdletAliases
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Avoid Using ComputerName Hardcoded
ms.custom: PSSA v1.20.0
ms.custom: PSSA v1.21.0
ms.date: 10/18/2021
ms.topic: reference
title: AvoidUsingComputerNameHardcoded
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Avoid Using SecureString With Plain Text
ms.custom: PSSA v1.20.0
ms.custom: PSSA v1.21.0
ms.date: 10/18/2021
ms.topic: reference
title: AvoidUsingConvertToSecureStringWithPlainText
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Avoid Using Deprecated Manifest Fields
ms.custom: PSSA v1.20.0
ms.custom: PSSA v1.21.0
ms.date: 10/18/2021
ms.topic: reference
title: AvoidUsingDeprecatedManifestFields
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Avoid using double quotes if the string is constant.
ms.custom: PSSA v1.20.0
ms.custom: PSSA v1.21.0
ms.date: 10/18/2021
ms.topic: reference
title: AvoidUsingDoubleQuotesForConstantString
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Avoid Using Empty Catch Block
ms.custom: PSSA v1.20.0
ms.custom: PSSA v1.21.0
ms.date: 10/18/2021
ms.topic: reference
title: AvoidUsingEmptyCatchBlock
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Avoid Using Invoke-Expression
ms.custom: PSSA v1.20.0
ms.custom: PSSA v1.21.0
ms.date: 10/18/2021
ms.topic: reference
title: AvoidUsingInvokeExpression
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Avoid Using Plain Text For Password Parameter
ms.custom: PSSA v1.20.0
ms.custom: PSSA v1.21.0
ms.date: 10/18/2021
ms.topic: reference
title: AvoidUsingPlainTextForPassword
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Avoid Using Positional Parameters
ms.custom: PSSA v1.20.0
ms.custom: PSSA v1.21.0
ms.date: 10/18/2021
ms.topic: reference
title: AvoidUsingPositionalParameters
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Avoid Using Username and Password Parameters
ms.custom: PSSA v1.20.0
ms.custom: PSSA v1.21.0
ms.date: 10/18/2021
ms.topic: reference
title: AvoidUsingUsernameAndPasswordParams
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Avoid Using Get-WMIObject, Remove-WMIObject, Invoke-WmiMethod, Register-WmiEvent, Set-WmiInstance
ms.custom: PSSA v1.20.0
ms.custom: PSSA v1.21.0
ms.date: 10/18/2021
ms.topic: reference
title: AvoidUsingWMICmdlet
Expand Down Expand Up @@ -48,12 +48,12 @@ Change to the equivalent CIM based cmdlet.

```powershell
Get-WmiObject -Query 'Select * from Win32_Process where name LIKE "myprocess%"' | Remove-WmiObject
Invoke-WmiMethod ?Class Win32_Process ?Name "Create" ?ArgumentList @{ CommandLine = "notepad.exe" }
Invoke-WmiMethod -Class Win32_Process -Name "Create" -ArgumentList @{ CommandLine = "notepad.exe" }
```

### Correct

```powershell
Get-CimInstance -Query 'Select * from Win32_Process where name LIKE "myprocess%"' | Remove-CIMInstance
Invoke-CimMethod ?ClassName Win32_Process ?MethodName "Create" ?Arguments @{ CommandLine = "notepad.exe" }
Invoke-CimMethod -ClassName Win32_Process -MethodName "Create" -Arguments @{ CommandLine = "notepad.exe" }
```
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Avoid Using Write-Host
ms.custom: PSSA v1.20.0
ms.custom: PSSA v1.21.0
ms.date: 10/18/2021
ms.topic: reference
title: AvoidUsingWriteHost
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: DSC examples are present
ms.custom: PSSA v1.20.0
ms.custom: PSSA v1.21.0
ms.date: 10/18/2021
ms.topic: reference
title: DSCDscExamplesPresent
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Dsc tests are present
ms.custom: PSSA v1.20.0
ms.custom: PSSA v1.21.0
ms.date: 10/18/2021
ms.topic: reference
title: DSCDscTestsPresent
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Return Correct Types For DSC Functions
ms.custom: PSSA v1.20.0
ms.custom: PSSA v1.21.0
ms.date: 10/18/2021
ms.topic: reference
title: DSCReturnCorrectTypesForDSCFunctions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Use Standard Get/Set/Test TargetResource functions in DSC Resource
ms.custom: PSSA v1.20.0
ms.custom: PSSA v1.21.0
ms.date: 10/18/2021
ms.topic: reference
title: DSCStandardDSCFunctionsInResource
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Use identical mandatory parameters for DSC Get/Test/Set TargetResource functions
ms.custom: PSSA v1.20.0
ms.custom: PSSA v1.21.0
ms.date: 10/18/2021
ms.topic: reference
title: DSCUseIdenticalMandatoryParametersForDSC
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Use Identical Parameters For DSC Test and Set Functions
ms.custom: PSSA v1.20.0
ms.custom: PSSA v1.21.0
ms.date: 10/18/2021
ms.topic: reference
title: DSCUseIdenticalParametersForDSC
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Use verbose message in DSC resource
ms.custom: PSSA v1.20.0
ms.custom: PSSA v1.21.0
ms.date: 10/18/2021
ms.topic: reference
title: DSCUseVerboseMessageInDSCResource
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Misleading Backtick
ms.custom: PSSA v1.20.0
ms.custom: PSSA v1.21.0
ms.date: 10/18/2021
ms.topic: reference
title: MisleadingBacktick
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Module Manifest Fields
ms.custom: PSSA v1.20.0
ms.custom: PSSA v1.21.0
ms.date: 10/18/2021
ms.topic: reference
title: MissingModuleManifestField
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Place close braces
ms.custom: PSSA v1.20.0
ms.custom: PSSA v1.21.0
ms.date: 10/18/2021
ms.topic: reference
title: PlaceCloseBrace
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Place open braces consistently
ms.custom: PSSA v1.20.0
ms.custom: PSSA v1.21.0
ms.date: 10/18/2021
ms.topic: reference
title: PlaceOpenBrace
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Null Comparison
ms.custom: PSSA v1.20.0
ms.custom: PSSA v1.21.0
ms.date: 10/18/2021
ms.topic: reference
title: PossibleIncorrectComparisonWithNull
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Equal sign is not an assignment operator. Did you mean the equality operator '-eq'?
ms.custom: PSSA v1.20.0
description: Equal sign is not an assignment operator. Did you mean the equality operator \'-eq\'?
ms.custom: PSSA v1.21.0
ms.date: 10/18/2021
ms.topic: reference
title: PossibleIncorrectUsageOfAssignmentOperator
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: \'>\' is not a comparison operator. Use \'-gt\' (greater than) or \'-ge\' (greater or equal).
ms.custom: PSSA v1.20.0
ms.custom: PSSA v1.21.0
ms.date: 10/18/2021
ms.topic: reference
title: PossibleIncorrectUsageOfRedirectionOperator
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Basic Comment Help
ms.custom: PSSA v1.20.0
ms.custom: PSSA v1.21.0
ms.date: 10/18/2021
ms.topic: reference
title: ProvideCommentHelp
Expand Down
Loading