Before calling...
Line 325:
$Connections = Get-Connection -Connection $($LogicApp.properties.parameters.'$connections'.value)
or
Line 334:
$Connections = Get-Connection -Connection $($LogicApp.parameters.'$connections'.value)
it needs to be checked, if this property even exits, otherwise the script will fail with:
The property '$connections' cannot be found on this object. Verify that the property exists.