Skip to content

Commit 7ffa8d9

Browse files
committed
Typos fixed on New-RandomPassword and Pester test scripts
1 parent 757c133 commit 7ffa8d9

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Blog/PowerShell/New-RandomPassword.Tests.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ Describe "New-RandomPassword" -Tags "Unit Tests" {
88
(New-RandomPassword).GetType().Name | Should BeExactly "String"
99
}
1010

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
1212
$n = 0..1 + 33..100
1313
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
1616
}
1717
}
18-
#Pick a password lenght between 8 and 32 characters
18+
#Pick a password Length between 8 and 32 characters
1919
$n = 8..32
2020
foreach ($length in $n){
2121
It "Should generate a password $length character long" {

Blog/PowerShell/New-RandomPassword.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Function New-RandomPassword{
55
Param(
66
[ValidateRange(8, 32)]
7-
[int] $Lenght = 16
7+
[int] $Length = 16
88
)
99
$AsciiCharsList = @()
1010
foreach ($a in (33..126)){
@@ -15,7 +15,7 @@ Function New-RandomPassword{
1515

1616
do {
1717
$Password = ""
18-
$loops = 1..$Lenght
18+
$loops = 1..$Length
1919
Foreach ($loop in $loops) {
2020
$Password += $AsciiCharsList | Get-Random
2121
}

0 commit comments

Comments
 (0)