mirror of
https://github.com/actions/runner-images.git
synced 2025-12-11 11:37:00 +00:00
20 lines
791 B
PowerShell
20 lines
791 B
PowerShell
param(
|
|
[Parameter (Mandatory=$true)] [string] $TempResourceGroupName,
|
|
[Parameter (Mandatory=$true)] [string] $SubscriptionId,
|
|
[Parameter (Mandatory=$true)] [string] $ClientId,
|
|
[Parameter (Mandatory=$true)] [string] $ClientSecret,
|
|
[Parameter (Mandatory=$true)] [string] $TenantId
|
|
)
|
|
|
|
az login --service-principal --username $ClientId --password=$ClientSecret --tenant $TenantId | Out-Null
|
|
az account set --subscription $SubscriptionId | Out-Null
|
|
|
|
$groupExist = az group exists --name $TempResourceGroupName
|
|
if ($groupExist -eq "true") {
|
|
Write-Host "Found a match, deleting temporary files"
|
|
az group delete --name $TempResourceGroupName --yes | Out-Null
|
|
Write-Host "Temporary group was deleted successfully"
|
|
} else {
|
|
Write-Host "No temporary groups found"
|
|
}
|