This commit is contained in:
OCram85 2022-06-28 11:51:43 +02:00
parent ecd2735ce5
commit e60ee4cab8

View File

@ -1,7 +1,12 @@
[Diagnostics.CodeAnalysis.SuppressMessageAttribute( [Diagnostics.CodeAnalysis.SuppressMessageAttribute(
'PSAvoidUsingConvertToSecureStringWithPlainText', 'PSAvoidUsingConvertToSecureStringWithPlainText',
'', '',
Justification = 'justification' Justification = 'just used in pester tests.'
)]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
'PSProvideCommentHelp',
'',
Justification = 'no need in internal pester helpers.'
)] )]
param () param ()
@ -53,7 +58,7 @@ Describe "New-CredentialStoreItem" {
New-CredentialStoreItem -Shared -Path $tmpCS -RemoteHost $RemoteHost -Credential $mycreds New-CredentialStoreItem -Shared -Path $tmpCS -RemoteHost $RemoteHost -Credential $mycreds
} | Should -Not -Throw } | Should -Not -Throw
$tmpCS = Get-Content -Path $tmpCS -Raw | ConvertFrom-Json $tmpCS = Get-Content -Path $tmpCS -Raw | ConvertFrom-Json
$res = Get-Member -InputObject $tmpCS -Name $RemoteHost -Membertype Properties $res = Get-Member -InputObject $tmpCS -Name $RemoteHost -MemberType Properties
$res.Name | Should -Be $RemoteHost $res.Name | Should -Be $RemoteHost
} }
It "Adds Item with identifier to shared store" { It "Adds Item with identifier to shared store" {
@ -65,8 +70,8 @@ Describe "New-CredentialStoreItem" {
$mycreds = [PSCredential]::new($UserName, $Password) $mycreds = [PSCredential]::new($UserName, $Password)
$RemoteHost = "foobar2" $RemoteHost = "foobar2"
$StoreItemParam = @{ $StoreItemParam = @{
Shared = $true Shared = $true
Path = $tmpCS Path = $tmpCS
RemoteHost = $RemoteHost RemoteHost = $RemoteHost
Credential = $mycreds Credential = $mycreds
identifier = 'Foo' identifier = 'Foo'