Add the execution policy when running powershell in size on disk benchmarks (dotnet...
authorMichelle McDaniel <adiaaida@gmail.com>
Tue, 30 Oct 2018 16:51:40 +0000 (09:51 -0700)
committerGitHub <noreply@github.com>
Tue, 30 Oct 2018 16:51:40 +0000 (09:51 -0700)
Since moving to the helix queue, we have been failing because the execution policy on the vms is not set to unrestricted. To get around this, we need to explicitly pass -ExecutionPolicy Bypass.

Commit migrated from https://github.com/dotnet/coreclr/commit/a9074bce5e3814db67dbec1c56f477202164d162

src/coreclr/tests/src/sizeondisk/sodbench/SoDBench.cs

index fe40a4d..bbd4788 100644 (file)
@@ -431,7 +431,7 @@ namespace SoDBench
             var psi = new ProcessStartInfo() {
                 WorkingDirectory = s_sandboxDir.FullName,
                 FileName = @"powershell.exe",
-                Arguments = $"-NoProfile .\\Dotnet-Install.ps1 -Runtime dotnet -InstallDir .dotnet -Channel {s_dotnetChannel} -Architecture {s_targetArchitecture}"
+                Arguments = $"-NoProfile -ExecutionPolicy Bypass -File .\\Dotnet-Install.ps1 -Runtime dotnet -InstallDir .dotnet -Channel {s_dotnetChannel} -Architecture {s_targetArchitecture}"
             };
             LaunchProcess(psi, 180000);
         }
@@ -441,7 +441,7 @@ namespace SoDBench
             var psi = new ProcessStartInfo() {
                 WorkingDirectory = s_sandboxDir.FullName,
                 FileName = @"powershell.exe",
-                Arguments = $"-NoProfile .\\Dotnet-Install.ps1 -InstallDir .dotnet -Channel {s_dotnetChannel} -Architecture {s_targetArchitecture}"
+                Arguments = $"-NoProfile -ExecutionPolicy Bypass -File .\\Dotnet-Install.ps1 -InstallDir .dotnet -Channel {s_dotnetChannel} -Architecture {s_targetArchitecture}"
             };
             LaunchProcess(psi, 180000);
         }