/
githubmirror
/
PowerShell
Обзор
Документация
Войти
/
githubmirror
/
PowerShell
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
test/powershell/engine/Basic/Credential.Tests.ps1
13 строк
602 B
Armaan Mcleod
Remove input text from the error message resulted by `SecureString` and `PSCredential` conversion failure (#19977)
17 июл 2023, 20:30
Не верифицирован
17 июл 2023, 20:30
d24285f
Код
Авторство
О чём код?
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Credential tests" -Tags "CI" { It "Explicit cast for an empty credential returns null" { # We should explicitly check that the expression returns $null [PSCredential]::Empty.GetNetworkCredential() | Should -BeNullOrEmpty } It "Explicit credential cast with string produces an exception message without value" { $ex = { [pscredential]"1234" } | Should -Throw -ErrorId "ConvertToFinalInvalidCastException" -PassThru $ex.Exception.Message | Should -Not -Match "1234" } }