File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -260,7 +260,15 @@ function ConvertTo-SgwConfigFile {
260260 if ($SgwConfigFile -match "credentials$") {
261261 foreach ($Config in $Configs) {
262262 if ([environment]::OSVersion.Platform -match "win") {
263- $secure_password = ConvertTo-SecureString -String $Config.password -AsPlainText -Force | ConvertFrom-SecureString
263+ if ($Config.secure_password) {
264+ $secure_password = $Config.secure_password | ConvertFrom-SecureString
265+ }
266+ elseif ($Config.password) {
267+ $secure_password = ConvertTo-SecureString -String $Config.password -AsPlainText -Force | ConvertFrom-SecureString
268+ }
269+ else {
270+ throw "Neither password nor secure_password provided"
271+ }
264272 $Output += "[$( $Config.ProfileName )]`n"
265273 $Output += "username = $($Config.username)`n"
266274 $Output += "secure_password = $($secure_password)`n"
You can’t perform that action at this time.
0 commit comments