Skip to content

Commit 49c70b9

Browse files
committed
Merged PR 184: Fix exception handeling
- Updated error handling - Merge branch 'master' into FixErrors
1 parent c3988df commit 49c70b9

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

inheritedprocessmigration/vCurrent/processmigratestart.ps1

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11

2-
$ErrorActionPreference = "Stop"
3-
42
# Command
53
$command = Get-VstsInput -Name command -Require
64

@@ -101,11 +99,30 @@ $ConfigData
10199

102100
###########################################################
103101

102+
Write-VstsTaskVerbose "============NPM-INSTALL============"
103+
104+
$ErrorActionPreference = "SilentlyContinue"
105+
104106
npm install process-migrator -g
105107

106-
Write-VstsTaskVerbose $command
108+
$ErrorActionPreference = "Stop"
109+
110+
Write-VstsTaskVerbose "============PROCESS-MIGRATOR============"
111+
112+
Write-VstsTaskVerbose $command
113+
114+
$output = process-migrator --mode=$command --config=$configFile
115+
116+
$output
117+
118+
if ($LASTEXITCODE -ne 0)
119+
{
120+
$err = $output.Where{$PSItem -match 'ERROR'}
121+
Write-VstsTaskError "Process-Migrator FAILED: $err" -ErrCode $LASTEXITCODE
122+
}
123+
107124

108-
process-migrator --mode=$command --config=$configFile
125+
Write-VstsTaskVerbose "============CLEANUP============"
109126

110127
Write-VstsTaskVerbose "Removing $configFile file to remove PAT tokens from file system."
111128
Remove-Item $configFile

vss-extension.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"manifestVersion": 1,
33
"id": "processtemplate",
4-
"name": "Azure DevOps Process Tools",
4+
"name": "Process Tools for Azure DevOps ",
55
"version": "#{GitVersion.Major}#.#{GitVersion.Minor}#.#{GitVersion.Patch}##{GitVersion.COMMITSSINCEVERSIONSOURCE}#",
66
"public": false,
77
"publisher": "nkdAgility",

0 commit comments

Comments
 (0)