The Deploy-GatewayV2Ha.ps1 script is quite broken.
At a minimum, they are using \ as an escape character. PowerShell uses `. e.g. "\"$ExecutablePath\"".
Then they don't properly interpolate variables into strings. e.g. "Network connectivity to $node: OK". The $node: gives the error "':' was not followed by a valid variable name character.". It should really be "Network connectivity to $($node): OK"
And THEN, they are assigning $error in a foreach, which is being complained about: "The Variable 'error' cannot be assigned since it is a readonly automatic variable that is built into PowerShell, please use a different name.".
All up, not a great script. I shouldn't have to fix all of these issues before I can even run the script, let alone if it will even work correctly.