diff --git a/helpers/GenerateResourcesAndImage.ps1 b/helpers/GenerateResourcesAndImage.ps1 index 6a7f864d1..d90dc87c6 100644 --- a/helpers/GenerateResourcesAndImage.ps1 +++ b/helpers/GenerateResourcesAndImage.ps1 @@ -266,7 +266,11 @@ Function GenerateResourcesAndImage { } if ($builderScriptPath.Contains("pkr.hcl")) { - $AgentIp = '[ \"{0}\" ]' -f $AgentIp + if ($AgentIp) { + $AgentIp = '[ \"{0}\" ]' -f $AgentIp + } else { + $AgentIp = "[]" + } } if ($Tags) {