File tree 3 files changed +34
-3
lines changed
3 files changed +34
-3
lines changed Original file line number Diff line number Diff line change @@ -43,12 +43,36 @@ jobs:
43
43
shell : pwsh
44
44
45
45
- name : Test Windows PowerShell
46
+ if : matrix.os == 'windows-latest'
46
47
run : |
47
48
Install-Module Pester -Scope CurrentUser -Force -SkipPublisherCheck
48
49
./build.ps1 -Test
49
- if : matrix.os == 'windows-latest'
50
50
shell : powershell
51
51
52
+ - name : Download daily install script
53
+ uses : actions/checkout@v4
54
+ with :
55
+ repository : PowerShell/PowerShell
56
+ path : pwsh
57
+ sparse-checkout : tools/install-powershell.ps1
58
+ sparse-checkout-cone-mode : false
59
+
60
+ - name : Install daily
61
+ continue-on-error : true
62
+ run : ./pwsh/tools/install-powershell.ps1 -Daily -Destination ./daily
63
+ shell : pwsh
64
+
65
+ - name : Test daily
66
+ continue-on-error : true
67
+ run : |
68
+ if ($isWindows) {
69
+ $pwsh = (Resolve-Path .\daily\pwsh.exe)
70
+ } else {
71
+ $pwsh = (Resolve-Path .\daily\pwsh)
72
+ }
73
+ ./build.ps1 -Test -WithPowerShell:$pwsh
74
+ shell : pwsh
75
+
52
76
- name : Upload build artifacts
53
77
uses : actions/upload-artifact@v4
54
78
if : always()
Original file line number Diff line number Diff line change 32
32
33
33
[Parameter (ParameterSetName = ' Test' )]
34
34
[switch ] $InProcess ,
35
+ [string ] $WithPowerShell ,
35
36
36
37
[Parameter (ParameterSetName = ' BuildAll' )]
37
38
[switch ] $Catalog ,
85
86
Start-CreatePackage
86
87
}
87
88
" Test" {
88
- Test-ScriptAnalyzer - InProcess:$InProcess
89
+ Test-ScriptAnalyzer - InProcess:$InProcess - WithPowerShell: $WithPowerShell
89
90
return
90
91
}
91
92
default {
Original file line number Diff line number Diff line change @@ -308,7 +308,10 @@ function New-Catalog
308
308
function Test-ScriptAnalyzer
309
309
{
310
310
[CmdletBinding ()]
311
- param ( [switch ] $InProcess )
311
+ param (
312
+ [switch ] $InProcess ,
313
+ [string ] $WithPowerShell
314
+ )
312
315
313
316
END {
314
317
# versions 3 and 4 don't understand versioned module paths, so we need to rename the directory of the version to
@@ -349,6 +352,9 @@ function Test-ScriptAnalyzer
349
352
if ( $InProcess ) {
350
353
& $scriptBlock
351
354
}
355
+ elseif ( $WithPowerShell ) {
356
+ & ${WithPowerShell} - Command $scriptBlock
357
+ }
352
358
else {
353
359
$powershell = (Get-Process - id $PID ).MainModule.FileName
354
360
& ${powershell} - NoProfile - Command $scriptBlock
You can’t perform that action at this time.
0 commit comments