We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3e225dd commit 4f64efbCopy full SHA for 4f64efb
Tests/Rules/PSCredentialType.tests.ps1
@@ -14,6 +14,21 @@ Describe "PSCredentialType" {
14
It "has the correct description message" {
15
$violations[0].Message | Should Be $violationMessage
16
}
17
+
18
+ It "detects attributes on the same line" {
19
+ $scriptDef = @'
20
+function Get-Credential
21
+{
22
+ param(
23
+ [PSCredential][System.Management.Automation.Credential()]
24
+ $Credential
25
+ )
26
+}
27
+'@
28
+ $violations = Invoke-ScriptAnalyzer -ScriptDefinition $scriptDef -IncludeRule $violationName
29
+ $violations.Count | Should Be 0
30
+ }
31
32
33
34
$expectedViolationCount = 0
0 commit comments