Publish preview version #42
@ -118,16 +118,11 @@ function New-CredentialStoreItem {
|
|||||||
if ($Credential.UserName) {
|
if ($Credential.UserName) {
|
||||||
try {
|
try {
|
||||||
if ($null -eq $CSContent.PfxCertificate) {
|
if ($null -eq $CSContent.PfxCertificate) {
|
||||||
$Cert = Get-ChildItem -Recurse -Path 'Cert:' | Where-Object {
|
$Cert = Get-CSCertificate -Thumbprint $CSContent.Thumbprint
|
||||||
$_.Thumbprint -eq $CSContent.Thumbprint
|
|
||||||
} | Select-Object -First 1
|
|
||||||
if ($null -eq $Cert) {
|
if ($null -eq $Cert) {
|
||||||
if ($isLinux) {
|
|
||||||
throw "There is no windows certificate store on linux systems!"
|
|
||||||
}
|
|
||||||
$ErrorParams = @{
|
$ErrorParams = @{
|
||||||
ErrorAction = 'Stop'
|
ErrorAction = 'Stop'
|
||||||
Exception = [System.Exception]::new(
|
Exception = [System.Security.Cryptography.X509Certificates.FileNotFoundException]::new(
|
||||||
('Could not find the linked certificate with thumbprint {0}' -f $CSContent.Thumbprint)
|
('Could not find the linked certificate with thumbprint {0}' -f $CSContent.Thumbprint)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user