diff --git a/.vscode/settings.json b/.vscode/settings.json index f8222de..64e9462 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -8,7 +8,7 @@ "[markdown]": { "editor.wordwrap": "on", "editor.renderWhitespace": "all", - "editor.acceptSuggestionOnEnter": false, + "editor.acceptSuggestionOnEnter": "off", "editor.rulers": [80], "editor.trimAutoWhitespace": false } diff --git a/SnipeitPS/Public/New-SnipeitUser.ps1 b/SnipeitPS/Public/New-SnipeitUser.ps1 index f27e455..4570fb7 100644 --- a/SnipeitPS/Public/New-SnipeitUser.ps1 +++ b/SnipeitPS/Public/New-SnipeitUser.ps1 @@ -123,6 +123,7 @@ function New-SnipeitUser() { [string]$apiKey ) begin { + Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters @@ -131,6 +132,10 @@ function New-SnipeitUser() { $Values['password_confirmation'] = $password } + if ($password.Length -lt 8) { + Throw "[$($MyInvocation.MyCommand.Name)] The password must be at least 8 characters." + } + $Parameters = @{ Api = "/api/v1/users" Method = 'post'