Skip to content

Commit

Permalink
Update call-enforce-space-standards-runbook.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
harrisonmeister authored Feb 14, 2024
1 parent 0c59161 commit 14f93c4
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ param
$OptionalSpaceId
)

# Fix ANSI Color on PWSH Core issues when displaying objects
if ($PSEdition -eq "Core") {
$PSStyle.OutputRendering = "PlainText"
}

function Invoke-OctopusApi
{
param
Expand Down Expand Up @@ -90,9 +95,12 @@ if ([string]::IsNullOrWhiteSpace($OptionalSpaceId) -eq $false -and $OptionalSpac
$env:OCTOPUS_URL = $AdminInstanceUrl
$env:OCTOPUS_API_KEY = $AdminInstanceApiKey

Write-Host "##octopus[stderr-ignore]"
foreach ($space in $spacesList)
{
Write-Host "Queueing a runbook run for $($space.Name) using the space id $($space.Id). The runbook will run on $AdminInstanceUrl for the environment $AdminEnvironmentName in the space $AdminSpaceName"
Write-Host "Running command: octopus runbook run --project ""Standards"" --name ""Enforce Space Standards"" --environment ""$AdminEnvironmentName"" --variable=""Project.Standards.SpaceId:$($space.Id)"" --space=""$AdminSpaceName"" to queue the runbook"

octopus runbook run --project "Standards" --name "Enforce Space Standards" --environment "$AdminEnvironmentName" --variable="Project.Standards.SpaceId:$($space.Id)" --space="$AdminSpaceName"
}
}
Write-Host "##octopus[stderr-default]"

0 comments on commit 14f93c4

Please sign in to comment.