I have got an arm template successfully provisioning azure virtual machines, post provisioning I will require some packages to be installed on the virtual machine. The way I am currently doing this right now is via the following commands.
Set-AzVMCustomScriptExtension -ResourceGroupName "xxx" -VMName "xx" -Name "ChocoInstall" -FileUri "https://community.chocolatey.org/install.ps1" ` -Run "install.ps1" -Location "xx"
once chocolatey is installed, the next step is to install some packages.
I found a similar answer here and I am trying to use thesame command.
az vm run-command invoke -g "xxx" -n "xx" --command-id RunpowerShellScript --scripts "[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))" ; "choco install notepadplusplus"
I then get the error below.
"code": "ComponentStatus/StdErr/succeeded", "displayStatus": "Provisioning succeeded", "level": "Info", "message": "choco : The term 'choco' is not recognized as the name of a cmdlet, function, script file, or operable program. Check \nthe spelling of the name, or if a path was included, verify that the path is correct and try again.\nAt C:\\Packages\\Plugins\\Microsoft.CPlat.Core.RunCommandWindows\\1.1.11\\Downloads\\script2.ps1:3 char:1\n+ choco install notepadplusplus\n+ ~~~~~\n + CategoryInfo : ObjectNotFound: (choco:String) [], CommandNotFoundException\n + FullyQualifiedErrorId : CommandNotFoundException\n ", "time": null } ] }

