Skip to content

Commit 2c0f1eb

Browse files
committed
add condition
1 parent dcfcd0d commit 2c0f1eb

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

Tasks/Manage-AutomationAccount/Manage-AutomationAccount.ps1

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -385,11 +385,15 @@ if (Check-Scope -Scope $scope -RequiredScope 'Modules') {
385385
}
386386
catch {
387387
Write-Warning $_
388-
if ($_.Exception.Message -like '*NotFound*') {
389-
#if module not found, do nothing -> will be installed
390-
#{"code":"NotFound","message":"The package does not exist in runtime environment PowerShell-74. "}
388+
###[warning]{"code":"NotFound","message":"The package does not exist in runtime environment PowerShell-74. "}
389+
390+
if ($_ -like '*NotFound*') {
391391
Write-Warning "Error NotFound"
392-
} else {
392+
}
393+
elseif ($_.Exception.Message -like '*NotFound*') {
394+
Write-Warning "Error NotFound"
395+
}
396+
else {
393397
Write-Warning "Uknown error"
394398
throw
395399
}

vss-extension.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"manifestVersion": 1,
33
"id": "Manage-AutomationAccount",
44
"name": "Manage-AutomationAccount",
5-
"version": "2.0.2",
5+
"version": "2.0.3",
66
"publisher": "GreyCorbelSolutions",
77
"targets": [
88
{

0 commit comments

Comments
 (0)