Skip to content

Commit b702324

Browse files
authored
Fix secure string conversion (#12678)
1 parent 0c9a550 commit b702324

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/HanaOnAzure/custom/New-AzSapMonitorProviderInstance.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,8 @@ function New-AzSapMonitorProviderInstance {
203203
hanaDbName = $HanaDatabaseName
204204
hanaDbSqlPort = $HanaDatabaseSqlPort
205205
hanaDbUsername = $HanaDatabaseUsername
206-
hanaDbPassword = ConvertFrom-SecureString $HanaDatabasePassword -AsPlainText
206+
# cannot use `ConvertFrom-SecureString -AsPlainText`, requires powershell >= 7
207+
hanaDbPassword = [System.Runtime.InteropServices.marshal]::PtrToStringAuto([System.Runtime.InteropServices.marshal]::SecureStringToBSTR($HanaDatabasePassword))
207208
}
208209
}
209210
'ByKeyVault' {

0 commit comments

Comments
 (0)