diff --git a/.github/workflows/ci-test.yml b/.github/workflows/ci-test.yml index ceec61b37..482c8c003 100644 --- a/.github/workflows/ci-test.yml +++ b/.github/workflows/ci-test.yml @@ -47,14 +47,19 @@ jobs: sparse-checkout: tools/install-powershell.ps1 sparse-checkout-cone-mode: false + - name: Install daily + if: ${{ github.event_name == 'schedule' || github.event_name == 'merge_group' }} + shell: pwsh + run: ./pwsh/tools/install-powershell.ps1 -Daily + - name: Build and test shell: pwsh run: Invoke-Build -Configuration Release ${{ github.event_name == 'merge_group' && 'TestFull' || 'Test' }} - - name: Test with daily + - name: Test daily if: ${{ github.event_name == 'schedule' }} shell: pwsh - run: ./pwsh/tools/install-powershell.ps1 -Daily && Invoke-Build -Configuration Release TestE2EDaily + run: Invoke-Build -Configuration Release TestE2EDaily - name: Upload build artifacts if: always() diff --git a/.gitignore b/.gitignore index ae0c4384b..1b97c3908 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,6 @@ bin/ obj/ module/PowerShellEditorServices/NOTICE.txt module/PowerShellEditorServices/Commands/en-US/ -module/Plaster/ module/PSReadLine/ module/PSScriptAnalyzer/ TestResults/ diff --git a/.pipelines/PowerShellEditorServices-Official.yml b/.pipelines/PowerShellEditorServices-Official.yml index 3e111a2d3..b01b57203 100644 --- a/.pipelines/PowerShellEditorServices-Official.yml +++ b/.pipelines/PowerShellEditorServices-Official.yml @@ -27,7 +27,7 @@ parameters: variables: system.debug: ${{ parameters.debug }} BuildConfiguration: Release - WindowsContainerImage: onebranch.azurecr.io/windows/ltsc2019/vse2022:latest + WindowsContainerImage: onebranch.azurecr.io/windows/ltsc2022/vse2022:latest DOTNET_NOLOGO: true DOTNET_GENERATE_ASPNET_CERTIFICATE: false @@ -46,6 +46,10 @@ extends: asyncSdl: enabled: true forStages: [build] + featureFlags: + WindowsHostVersion: + Version: 2022 + Network: Netlock stages: - stage: build jobs: @@ -75,22 +79,16 @@ extends: inputs: packageType: sdk version: 8.x - - task: UseDotNet@2 - displayName: Use .NET 7.x runtime (for tests) - inputs: - packageType: runtime - version: 7.x - task: UseDotNet@2 displayName: Use .NET 6.x runtime (for tests) inputs: packageType: runtime version: 6.x - - task: PowerShell@2 - displayName: Install PSResources - inputs: - pwsh: true - filePath: tools/installPSResources.ps1 - - pwsh: Invoke-Build TestFull -Configuration $(BuildConfiguration) + - pwsh: | + Register-PSRepository -Name CFS -SourceLocation "https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/powershell/nuget/v2" -InstallationPolicy Trusted + Install-Module -Repository CFS -Name InvokeBuild -RequiredVersion 5.11.3 + Install-Module -Repository CFS -Name platyPS -RequiredVersion 0.14.2 + Invoke-Build TestFull -Configuration $(BuildConfiguration) -PSRepository CFS displayName: Build and test - task: PublishTestResults@2 displayName: Publish test results diff --git a/PowerShellEditorServices.build.ps1 b/PowerShellEditorServices.build.ps1 index 59e1dede7..cdd71ef57 100644 --- a/PowerShellEditorServices.build.ps1 +++ b/PowerShellEditorServices.build.ps1 @@ -7,11 +7,7 @@ param( [switch]$LocalOmniSharp, - [string]$PsesSubmodulePath = "$PSScriptRoot/module", - - [string]$ModulesJsonPath = "$PSScriptRoot/modules.json", - - [string]$DefaultModuleRepository = "PSGallery", + [string]$PSRepository = "PSGallery", [string]$Verbosity = "minimal", @@ -22,8 +18,8 @@ param( [string[]]$TestArgs = @("--logger", "console;verbosity=minimal", "--logger", "trx") ) -#Requires -Modules @{ModuleName="InvokeBuild"; ModuleVersion="5.0.0"} -#Requires -Modules @{ModuleName="platyPS"; ModuleVersion="0.14.0"} +#Requires -Modules @{ModuleName = "InvokeBuild"; ModuleVersion = "5.0.0"} +#Requires -Modules @{ModuleName = "platyPS"; ModuleVersion = "0.14.2"} $script:dotnetBuildArgs = @( "--verbosity" @@ -40,29 +36,22 @@ $script:dotnetTestArgs = @("test") + $script:dotnetBuildArgs + $TestArgs + @( ) $script:IsNix = $IsLinux -or $IsMacOS -# For Apple M1, pwsh might be getting emulated, in which case we need to check -# for the proc_translated flag, otherwise we can check the architecture. -$script:IsAppleM1 = $IsMacOS -and ((sysctl -n sysctl.proc_translated 2> $null) -eq 1 -or - [System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture -eq "Arm64") -$script:IsArm64 = -not $script:IsNix -and @("ARM64") -contains $env:PROCESSOR_ARCHITECTURE -$script:BuildInfoPath = [System.IO.Path]::Combine($PSScriptRoot, "src", "PowerShellEditorServices.Hosting", "BuildInfo.cs") -$script:PsesCommonProps = [xml](Get-Content -Raw "$PSScriptRoot/PowerShellEditorServices.Common.props") +$script:BuildInfoPath = "src/PowerShellEditorServices.Hosting/BuildInfo.cs" $script:NetFramework = @{ PS51 = 'net462' PS72 = 'net6.0' - PS73 = 'net7.0' PS74 = 'net8.0' Standard = 'netstandard2.0' } -$script:HostCoreOutput = "$PSScriptRoot/src/PowerShellEditorServices.Hosting/bin/$Configuration/$($script:NetFramework.PS72)/publish" -$script:HostDeskOutput = "$PSScriptRoot/src/PowerShellEditorServices.Hosting/bin/$Configuration/$($script:NetFramework.PS51)/publish" -$script:PsesOutput = "$PSScriptRoot/src/PowerShellEditorServices/bin/$Configuration/$($script:NetFramework.Standard)/publish" +$script:HostCoreOutput = "src/PowerShellEditorServices.Hosting/bin/$Configuration/$($script:NetFramework.PS72)/publish" +$script:HostDeskOutput = "src/PowerShellEditorServices.Hosting/bin/$Configuration/$($script:NetFramework.PS51)/publish" +$script:PsesOutput = "src/PowerShellEditorServices/bin/$Configuration/$($script:NetFramework.Standard)/publish" if (Get-Command git -ErrorAction SilentlyContinue) { # ignore changes to this file - git update-index --assume-unchanged "$PSScriptRoot/src/PowerShellEditorServices.Hosting/BuildInfo.cs" + git update-index --assume-unchanged $script:BuildInfoPath } Task FindDotNet { @@ -72,40 +61,27 @@ Task FindDotNet { [Version]$existingVersion, $null = (dotnet --version) -split " " -split "-" Assert ($existingVersion -ge [Version]("8.0")) ".NET SDK 8.0 or higher is required, please update it: https://aka.ms/dotnet-cli" - Write-Host "Using dotnet v$(dotnet --version) at path $((Get-Command dotnet).Source)" -ForegroundColor Green -} - -Task BinClean { - Remove-BuildItem $PSScriptRoot\.tmp - Remove-BuildItem $PSScriptRoot\module\PowerShellEditorServices\bin + Write-Build DarkGreen "Using dotnet v$(dotnet --version) at path $((Get-Command dotnet).Source)" } -Task Clean FindDotNet, BinClean, { +Task Clean FindDotNet, { + Write-Build DarkMagenta "Cleaning PowerShellEditorServices" Invoke-BuildExec { & dotnet clean --verbosity $Verbosity } - Remove-BuildItem $PSScriptRoot\src\*.nupkg - Remove-BuildItem $PSScriptRoot\PowerShellEditorServices*.zip - Remove-BuildItem $PSScriptRoot\module\PowerShellEditorServices\Commands\en-US\*-help.xml - - # Remove bundled component modules - $moduleJsonPath = "$PSScriptRoot\modules.json" - if (Test-Path $moduleJsonPath) { - Get-Content -Raw $moduleJsonPath | - ConvertFrom-Json | - ForEach-Object { $_.PSObject.Properties.Name } | - ForEach-Object { Remove-BuildItem -Path "$PSScriptRoot/module/$_" } - } + Remove-BuildItem module/PowerShellEditorServices/bin + Remove-BuildItem module/PowerShellEditorServices/Commands/en-US/*-help.xml + Remove-BuildItem module/PSReadLine + Remove-BuildItem module/PSScriptAnalyzer } Task CreateBuildInfo { $buildOrigin = "Development" $buildCommit = git rev-parse HEAD - [xml]$xml = Get-Content "$PSScriptRoot/PowerShellEditorServices.Common.props" + [xml]$xml = Get-Content "PowerShellEditorServices.Common.props" $buildVersion = $xml.Project.PropertyGroup.VersionPrefix $prerelease = $xml.Project.PropertyGroup.VersionSuffix if ($prerelease) { $buildVersion += "-$prerelease" } - # Set build info fields on build platforms if ($env:TF_BUILD) { # Azure DevOps AKA OneBranch if ($env:BUILD_REASON -like "Manual") { @@ -138,49 +114,98 @@ namespace Microsoft.PowerShell.EditorServices.Hosting "@ if (Compare-Object $buildInfoContents.Split([Environment]::NewLine) (Get-Content $script:BuildInfoPath)) { - Write-Host "Updating build info." + Write-Build DarkMagenta "Updating build info" Set-Content -LiteralPath $script:BuildInfoPath -Value $buildInfoContents -Force } } -Task SetupHelpForTests { - # TODO: Check if it must be updated in a compatible way! - Write-Host "Updating help for tests." - Update-Help -Module Microsoft.PowerShell.Management,Microsoft.PowerShell.Utility -Force -Scope CurrentUser -UICulture en-US +task RestorePsesModules -If (-not (Test-Path "module/PSReadLine") -or -not (Test-Path "module/PSScriptAnalyzer")) { + Write-Build DarkMagenta "Restoring bundled modules" + Save-Module -Path module -Repository $PSRepository -Name PSScriptAnalyzer -RequiredVersion "1.22.0" -Verbose + Save-Module -Path module -Repository $PSRepository -Name PSReadLine -RequiredVersion "2.4.0-beta0" -AllowPrerelease -Verbose } -Task Build FindDotNet, CreateBuildInfo, { - Invoke-BuildExec { & dotnet publish $script:dotnetBuildArgs .\src\PowerShellEditorServices\PowerShellEditorServices.csproj -f $script:NetFramework.Standard } - Invoke-BuildExec { & dotnet publish $script:dotnetBuildArgs .\src\PowerShellEditorServices.Hosting\PowerShellEditorServices.Hosting.csproj -f $script:NetFramework.PS72 } +Task Build FindDotNet, CreateBuildInfo, RestorePsesModules, { + Write-Build DarkGreen "Building PowerShellEditorServices" + Invoke-BuildExec { & dotnet publish $script:dotnetBuildArgs ./src/PowerShellEditorServices/PowerShellEditorServices.csproj -f $script:NetFramework.Standard } + Invoke-BuildExec { & dotnet publish $script:dotnetBuildArgs ./src/PowerShellEditorServices.Hosting/PowerShellEditorServices.Hosting.csproj -f $script:NetFramework.PS72 } if (-not $script:IsNix) { - Invoke-BuildExec { & dotnet publish $script:dotnetBuildArgs .\src\PowerShellEditorServices.Hosting\PowerShellEditorServices.Hosting.csproj -f $script:NetFramework.PS51 } + Invoke-BuildExec { & dotnet publish $script:dotnetBuildArgs ./src/PowerShellEditorServices.Hosting/PowerShellEditorServices.Hosting.csproj -f $script:NetFramework.PS51 } } } -# The concise set of tests (for pull requests) -Task Test TestPS74, TestE2EPwsh, TestPS51, TestE2EPowerShell +Task AssembleModule -After Build { + Write-Build DarkGreen "Assembling PowerShellEditorServices module" + $psesOutputPath = "./module/PowerShellEditorServices" + $psesBinOutputPath = "$psesOutputPath/bin" + $psesDepsPath = "$psesBinOutputPath/Common" + $psesCoreHostPath = "$psesBinOutputPath/Core" + $psesDeskHostPath = "$psesBinOutputPath/Desktop" -# Every combination of tests (for main branch) -Task TestFull Test, TestPS73, TestPS72, TestE2EPwshCLM, TestE2EPowerShellCLM + foreach ($dir in $psesDepsPath, $psesCoreHostPath, $psesDeskHostPath) { + New-Item -Force -Path $dir -ItemType Directory | Out-Null + } -Task TestPS74 Build, SetupHelpForTests, { - Set-Location .\test\PowerShellEditorServices.Test\ - Invoke-BuildExec { & dotnet $script:dotnetTestArgs $script:NetFramework.PS74 } + # Copy third party notices to module folder + Copy-Item -Force -Path "NOTICE.txt" -Destination $psesOutputPath + + # Assemble PSES module + $includedDlls = [System.Collections.Generic.HashSet[string]]::new() + [void]$includedDlls.Add('System.Management.Automation.dll') + + # PSES/bin/Common + foreach ($psesComponent in Get-ChildItem $script:PsesOutput) { + if ($psesComponent.Name -eq 'System.Management.Automation.dll' -or + $psesComponent.Name -eq 'System.Runtime.InteropServices.RuntimeInformation.dll') { + continue + } + + if ($psesComponent.Extension) { + [void]$includedDlls.Add($psesComponent.Name) + Copy-Item -Path $psesComponent.FullName -Destination $psesDepsPath -Force + } + } + + # PSES/bin/Core + foreach ($hostComponent in Get-ChildItem $script:HostCoreOutput) { + if (-not $includedDlls.Contains($hostComponent.Name)) { + Copy-Item -Path $hostComponent.FullName -Destination $psesCoreHostPath -Force + } + } + + # PSES/bin/Desktop + if (-not $script:IsNix) { + foreach ($hostComponent in Get-ChildItem $script:HostDeskOutput) { + if (-not $includedDlls.Contains($hostComponent.Name)) { + Copy-Item -Path $hostComponent.FullName -Destination $psesDeskHostPath -Force + } + } + } } -Task TestPS73 Build, SetupHelpForTests, { - Set-Location .\test\PowerShellEditorServices.Test\ - Invoke-BuildExec { & dotnet $script:dotnetTestArgs $script:NetFramework.PS73 } +Task BuildCmdletHelp -After AssembleModule { + Write-Build DarkGreen "Building cmdlet help" + New-ExternalHelp -Path ./module/docs -OutputPath ./module/PowerShellEditorServices/Commands/en-US -Force +} + +Task SetupHelpForTests { + Write-Build DarkMagenta "Updating help (for tests)" + Update-Help -Module Microsoft.PowerShell.Management,Microsoft.PowerShell.Utility -Force -Scope CurrentUser -UICulture en-US +} + +Task TestPS74 Build, SetupHelpForTests, { + Set-Location ./test/PowerShellEditorServices.Test/ + Invoke-BuildExec { & dotnet $script:dotnetTestArgs $script:NetFramework.PS74 } } Task TestPS72 Build, SetupHelpForTests, { - Set-Location .\test\PowerShellEditorServices.Test\ + Set-Location ./test/PowerShellEditorServices.Test/ Invoke-BuildExec { & dotnet $script:dotnetTestArgs $script:NetFramework.PS72 } } Task TestPS51 -If (-not $script:IsNix) Build, SetupHelpForTests, { - Set-Location .\test\PowerShellEditorServices.Test\ + Set-Location ./test/PowerShellEditorServices.Test/ # TODO: See https://github.com/dotnet/sdk/issues/18353 for x64 test host # that is debuggable! If architecture is added, the assembly path gets an # additional folder, necessitating fixes to find the commands definition @@ -199,7 +224,7 @@ Task TestPS51 -If (-not $script:IsNix) Build, SetupHelpForTests, { # NOTE: The framework for the E2E tests applies to the mock client, and so # should just be the latest supported framework. Task TestE2EPwsh Build, SetupHelpForTests, { - Set-Location .\test\PowerShellEditorServices.Test.E2E\ + Set-Location ./test/PowerShellEditorServices.Test.E2E/ $env:PWSH_EXE_NAME = "pwsh" Invoke-BuildExec { & dotnet $script:dotnetTestArgs $script:NetFramework.PS74 } } @@ -207,18 +232,18 @@ Task TestE2EPwsh Build, SetupHelpForTests, { $PwshDaily = if ($script:IsNix) { "$HOME/.powershell-daily/pwsh" } else { - "$env:LOCALAPPDATA\Microsoft\powershell-daily\pwsh.exe" + "$env:LOCALAPPDATA/Microsoft/powershell-daily/pwsh.exe" } Task TestE2EDaily -If (Test-Path $PwshDaily) Build, SetupHelpForTests, { - Set-Location .\test\PowerShellEditorServices.Test.E2E\ + Set-Location ./test/PowerShellEditorServices.Test.E2E/ $env:PWSH_EXE_NAME = $PwshDaily - Write-Host "Running end-to-end tests with: $(& $PwshDaily --version)" + Write-Build DarkGreen "Running end-to-end tests with: $(& $PwshDaily --version)" Invoke-BuildExec { & dotnet $script:dotnetTestArgs $script:NetFramework.PS74 } } Task TestE2EPowerShell -If (-not $script:IsNix) Build, SetupHelpForTests, { - Set-Location .\test\PowerShellEditorServices.Test.E2E\ + Set-Location ./test/PowerShellEditorServices.Test.E2E/ $env:PWSH_EXE_NAME = "powershell" try { # TODO: See https://github.com/PowerShell/vscode-powershell/issues/3886 @@ -232,16 +257,16 @@ Task TestE2EPowerShell -If (-not $script:IsNix) Build, SetupHelpForTests, { } Task TestE2EPwshCLM -If (-not $script:IsNix) Build, SetupHelpForTests, { - Set-Location .\test\PowerShellEditorServices.Test.E2E\ + Set-Location ./test/PowerShellEditorServices.Test.E2E/ $env:PWSH_EXE_NAME = "pwsh" if (-not [Security.Principal.WindowsIdentity]::GetCurrent().Owner.IsWellKnown("BuiltInAdministratorsSid")) { - Write-Warning "Skipping Constrained Language Mode tests as they must be ran in an elevated process." + Write-Build DarkRed "Skipping Constrained Language Mode tests as they must be ran in an elevated process" return } try { - Write-Host "Running end-to-end tests in Constrained Language Mode." + Write-Build DarkGreen "Running end-to-end tests in Constrained Language Mode" [System.Environment]::SetEnvironmentVariable("__PSLockdownPolicy", "0x80000007", [System.EnvironmentVariableTarget]::Machine) Invoke-BuildExec { & dotnet $script:dotnetTestArgs $script:NetFramework.PS74 } } finally { @@ -250,16 +275,16 @@ Task TestE2EPwshCLM -If (-not $script:IsNix) Build, SetupHelpForTests, { } Task TestE2EPowerShellCLM -If (-not $script:IsNix) Build, SetupHelpForTests, { - Set-Location .\test\PowerShellEditorServices.Test.E2E\ + Set-Location ./test/PowerShellEditorServices.Test.E2E/ $env:PWSH_EXE_NAME = "powershell" if (-not [Security.Principal.WindowsIdentity]::GetCurrent().Owner.IsWellKnown("BuiltInAdministratorsSid")) { - Write-Warning "Skipping Constrained Language Mode tests as they must be ran in an elevated process." + Write-Build DarkRed "Skipping Constrained Language Mode tests as they must be ran in an elevated process" return } try { - Write-Host "Running end-to-end tests in Constrained Language Mode." + Write-Build DarkGreen "Running end-to-end tests in Constrained Language Mode" [System.Environment]::SetEnvironmentVariable("__PSLockdownPolicy", "0x80000007", [System.EnvironmentVariableTarget]::Machine) # TODO: See https://github.com/PowerShell/vscode-powershell/issues/3886 # Inheriting the module path for powershell.exe breaks things! @@ -272,110 +297,8 @@ Task TestE2EPowerShellCLM -If (-not $script:IsNix) Build, SetupHelpForTests, { } } -Task LayoutModule -After Build { - $modulesDir = "$PSScriptRoot/module" - $psesOutputPath = "$modulesDir/PowerShellEditorServices" - $psesBinOutputPath = "$PSScriptRoot/module/PowerShellEditorServices/bin" - $psesDepsPath = "$psesBinOutputPath/Common" - $psesCoreHostPath = "$psesBinOutputPath/Core" - $psesDeskHostPath = "$psesBinOutputPath/Desktop" +Task Test TestPS72, TestPS74, TestE2EPwsh, TestPS51, TestE2EPowerShell - foreach ($dir in $psesDepsPath, $psesCoreHostPath, $psesDeskHostPath) { - New-Item -Force -Path $dir -ItemType Directory | Out-Null - } - - # Copy third party notices to module folder - Copy-Item -Force -Path "$PSScriptRoot\NOTICE.txt" -Destination $psesOutputPath - - # Assemble PSES module - - $includedDlls = [System.Collections.Generic.HashSet[string]]::new() - [void]$includedDlls.Add('System.Management.Automation.dll') - - # PSES/bin/Common - foreach ($psesComponent in Get-ChildItem $script:PsesOutput) { - if ($psesComponent.Name -eq 'System.Management.Automation.dll' -or - $psesComponent.Name -eq 'System.Runtime.InteropServices.RuntimeInformation.dll') { - continue - } - - if ($psesComponent.Extension) { - [void]$includedDlls.Add($psesComponent.Name) - Copy-Item -Path $psesComponent.FullName -Destination $psesDepsPath -Force - } - } - - # PSES/bin/Core - foreach ($hostComponent in Get-ChildItem $script:HostCoreOutput) { - if (-not $includedDlls.Contains($hostComponent.Name)) { - Copy-Item -Path $hostComponent.FullName -Destination $psesCoreHostPath -Force - } - } - - # PSES/bin/Desktop - if (-not $script:IsNix) { - foreach ($hostComponent in Get-ChildItem $script:HostDeskOutput) { - if (-not $includedDlls.Contains($hostComponent.Name)) { - Copy-Item -Path $hostComponent.FullName -Destination $psesDeskHostPath -Force - } - } - } -} - -task RestorePsesModules -After Build { - $submodulePath = (Resolve-Path $PsesSubmodulePath).Path + [IO.Path]::DirectorySeparatorChar - Write-Host "Restoring EditorServices modules..." - - # Read in the modules.json file as a hashtable so it can be splatted - $moduleInfos = @{} - - (Get-Content -Raw $ModulesJsonPath | ConvertFrom-Json).PSObject.Properties | ForEach-Object { - $name = $_.Name - $body = @{ - Name = $name - Version = $_.Value.Version - AllowPrerelease = $_.Value.AllowPrerelease - Repository = if ($_.Value.Repository) { $_.Value.Repository } else { $DefaultModuleRepository } - Path = $submodulePath - } - - if (-not $name) { - throw "EditorServices module listed without name in '$ModulesJsonPath'" - } - - $moduleInfos.Add($name, $body) - } - - # Save each module in the modules.json file - foreach ($moduleName in $moduleInfos.Keys) { - if (Test-Path -Path (Join-Path -Path $submodulePath -ChildPath $moduleName)) { - Write-Host "`tModule '${moduleName}' already detected, skipping!" - continue - } - - $moduleInstallDetails = $moduleInfos[$moduleName] - - $splatParameters = @{ - Name = $moduleName - RequiredVersion = $moduleInstallDetails.Version - Repository = if ($moduleInstallDetails.Repository) { $moduleInstallDetails.Repository } else { $DefaultModuleRepository } - Path = $submodulePath - } - - # There's a bug in PowerShell get where this argument isn't correctly translated when it's false. - if ($moduleInstallDetails.AllowPrerelease) { - $splatParameters["AllowPrerelease"] = $moduleInstallDetails.AllowPrerelease - } - - Write-Host "`tInstalling module: ${moduleName} with arguments $(ConvertTo-Json $splatParameters)" - - Save-Module @splatParameters - } -} - -Task BuildCmdletHelp -After LayoutModule { - New-ExternalHelp -Path $PSScriptRoot\module\docs -OutputPath $PSScriptRoot\module\PowerShellEditorServices\Commands\en-US -Force | Out-Null -} +Task TestFull Test, TestE2EDaily, TestE2EPwshCLM, TestE2EPowerShellCLM -# The default task is to run the entire CI build Task . Clean, Build, Test diff --git a/modules.json b/modules.json deleted file mode 100644 index f72a38714..000000000 --- a/modules.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "PSScriptAnalyzer": { - "Version": "1.22.0", - "AllowPrerelease": false - }, - "PSReadLine": { - "Version": "2.4.0-beta0", - "AllowPrerelease": true - } -} diff --git a/test/PowerShellEditorServices.Test/PowerShellEditorServices.Test.csproj b/test/PowerShellEditorServices.Test/PowerShellEditorServices.Test.csproj index 5c6bba34d..e004a0efe 100644 --- a/test/PowerShellEditorServices.Test/PowerShellEditorServices.Test.csproj +++ b/test/PowerShellEditorServices.Test/PowerShellEditorServices.Test.csproj @@ -2,7 +2,7 @@ - net8.0;net7.0;net6.0;net462 + net8.0;net6.0;net462 Microsoft.PowerShell.EditorServices.Test x64 @@ -18,17 +18,12 @@ - - - - - - + - + diff --git a/tools/installPSResources.ps1 b/tools/installPSResources.ps1 index a7b4b041f..5456cac13 100644 --- a/tools/installPSResources.ps1 +++ b/tools/installPSResources.ps1 @@ -1,13 +1,5 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. -$ErrorActionPreference = 'Stop' - -Set-PSRepository -Name PSGallery -InstallationPolicy Trusted | Out-Null -if ($PSVersionTable.PSVersion.Major -lt 6) { - throw "The build script requires PowerShell 7!" -} - -# TODO: Switch to Install-PSResource when CI uses PowerShell 7.4 -Install-Module -Name InvokeBuild -Scope CurrentUser -Install-Module -Name platyPS -Scope CurrentUser +Install-PSResource -TrustRepository -Name InvokeBuild -Scope CurrentUser +Install-PSResource -TrustRepository -Name platyPS -Scope CurrentUser