Skip to content

Commit 3c614a3

Browse files
committed
Update AvoidUsingPlainTextForPassword.md
1 parent c9a78bb commit 3c614a3

File tree

1 file changed

+26
-24
lines changed

1 file changed

+26
-24
lines changed

RuleDocumentation/AvoidUsingPlainTextForPassword.md

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ To fix a violation of this rule, please use SecurityString as the type of passwo
1313
##Example
1414

1515
Wrong:
16-
16+
```
1717
function Verb-Noun
1818
{
1919
[CmdletBinding()]
@@ -27,30 +27,31 @@ Wrong:
2727
Position=0)]
2828
$Param1,
2929
# Param2 help description
30-
[int]
30+
[Int]
3131
$Param2,
32-
[securestring]
32+
[SecureString]
3333
$Password,
3434
[System.Security.SecureString]
35-
$pass,
36-
[securestring[]]
37-
$passwords,
38-
$passphrases,
39-
$passwordparam
35+
$Pass,
36+
[SecureString[]]
37+
$Passwords,
38+
$Passphrases,
39+
$Passwordparam
4040
)
4141
}
4242
43-
function TestFunction($password, [System.Security.SecureString[]]passphrases, [string]$passThru){
43+
function TestFunction($password, [System.Security.SecureString[]]passphrases, [String]$passThru){
4444
}
45-
45+
```
4646

4747
Correct:
4848

49+
```
4950
function Test-Script
5051
{
5152
[CmdletBinding()]
5253
[Alias()]
53-
[OutputType([int])]
54+
[OutputType([Int])]
5455
Param
5556
(
5657
# Param1 help description
@@ -59,23 +60,24 @@ Correct:
5960
Position=0)]
6061
$Param1,
6162
# Param2 help description
62-
[int]
63+
[Int]
6364
$Param2,
64-
[securestring]
65+
[SecureString]
6566
$Password,
6667
[System.Security.SecureString]
67-
$pass,
68-
[securestring[]]
69-
$passwords,
70-
[securestring]
71-
$passphrases,
72-
[securestring]
73-
$passwordparam,
74-
[string]
75-
$PassThru
68+
$Pass,
69+
[SecureString[]]
70+
$Passwords,
71+
[SecureString]
72+
$Passphrases,
73+
[SecureString]
74+
$PasswordParam,
75+
[String]
76+
$PassThru
7677
)
7778
...
7879
}
7980
80-
function TestFunction([securestring]$password, [System.Security.SecureString[]]$passphrases, [securestring[]]$passes){
81-
}
81+
function TestFunction([SecureString]$Password, [System.Security.SecureString[]]$Passphrases, [SecureString[]]$passes){
82+
}
83+
```

0 commit comments

Comments
 (0)