File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -104,8 +104,8 @@ function Add-NSCertKeyPair {
104
104
$params.Add (' key' , $KeyPath )
105
105
}
106
106
if (($CertKeyFormat -in ' PEM' , ' PFX' ) -and $Password ) {
107
- $bstr = [System.Runtime.InteropServices.Marshal ]::SecureStringToBSTR( $Password )
108
- $unsecurePassword = [ System.Runtime.InteropServices.Marshal ]::PtrToStringAuto( $bstr )
107
+ $creds = [System.Management.Automation.PSCredential ]::new( " dummy " , $Password )
108
+ $unsecurePassword = $creds .GetNetworkCredential ().Password
109
109
$params.Add (" passplain" , $unsecurePassword )
110
110
}
111
111
$response = _InvokeNSRestApi - Session $Session - Method POST - Type sslcertkey - Payload $params - Action add
@@ -114,4 +114,4 @@ function Add-NSCertKeyPair {
114
114
}
115
115
}
116
116
}
117
- }
117
+ }
You can’t perform that action at this time.
0 commit comments