2020-03-24 11:08:37 -07:00
|
|
|
# Copyright (c) Microsoft Corporation.
|
2018-02-13 09:23:53 -08:00
|
|
|
# Licensed under the MIT License.
|
2025-08-19 02:51:38 -04:00
|
|
|
|
|
|
|
|
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingConvertToSecureStringWithPlainText', '')]
|
|
|
|
|
param()
|
|
|
|
|
|
2017-09-27 11:54:22 -07:00
|
|
|
Describe "ConvertTo--SecureString" -Tags "CI" {
|
2015-11-11 15:23:48 +00:00
|
|
|
|
2017-09-27 11:54:22 -07:00
|
|
|
Context "Checking return types of ConvertTo--SecureString" {
|
2015-11-11 15:23:48 +00:00
|
|
|
|
2016-03-04 14:52:27 -08:00
|
|
|
It "Should return System.Security.SecureString after converting plaintext variable"{
|
2017-09-27 11:54:22 -07:00
|
|
|
#[SuppressMessage("Microsoft.Security", "CS002:SecretInNextLine", Justification="Demo/doc/test secret.")]
|
2020-05-07 13:00:30 +01:00
|
|
|
$PesterTestConvert = (ConvertTo-SecureString "plaintextpester" -AsPlainText -Force)
|
2018-03-23 10:26:23 -07:00
|
|
|
$PesterTestConvert | Should -BeOfType securestring
|
2015-11-11 15:23:48 +00:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|