Please I am trying to pass a html string as value to the below powershell function "set-content" from azure cli but I don't think I am escaping the double quotes correctly. The value parameter only accepts strings, somehow, it does not get executed at the target machine with the double quote. I get the below error. please help!
az vm extension set --name CustomScriptExtension --vm-name MyWindowsVM -g TestsandRG --publisher Microsoft.Compute --settings '{"commandToExecute": "powershell set-Content -Path \"C:\\inetpub\\wwwroot\\Default.htm\" -Value \"<html><body><h2>Welcome to Azure! My name is $($env:computername) .<\/h2><\/body><\/html>\""}'

\-escape the embedded"chars., even though that shouldn't be necessary: see stackoverflow.com/a/51861924/45375 and stackoverflow.com/a/59036879/45375