Skip to content

Commit ad24b18

Browse files
committed
1.4.2.1
1.4.2.1
1 parent f57fb06 commit ad24b18

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

PureStorage.Pure1.psd1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Created by: Cody Hosterman
55
Organization: Pure Storage, Inc.
66
Filename: Cody.PureStorage.Pure1.psd1
7-
Version: 1.4.2.0
7+
Version: 1.4.2.1
88
Copyright: 2020 Pure Storage, Inc.
99
-------------------------------------------------------------------------
1010
Module Name: PureStoragePure1PowerShell
@@ -30,7 +30,7 @@
3030
RootModule = 'PureStorage.Pure1.psm1'
3131

3232
# Version number of this module; major.minor[.build[.revision]]
33-
ModuleVersion = '1.4.2.0'
33+
ModuleVersion = '1.4.2.1'
3434

3535
# ID used to uniquely identify this module
3636
GUID = '65867a33-8c09-4651-8043-96c2f7ca2893'

PureStorage.Pure1.psm1

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,14 @@ function Get-PureOneCertificate {
135135
$keyPath = $ExportDirectory
136136
}
137137
}
138-
$DecryptedCertificatePassword = ConvertFrom-SecureString $CertificatePassword -AsPlainText
138+
if ($PSVersionTable.PSEdition -ne "Core")
139+
{
140+
$bstr = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($CertificatePassword)
141+
$DecryptedCertificatePassword = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($bstr)
142+
}
143+
else {
144+
$DecryptedCertificatePassword = ConvertFrom-SecureString $CertificatePassword -AsPlainText
145+
}
139146
$cert |Foreach-Object { [system.IO.file]::WriteAllBytes("$($keyPath)\PureOneCert.pfx",($_.Export('PFX', $DecryptedCertificatePassword)) ) }
140147
$foundKey = test-path "$($keyPath)\PureOneCert.pfx"
141148
if ($foundKey -eq $true)

0 commit comments

Comments
 (0)