@@ -175,7 +175,7 @@ Task Build FindDotNet, CreateBuildInfo, {
175
175
Invoke-BuildExec { & dotnet publish $script :dotnetBuildArgs .\src\PowerShellEditorServices.VSCode\PowerShellEditorServices.VSCode.csproj -f $script :NetRuntime.Standard }
176
176
}
177
177
178
- Task Test TestServer, TestE2E
178
+ Task Test TestServer, TestE2E, TestConstrainedLanguageMode
179
179
180
180
Task TestServer TestServerWinPS, TestServerPS72, TestServerPS73
181
181
@@ -202,23 +202,25 @@ Task TestServerPS73 -If ($PSVersionTable.PSEdition -eq "Core") Build, SetupHelpF
202
202
203
203
Task TestE2E Build, SetupHelpForTests, {
204
204
Set-Location .\test\PowerShellEditorServices.Test.E2E\
205
-
206
205
$env: PWSH_EXE_NAME = if ($IsCoreCLR ) { " pwsh" } else { " powershell" }
207
206
Invoke-BuildExec { & dotnet $script :dotnetTestArgs $script :NetRuntime.PS73 }
207
+ }
208
208
209
- if (! $script :IsNix ) {
210
- if (-not [Security.Principal.WindowsIdentity ]::GetCurrent().Owner.IsWellKnown(" BuiltInAdministratorsSid" )) {
211
- Write-Warning " Skipping Constrained Language Mode tests as they must be ran in an elevated process."
212
- return
213
- }
209
+ Task TestConstrainedLanguageMode - If (-not $script :IsNix ) Build, SetupHelpForTests, {
210
+ Set-Location .\test\PowerShellEditorServices.Test.E2E\
211
+ $env: PWSH_EXE_NAME = if ($IsCoreCLR ) { " pwsh" } else { " powershell" }
214
212
215
- try {
216
- Write-Host " Running end-to-end tests in Constrained Language Mode."
217
- [System.Environment ]::SetEnvironmentVariable(" __PSLockdownPolicy" , " 0x80000007" , [System.EnvironmentVariableTarget ]::Machine);
218
- Invoke-BuildExec { & dotnet $script :dotnetTestArgs $script :NetRuntime.PS73 }
219
- } finally {
220
- [System.Environment ]::SetEnvironmentVariable(" __PSLockdownPolicy" , $null , [System.EnvironmentVariableTarget ]::Machine);
221
- }
213
+ if (-not [Security.Principal.WindowsIdentity ]::GetCurrent().Owner.IsWellKnown(" BuiltInAdministratorsSid" )) {
214
+ Write-Warning " Skipping Constrained Language Mode tests as they must be ran in an elevated process."
215
+ return
216
+ }
217
+
218
+ try {
219
+ Write-Host " Running end-to-end tests in Constrained Language Mode."
220
+ [System.Environment ]::SetEnvironmentVariable(" __PSLockdownPolicy" , " 0x80000007" , [System.EnvironmentVariableTarget ]::Machine)
221
+ Invoke-BuildExec { & dotnet $script :dotnetTestArgs $script :NetRuntime.PS73 }
222
+ } finally {
223
+ [System.Environment ]::SetEnvironmentVariable(" __PSLockdownPolicy" , $null , [System.EnvironmentVariableTarget ]::Machine)
222
224
}
223
225
}
224
226
@@ -290,11 +292,11 @@ task RestorePsesModules -After Build {
290
292
(Get-Content - Raw $ModulesJsonPath | ConvertFrom-Json ).PSObject.Properties | ForEach-Object {
291
293
$name = $_.Name
292
294
$body = @ {
293
- Name = $name
294
- Version = $_.Value.Version
295
+ Name = $name
296
+ Version = $_.Value.Version
295
297
AllowPrerelease = $_.Value.AllowPrerelease
296
- Repository = if ($_.Value.Repository ) { $_.Value.Repository } else { $DefaultModuleRepository }
297
- Path = $submodulePath
298
+ Repository = if ($_.Value.Repository ) { $_.Value.Repository } else { $DefaultModuleRepository }
299
+ Path = $submodulePath
298
300
}
299
301
300
302
if (-not $name ) {
@@ -321,11 +323,11 @@ task RestorePsesModules -After Build {
321
323
$moduleInstallDetails = $moduleInfos [$moduleName ]
322
324
323
325
$splatParameters = @ {
324
- Name = $moduleName
325
- RequiredVersion = $moduleInstallDetails.Version
326
- AllowPrerelease = $moduleInstallDetails.AllowPrerelease
327
- Repository = if ($moduleInstallDetails.Repository ) { $moduleInstallDetails.Repository } else { $DefaultModuleRepository }
328
- Path = $submodulePath
326
+ Name = $moduleName
327
+ RequiredVersion = $moduleInstallDetails.Version
328
+ AllowPrerelease = $moduleInstallDetails.AllowPrerelease
329
+ Repository = if ($moduleInstallDetails.Repository ) { $moduleInstallDetails.Repository } else { $DefaultModuleRepository }
330
+ Path = $submodulePath
329
331
}
330
332
331
333
Write-Host " `t Installing module: ${moduleName} with arguments $ ( ConvertTo-Json $splatParameters ) "
0 commit comments