From 8d472bb0a31e1009604f99aa989234bfc088d2c8 Mon Sep 17 00:00:00 2001 From: Sima Zhu <48036328+sima-zhu@users.noreply.github.com> Date: Mon, 19 Oct 2020 10:27:04 -0700 Subject: [PATCH] Switch the content from array to string. (#1103) Fixed the issue: https://github.com/Azure/azure-sdk-for-js/issues/11827 JS pipeline running super slow on array object of `Get-Content`. Tested using -Raw, replacement works correctly and the entire process speeds up. --- eng/common/scripts/copy-docs-to-blobstorage.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/common/scripts/copy-docs-to-blobstorage.ps1 b/eng/common/scripts/copy-docs-to-blobstorage.ps1 index dbfa55039d41..c0590e2c9efc 100644 --- a/eng/common/scripts/copy-docs-to-blobstorage.ps1 +++ b/eng/common/scripts/copy-docs-to-blobstorage.ps1 @@ -205,7 +205,7 @@ function Upload-Blobs if ($ReleaseTag) { foreach ($htmlFile in (Get-ChildItem $DocDir -include *.html -r)) { - $fileContent = Get-Content -Path $htmlFile + $fileContent = Get-Content -Path $htmlFile -Raw $updatedFileContent = $fileContent -replace $RepoReplaceRegex, "`${1}$ReleaseTag" if ($updatedFileContent -ne $fileContent) { Set-Content -Path $htmlFile -Value $updatedFileContent