Hi Folks,
I set up the following PowerShell script as a variable in Power Automate and need to execute it as an input. But Power Automate always converts this script into one line so that this script can be run because of syntax error. Is there a way to prevent Power Automate to stop the conversion of formatting? Thanks
$AzureSQLServerName = "%CurrentItem['serverName']%"
$AzureSQLDatabaseName = "%CurrentItem['dbName']%"
$clientID = "ee5982fb-a92e-4bb9-9543-79b6fc7e2740"
Connect-AzAccount -Identity -AccountId $clientID
Write-Output "Authentication complete..."
$accessToken = (Get-AzAccessToken -ResourceUrl https://database.windows.net).Token
Write-Output "Executing query..."
$SQLOutput = $(Invoke-Sqlcmd -ServerInstance $AzureSQLServerName -Database $AzureSQLDatabaseName -AccessToken $accessToken -Query "exec [dbo].[AzureSQLMaintenance] @Operation='statistics' ,@LogToTable=1" -QueryTimeout 65535 -ConnectionTimeout 60 -Verbose) 4>&1
Write-Output $SQLOutput
Write-Output "Executing query complete."


