@@ -41,6 +41,7 @@ $script:PsesCommonProps = [xml](Get-Content -Raw "$PSScriptRoot/PowerShellEditor
41
41
$script :NetRuntime = @ {
42
42
PS7 = ' netcoreapp3.1'
43
43
PS72 = ' net6.0'
44
+ PS73 = ' net7.0'
44
45
Desktop = ' net462'
45
46
Standard = ' netstandard2.0'
46
47
}
@@ -73,24 +74,24 @@ Task FindDotNet {
73
74
}
74
75
75
76
Task BinClean {
76
- Remove-Item $PSScriptRoot \.tmp - Recurse - Force - ErrorAction Ignore
77
- Remove-Item $PSScriptRoot \module\PowerShellEditorServices\bin - Recurse - Force - ErrorAction Ignore
78
- Remove-Item $PSScriptRoot \module\PowerShellEditorServices.VSCode\bin - Recurse - Force - ErrorAction Ignore
77
+ Remove-BuildItem $PSScriptRoot \.tmp
78
+ Remove-BuildItem $PSScriptRoot \module\PowerShellEditorServices\bin
79
+ Remove-BuildItem $PSScriptRoot \module\PowerShellEditorServices.VSCode\bin
79
80
}
80
81
81
82
Task Clean FindDotNet, BinClean, {
82
- Exec { & dotnet clean $VerbosityArgs }
83
- Get-ChildItem - Recurse $PSScriptRoot \src\* .nupkg | Remove-Item - Force - ErrorAction Ignore
84
- Get-ChildItem $PSScriptRoot \PowerShellEditorServices* .zip | Remove-Item - Force - ErrorAction Ignore
85
- Get-ChildItem $PSScriptRoot \module\PowerShellEditorServices\Commands\en- US\*- help.xml | Remove-Item - Force - ErrorAction Ignore
83
+ Invoke-BuildExec { & dotnet clean $VerbosityArgs }
84
+ Get-ChildItem - Recurse $PSScriptRoot \src\* .nupkg | Remove-BuildItem
85
+ Get-ChildItem $PSScriptRoot \PowerShellEditorServices* .zip | Remove-BuildItem
86
+ Get-ChildItem $PSScriptRoot \module\PowerShellEditorServices\Commands\en- US\*- help.xml | Remove-BuildItem
86
87
87
88
# Remove bundled component modules
88
89
$moduleJsonPath = " $PSScriptRoot \modules.json"
89
90
if (Test-Path $moduleJsonPath ) {
90
91
Get-Content - Raw $moduleJsonPath |
91
92
ConvertFrom-Json |
92
93
ForEach-Object { $_.PSObject.Properties.Name } |
93
- ForEach-Object { Remove-Item - Path " $PSScriptRoot /module/$_ " - Recurse - Force - ErrorAction Ignore }
94
+ ForEach-Object { Remove-BuildItem - Path " $PSScriptRoot /module/$_ " }
94
95
}
95
96
}
96
97
@@ -161,20 +162,20 @@ Task SetupHelpForTests {
161
162
}
162
163
163
164
Task Build FindDotNet, CreateBuildInfo, {
164
- Exec { & dotnet restore $VerbosityArgs }
165
- Exec { & dotnet publish $VerbosityArgs - c $Configuration .\src\PowerShellEditorServices\PowerShellEditorServices.csproj -f $script :NetRuntime.Standard }
166
- Exec { & dotnet publish $VerbosityArgs - c $Configuration .\src\PowerShellEditorServices.Hosting\PowerShellEditorServices.Hosting.csproj -f $script :NetRuntime.PS7 }
165
+ Invoke-BuildExec { & dotnet restore $VerbosityArgs }
166
+ Invoke-BuildExec { & dotnet publish $VerbosityArgs - c $Configuration .\src\PowerShellEditorServices\PowerShellEditorServices.csproj -f $script :NetRuntime.Standard }
167
+ Invoke-BuildExec { & dotnet publish $VerbosityArgs - c $Configuration .\src\PowerShellEditorServices.Hosting\PowerShellEditorServices.Hosting.csproj -f $script :NetRuntime.PS7 }
167
168
if (-not $script :IsNix ) {
168
- Exec { & dotnet publish $VerbosityArgs - c $Configuration .\src\PowerShellEditorServices.Hosting\PowerShellEditorServices.Hosting.csproj -f $script :NetRuntime.Desktop }
169
+ Invoke-BuildExec { & dotnet publish $VerbosityArgs - c $Configuration .\src\PowerShellEditorServices.Hosting\PowerShellEditorServices.Hosting.csproj -f $script :NetRuntime.Desktop }
169
170
}
170
171
171
172
# Build PowerShellEditorServices.VSCode module
172
- Exec { & dotnet publish $VerbosityArgs - c $Configuration .\src\PowerShellEditorServices.VSCode\PowerShellEditorServices.VSCode.csproj -f $script :NetRuntime.Standard }
173
+ Invoke-BuildExec { & dotnet publish $VerbosityArgs - c $Configuration .\src\PowerShellEditorServices.VSCode\PowerShellEditorServices.VSCode.csproj -f $script :NetRuntime.Standard }
173
174
}
174
175
175
176
Task Test TestServer, TestE2E
176
177
177
- Task TestServer TestServerWinPS, TestServerPS7, TestServerPS72
178
+ Task TestServer TestServerWinPS, TestServerPS7, TestServerPS72, TestServerPS73
178
179
179
180
# NOTE: While these can run under `pwsh.exe` we only want them to run under
180
181
# `powershell.exe` so that the CI time isn't doubled.
@@ -184,25 +185,29 @@ Task TestServerWinPS -If ($PSVersionTable.PSEdition -eq "Desktop") Build, SetupH
184
185
# that is debuggable! If architecture is added, the assembly path gets an
185
186
# additional folder, necesstiating fixes to find the commands definition
186
187
# file and test files.
187
- Exec { & dotnet $script :dotnetTestArgs $script :NetRuntime.Desktop }
188
+ Invoke-BuildExec { & dotnet $script :dotnetTestArgs $script :NetRuntime.Desktop }
188
189
}
189
190
190
191
Task TestServerPS7 - If ($PSVersionTable.PSEdition -eq " Core" -and -not $script :IsAppleM1 -and -not $script :IsArm64 ) Build, SetupHelpForTests, {
191
192
Set-Location .\test\PowerShellEditorServices.Test\
192
- Exec { & dotnet $script :dotnetTestArgs $script :NetRuntime.PS7 }
193
+ Invoke-BuildExec { & dotnet $script :dotnetTestArgs $script :NetRuntime.PS7 }
193
194
}
194
195
195
196
Task TestServerPS72 - If ($PSVersionTable.PSEdition -eq " Core" ) Build, SetupHelpForTests, {
196
197
Set-Location .\test\PowerShellEditorServices.Test\
197
- Exec { & dotnet $script :dotnetTestArgs $script :NetRuntime.PS72 }
198
+ Invoke-BuildExec { & dotnet $script :dotnetTestArgs $script :NetRuntime.PS72 }
199
+ }
200
+
201
+ Task TestServerPS73 - If ($PSVersionTable.PSEdition -eq " Core" ) Build, SetupHelpForTests, {
202
+ Set-Location .\test\PowerShellEditorServices.Test\
203
+ Invoke-BuildExec { & dotnet $script :dotnetTestArgs $script :NetRuntime.PS73 }
198
204
}
199
205
200
206
Task TestE2E Build, SetupHelpForTests, {
201
207
Set-Location .\test\PowerShellEditorServices.Test.E2E\
202
208
203
209
$env: PWSH_EXE_NAME = if ($IsCoreCLR ) { " pwsh" } else { " powershell" }
204
- $NetRuntime = if ($IsAppleM1 -or $script :IsArm64 ) { $script :NetRuntime.PS72 } else { $script :NetRuntime.PS7 }
205
- Exec { & dotnet $script :dotnetTestArgs $NetRuntime }
210
+ Invoke-BuildExec { & dotnet $script :dotnetTestArgs $script :NetRuntime.PS72 }
206
211
207
212
if (! $script :IsNix ) {
208
213
if (-not [Security.Principal.WindowsIdentity ]::GetCurrent().Owner.IsWellKnown(" BuiltInAdministratorsSid" )) {
@@ -213,7 +218,7 @@ Task TestE2E Build, SetupHelpForTests, {
213
218
try {
214
219
Write-Host " Running end-to-end tests in Constrained Language Mode."
215
220
[System.Environment ]::SetEnvironmentVariable(" __PSLockdownPolicy" , " 0x80000007" , [System.EnvironmentVariableTarget ]::Machine);
216
- Exec { & dotnet $script :dotnetTestArgs $script :NetRuntime.PS7 }
221
+ Invoke-BuildExec { & dotnet $script :dotnetTestArgs $script :NetRuntime.PS72 }
217
222
} finally {
218
223
[System.Environment ]::SetEnvironmentVariable(" __PSLockdownPolicy" , $null , [System.EnvironmentVariableTarget ]::Machine);
219
224
}
0 commit comments