added logic for more than one resource ids

This commit is contained in:
Jorge Cotillo 2019-08-16 01:10:14 -07:00
Родитель ec229f2603
Коммит ba3cce2bdb
1 изменённых файлов: 9 добавлений и 4 удалений

Просмотреть файл

@ -531,11 +531,16 @@ Class AzureResourceManagerDeploymentService: IDeploymentService {
$allResourceIds = @();
# Adding single quotes to resource ids
$resourceIds | % { $allResourceIds += "'$_'" }
if ($resourceIds.Count > 1) {
# Adding single quotes to resource ids
$resourceIds | % { $allResourceIds += "'$_'" }
# Adding comma in between array items
$formattedResourceIds = $allResourceIds -join ",";
# Adding comma in between array items
$formattedResourceIds = $allResourceIds -join ",";
}
else {
$formattedResourceIds = "'$resourceIds'";
}
$resourceStates = `
Search-AzGraph -Query "where id in ($formattedResourceIds)";