I am using invoke-AzVmRunCommand to run a bash script on RHEL7 linux machine. My bash script is expecting more than 10 arguments in the correct order.
I have used parameters as per example in Run script using Invoke-AzVMRunCommand in VM? Passing parameter problem but still parameters are going in wrong orders.
$params = [ordered]@{"param1"="10.1.1";"param2"="Dev";"param3"="Development";"param4"="03";"param5"="172.30.0.27";"param6"="172.30.0.28";"param7"="01"}
Invoke-AzVMRunCommand -ResourceGroupName "$(resourceGroupName)" -VMName "${vmName}" -CommandId "RunShellScript" -ScriptPath "$(System.ArtifactsDirectory)/scripts/bash.sh" `
-Parameter $params
bash.sh:
#!/bin/bash
echo $@
I am expecting output as 10.1.1. Dv Development 03... etc however I am getting 03 dev 10.1.1 and other params.