@@ -41,6 +41,7 @@ $script:PsesCommonProps = [xml](Get-Content -Raw "$PSScriptRoot/PowerShellEditor
4141$script :NetRuntime = @ {
4242 PS7 = ' netcoreapp3.1'
4343 PS72 = ' net6.0'
44+ PS73 = ' net7.0'
4445 Desktop = ' net462'
4546 Standard = ' netstandard2.0'
4647}
@@ -73,24 +74,24 @@ Task FindDotNet {
7374}
7475
7576Task 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
7980}
8081
8182Task 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
8687
8788 # Remove bundled component modules
8889 $moduleJsonPath = " $PSScriptRoot \modules.json"
8990 if (Test-Path $moduleJsonPath ) {
9091 Get-Content - Raw $moduleJsonPath |
9192 ConvertFrom-Json |
9293 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/$_ " }
9495 }
9596}
9697
@@ -161,20 +162,20 @@ Task SetupHelpForTests {
161162}
162163
163164Task 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 }
167168 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 }
169170 }
170171
171172 # 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 }
173174}
174175
175176Task Test TestServer, TestE2E
176177
177- Task TestServer TestServerWinPS, TestServerPS7, TestServerPS72
178+ Task TestServer TestServerWinPS, TestServerPS7, TestServerPS72, TestServerPS73
178179
179180# NOTE: While these can run under `pwsh.exe` we only want them to run under
180181# `powershell.exe` so that the CI time isn't doubled.
@@ -184,25 +185,29 @@ Task TestServerWinPS -If ($PSVersionTable.PSEdition -eq "Desktop") Build, SetupH
184185 # that is debuggable! If architecture is added, the assembly path gets an
185186 # additional folder, necesstiating fixes to find the commands definition
186187 # file and test files.
187- Exec { & dotnet $script :dotnetTestArgs $script :NetRuntime.Desktop }
188+ Invoke-BuildExec { & dotnet $script :dotnetTestArgs $script :NetRuntime.Desktop }
188189}
189190
190191Task TestServerPS7 - If ($PSVersionTable.PSEdition -eq " Core" -and -not $script :IsAppleM1 -and -not $script :IsArm64 ) Build, SetupHelpForTests, {
191192 Set-Location .\test\PowerShellEditorServices.Test\
192- Exec { & dotnet $script :dotnetTestArgs $script :NetRuntime.PS7 }
193+ Invoke-BuildExec { & dotnet $script :dotnetTestArgs $script :NetRuntime.PS7 }
193194}
194195
195196Task TestServerPS72 - If ($PSVersionTable.PSEdition -eq " Core" ) Build, SetupHelpForTests, {
196197 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 }
198204}
199205
200206Task TestE2E Build, SetupHelpForTests, {
201207 Set-Location .\test\PowerShellEditorServices.Test.E2E\
202208
203209 $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 }
206211
207212 if (! $script :IsNix ) {
208213 if (-not [Security.Principal.WindowsIdentity ]::GetCurrent().Owner.IsWellKnown(" BuiltInAdministratorsSid" )) {
@@ -213,7 +218,7 @@ Task TestE2E Build, SetupHelpForTests, {
213218 try {
214219 Write-Host " Running end-to-end tests in Constrained Language Mode."
215220 [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 }
217222 } finally {
218223 [System.Environment ]::SetEnvironmentVariable(" __PSLockdownPolicy" , $null , [System.EnvironmentVariableTarget ]::Machine);
219224 }
0 commit comments