diff --git a/PureStorage.Pure1.psd1 b/PureStorage.Pure1.psd1 index 5ad077e..333459b 100644 --- a/PureStorage.Pure1.psd1 +++ b/PureStorage.Pure1.psd1 @@ -4,7 +4,7 @@ Created by: Cody Hosterman Organization: Pure Storage, Inc. Filename: Cody.PureStorage.Pure1.psd1 - Version: 1.4.2.0 + Version: 1.4.2.1 Copyright: 2020 Pure Storage, Inc. ------------------------------------------------------------------------- Module Name: PureStoragePure1PowerShell @@ -30,7 +30,7 @@ RootModule = 'PureStorage.Pure1.psm1' # Version number of this module; major.minor[.build[.revision]] - ModuleVersion = '1.4.2.0' + ModuleVersion = '1.4.2.1' # ID used to uniquely identify this module GUID = '65867a33-8c09-4651-8043-96c2f7ca2893' diff --git a/PureStorage.Pure1.psm1 b/PureStorage.Pure1.psm1 index a618edc..7c983c3 100644 --- a/PureStorage.Pure1.psm1 +++ b/PureStorage.Pure1.psm1 @@ -135,7 +135,14 @@ function Get-PureOneCertificate { $keyPath = $ExportDirectory } } - $DecryptedCertificatePassword = ConvertFrom-SecureString $CertificatePassword -AsPlainText + if ($PSVersionTable.PSEdition -ne "Core") + { + $bstr = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($CertificatePassword) + $DecryptedCertificatePassword = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($bstr) + } + else { + $DecryptedCertificatePassword = ConvertFrom-SecureString $CertificatePassword -AsPlainText + } $cert |Foreach-Object { [system.IO.file]::WriteAllBytes("$($keyPath)\PureOneCert.pfx",($_.Export('PFX', $DecryptedCertificatePassword)) ) } $foundKey = test-path "$($keyPath)\PureOneCert.pfx" if ($foundKey -eq $true)