File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -8,14 +8,14 @@ Describe "New-RandomPassword" -Tags "Unit Tests" {
8
8
(New-RandomPassword ).GetType().Name | Should BeExactly " String"
9
9
}
10
10
11
- # Pick a password lenght between 0 and 7 and 33 and 100 characters
11
+ # Pick a password Length between 0 and 7 and 33 and 100 characters
12
12
$n = 0 .. 1 + 33 .. 100
13
13
foreach ($length in $n ){
14
- it " Should throw an exeption if the password lenght ($length ) is out of the accepted range (8-32)" {
15
- {New-RandomPassword - Lenght 5 } | Should throw
14
+ it " Should throw an exeption if the password Length ($length ) is out of the accepted range (8-32)" {
15
+ {New-RandomPassword - Length 5 } | Should throw
16
16
}
17
17
}
18
- # Pick a password lenght between 8 and 32 characters
18
+ # Pick a password Length between 8 and 32 characters
19
19
$n = 8 .. 32
20
20
foreach ($length in $n ){
21
21
It " Should generate a password $length character long" {
Original file line number Diff line number Diff line change 4
4
Function New-RandomPassword {
5
5
Param (
6
6
[ValidateRange (8 , 32 )]
7
- [int ] $Lenght = 16
7
+ [int ] $Length = 16
8
8
)
9
9
$AsciiCharsList = @ ()
10
10
foreach ($a in (33 .. 126 )){
@@ -15,7 +15,7 @@ Function New-RandomPassword{
15
15
16
16
do {
17
17
$Password = " "
18
- $loops = 1 .. $Lenght
18
+ $loops = 1 .. $Length
19
19
Foreach ($loop in $loops ) {
20
20
$Password += $AsciiCharsList | Get-Random
21
21
}
You can’t perform that action at this time.
0 commit comments