diff --git a/octopus-samples-instances/api-scripts/enforce-base-environments.ps1 b/octopus-samples-instances/api-scripts/enforce-base-environments.ps1 index dca1172..aaa6902 100644 --- a/octopus-samples-instances/api-scripts/enforce-base-environments.ps1 +++ b/octopus-samples-instances/api-scripts/enforce-base-environments.ps1 @@ -83,7 +83,7 @@ foreach ($space in $spacesList.Items) foreach ($environmentToCheck in $environmentsToCheckList) { $found = $false - foreach ($environment in $environmentsList) + foreach ($environment in $environmentsList.Items) { Write-Verbose "Checking $($environment.Name) with $environmentToCheck" if ($environment.Name.ToLower().Trim() -eq $environmentToCheck.ToLower().Trim())