JitBench: Run PowerShell with an execution policy (#25259)
authorMichal Strehovský <MichalStrehovsky@users.noreply.github.com>
Tue, 25 Jun 2019 20:25:02 +0000 (22:25 +0200)
committerJan Kotas <jkotas@microsoft.com>
Tue, 25 Jun 2019 20:25:02 +0000 (13:25 -0700)
PowerShell is useless without this argument in default Windows configurations.

tests/src/performance/Scenario/JitBench/Benchmarks/WebAppBenchmarks.cs

index 6a87419..516aaa0 100644 (file)
@@ -102,7 +102,7 @@ namespace JitBench
             string tfm = DotNetSetup.GetTargetFrameworkMonikerForFrameworkVersion(dotNetInstall.FrameworkVersion);
             string storeDirName = ".store";
             await (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ?
-                    new ProcessRunner("powershell.exe", $".\\AspNet-GenerateStore.ps1 -InstallDir {storeDirName} -Architecture {dotNetInstall.Architecture} -Runtime win7-{dotNetInstall.Architecture}") :
+                    new ProcessRunner("powershell.exe", $"-ExecutionPolicy Bypass .\\AspNet-GenerateStore.ps1 -InstallDir {storeDirName} -Architecture {dotNetInstall.Architecture} -Runtime win7-{dotNetInstall.Architecture}") :
                     new ProcessRunner("bash", $"./aspnet-generatestore.sh --install-dir {storeDirName} --architecture {dotNetInstall.Architecture} --runtime-id linux-{dotNetInstall.Architecture} -f {tfm} --fx-version {dotNetInstall.FrameworkVersion}"))
                 .WithWorkingDirectory(GetJitBenchRepoRootDir(outputDir))
                 .WithEnvironmentVariable("PATH", $"{dotNetInstall.DotNetDir}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}")