question

artisticcheese avatar image
0 Votes"
artisticcheese asked artisticcheese commented

Custom script extension incorrectly processing input characters

Hello,

Custom script extension for Windows seems to be incorrectly processing characters passed to it. Relevant portion of my script extension is below

 "commandToExecute": "[concat('powershell.exe -file ./consolidated-webserver/server.prep.ps1 ', ' -clients ', variables('convertedJSON'))]"

variables('convertedJSON') contains string with various characters which is correctly passed to extension which can be seen by examining file under Status folder as seen below

 "powershell.exe -file ./consolidated-webserver/server.prep.ps1 -clients ^\"{'clients':[{'clientName':'dominos','sqlreference':{'keyVault':'dominos-urbumyyogx-kv','fdqn':'venio-dominos-sql.eastus.cloudapp.azure.com'}},{'clientname':'boeing','sqlreference':{'keyVault':'boeing-c4uujz4qkc-kv','fdqn':'venio-dominos-sql.eastus.cloudapp.azure.com'}}]}^\""

Actual powershell instance is launched though with following parameters -

 Host Application: powershell.exe -file ./consolidated-webserver/server.prep.ps1 -clients {'clients':[{'clientName':'dominos','sqlreference':{'keyVault':'dominos-urbumyyogx-kv','fdqn':'venio-dominos-sql.eastus.cloudapp.azure.com'}},{'clientname':'boeing','sqlreference':{'keyVault':'boeing-c4uujz4qkc-kv','fdqn':'venio-dominos-sql.eastus.cloudapp.azure.com'}}]}

which you can see is missing ^\" characters




azure-virtual-machines-extension
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@artisticcheese Firstly, apologies for the delay in responding here and any inconvenience this issue may have caused.
Can you please elaborate more on your query for better understanding the issue? May I know what exactly are you trying accomplish?

0 Votes 0 ·

I'm trying to use custom script extension to execute some powershell command on Windows. I'm passing characters to extension which never make it to actual command. I'm examining .status file to see what was passed from extension to executable which showing ^ character is part of it but actual executable strips that character as seen in powershell transcript

0 Votes 0 ·

0 Answers