Fixing execution policy so test automation works

This commit is contained in:
Mike Richmond committed 2016-08-04 13:15:34 -07:00
1 parent f8b9b88986
commit 33c1f2db23
10 files changed
+243 -228

No files matched your search

+3 -2
View File
@@ -271,7 +271,7 @@ function Start-PSBuild {
$nativeResourcesFolder = $_
Get-ChildItem $nativeResourcesFolder -Filter "*.mc" | % {
$command = @"
cmd.exe /C cd /d "(Get-Location)" "&" "$($vcVarsPath)\vcvarsall.bat" "$NativeHostArch" "&" "$mcexe" -o -d -c -U $($_.FullName) -h "$nativeResourcesFolder" -r "$nativeResourcesFolder"
cmd.exe /C cd /d "(Get-Location)" "&" "$($vcVarsPath)\vcvarsall.bat" "$NativeHostArch" "&" mc.exe -o -d -c -U $($_.FullName) -h "$nativeResourcesFolder" -r "$nativeResourcesFolder"
"@
log " Executing mc.exe Command: $command"
Start-NativeExecution { Invoke-Expression -Command:$command }
@@ -526,6 +526,7 @@ function Start-PSPester {
[string[]]$Tag = "CI",
[string]$Path = "$PSScriptRoot/test/powershell"
)
$tagString = "-outputFormat ${OutputFormat} -outputFile ${outputFile} "
if ( ! $DisableExit ) { $tagString += " -EnableExit" }
if ( $ExcludeTag -and ($ExcludeTag -ne "")) { $tagString += " -ExcludeTag @('" + (${ExcludeTag} -join "','") + "')" }
@@ -537,7 +538,7 @@ function Start-PSPester {
Write-Verbose "Import-Module '$moduleDir'; Invoke-Pester $tagString $Path"
$powershellexe = get-psoutput
& $powershell -noprofile -c "Set-ExecutionPolicy Unrestricted; Import-Module '$moduleDir'; Invoke-Pester $tagString $Path"
& $powershell -noprofile -c "Set-ExecutionPolicy -Scope Process Unrestricted; Import-Module '$moduleDir'; Invoke-Pester $tagString $Path"
if ($LASTEXITCODE -ne 0) {
throw "$LASTEXITCODE Pester tests failed"
}