From e42ffd26887dae4f2acca5cfbc224c053f2d1907 Mon Sep 17 00:00:00 2001 From: Vinod Kumar Date: Mon, 16 Jul 2018 15:47:48 +0530 Subject: [PATCH 1/4] Added powershell helper module --- Tasks/ServiceFabricComposeDeployV0/make.json | 4 ++++ Tasks/ServiceFabricPowerShellV1/make.json | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/Tasks/ServiceFabricComposeDeployV0/make.json b/Tasks/ServiceFabricComposeDeployV0/make.json index 8b9fc2bcb0b0..1d8026031c1c 100644 --- a/Tasks/ServiceFabricComposeDeployV0/make.json +++ b/Tasks/ServiceFabricComposeDeployV0/make.json @@ -11,6 +11,10 @@ { "module": "../Common/Deployment/TelemetryHelper", "type": "ps" + }, + { + "module": "../Common/PowershellHelpers", + "type": "ps" } ], "externals": { diff --git a/Tasks/ServiceFabricPowerShellV1/make.json b/Tasks/ServiceFabricPowerShellV1/make.json index 8b9fc2bcb0b0..1d8026031c1c 100644 --- a/Tasks/ServiceFabricPowerShellV1/make.json +++ b/Tasks/ServiceFabricPowerShellV1/make.json @@ -11,6 +11,10 @@ { "module": "../Common/Deployment/TelemetryHelper", "type": "ps" + }, + { + "module": "../Common/PowershellHelpers", + "type": "ps" } ], "externals": { From bec07065f8fc7a73c035c87b21ba9195d8d5a4c3 Mon Sep 17 00:00:00 2001 From: Vinod Kumar Date: Mon, 16 Jul 2018 15:48:46 +0530 Subject: [PATCH 2/4] Replacing Trace-VstsEnteringInvocation with print statement --- Tasks/Common/PowershellHelpers/Helpers.ps1 | 2 +- Tasks/Common/PowershellHelpers/module.json | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Tasks/Common/PowershellHelpers/Helpers.ps1 b/Tasks/Common/PowershellHelpers/Helpers.ps1 index 28a3e1d0fa2b..2591c5f43937 100644 --- a/Tasks/Common/PowershellHelpers/Helpers.ps1 +++ b/Tasks/Common/PowershellHelpers/Helpers.ps1 @@ -27,7 +27,7 @@ function Invoke-ActionWithRetries $RetryMessage ) - Trace-VstsEnteringInvocation $MyInvocation + Write-Host (Get-VstsLocString -Key EnteringInvokeActionWithRetries) $lastResult = $null; $retryIteration = 1 diff --git a/Tasks/Common/PowershellHelpers/module.json b/Tasks/Common/PowershellHelpers/module.json index 2ac90d18ee21..47cf3e426b99 100644 --- a/Tasks/Common/PowershellHelpers/module.json +++ b/Tasks/Common/PowershellHelpers/module.json @@ -2,6 +2,7 @@ "messages": { "ActionTimedOut": "Exceeded max retries. Timing out.", "RetryAfterMessage": "Retrying after {0} second(s)...", - "ActionException": "Exception occurred: {0}" + "ActionException": "Exception occurred: {0}", + "EnteringInvokeActionWithRetries": "Entering Invoke-ActionWithRetries." } } \ No newline at end of file From 5c118171fa31e453b1be6b37d00a2545d73d16d7 Mon Sep 17 00:00:00 2001 From: Vinod Kumar Date: Mon, 16 Jul 2018 15:59:37 +0530 Subject: [PATCH 3/4] Removing Trace-VstsLeavingInvocation $MyInvocation --- Tasks/Common/PowershellHelpers/Helpers.ps1 | 2 -- 1 file changed, 2 deletions(-) diff --git a/Tasks/Common/PowershellHelpers/Helpers.ps1 b/Tasks/Common/PowershellHelpers/Helpers.ps1 index e113b1043cd4..2ff9b40a6e53 100644 --- a/Tasks/Common/PowershellHelpers/Helpers.ps1 +++ b/Tasks/Common/PowershellHelpers/Helpers.ps1 @@ -85,8 +85,6 @@ function Invoke-ActionWithRetries $retryIteration++ Start-Sleep $RetryIntervalInSeconds } while ($true) - - Trace-VstsLeavingInvocation $MyInvocation } function Get-TempDirectoryPath From b3af217d988179cc61b158a69ee48d42c24e38ed Mon Sep 17 00:00:00 2001 From: Vinod Kumar Date: Mon, 16 Jul 2018 16:08:11 +0530 Subject: [PATCH 4/4] Addressed review comments --- Tasks/Common/PowershellHelpers/Helpers.ps1 | 2 -- Tasks/Common/PowershellHelpers/module.json | 3 +-- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/Tasks/Common/PowershellHelpers/Helpers.ps1 b/Tasks/Common/PowershellHelpers/Helpers.ps1 index 2ff9b40a6e53..1ab2b8b6a5f3 100644 --- a/Tasks/Common/PowershellHelpers/Helpers.ps1 +++ b/Tasks/Common/PowershellHelpers/Helpers.ps1 @@ -27,8 +27,6 @@ function Invoke-ActionWithRetries $RetryMessage ) - Write-Host (Get-VstsLocString -Key EnteringInvokeActionWithRetries) - $lastResult = $null; $retryIteration = 1 do diff --git a/Tasks/Common/PowershellHelpers/module.json b/Tasks/Common/PowershellHelpers/module.json index 47cf3e426b99..2ac90d18ee21 100644 --- a/Tasks/Common/PowershellHelpers/module.json +++ b/Tasks/Common/PowershellHelpers/module.json @@ -2,7 +2,6 @@ "messages": { "ActionTimedOut": "Exceeded max retries. Timing out.", "RetryAfterMessage": "Retrying after {0} second(s)...", - "ActionException": "Exception occurred: {0}", - "EnteringInvokeActionWithRetries": "Entering Invoke-ActionWithRetries." + "ActionException": "Exception occurred: {0}" } } \ No newline at end of file