From 6bea0ddf2da60fc40f115ade44f3c9f8cf2e6d15 Mon Sep 17 00:00:00 2001 From: Andy Jordan <2226434+andyleejordan@users.noreply.github.com> Date: Fri, 31 Jan 2025 13:56:20 -0800 Subject: [PATCH 1/5] Use `RequiredResource` hashtable to specify PowerShell module versions --- tools/installPSResources.ps1 | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/tools/installPSResources.ps1 b/tools/installPSResources.ps1 index e98910d..3bb642a 100644 --- a/tools/installPSResources.ps1 +++ b/tools/installPSResources.ps1 @@ -6,8 +6,19 @@ param( ) if ($PSRepository -eq "CFS" -and -not (Get-PSResourceRepository -Name CFS -ErrorAction SilentlyContinue)) { - Register-PSResourceRepository -Name CFS -Uri "https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/powershell/nuget/v3/index.json" + Register-PSResourceRepository -Name CFS -Uri "https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/PowerShellGalleryMirror/nuget/v3/index.json" } -Install-PSResource -Repository $PSRepository -TrustRepository -Name InvokeBuild -Install-PSResource -Repository $PSRepository -TrustRepository -Name platyPS +# NOTE: Due to a bug in Install-PSResource with upstream feeds, we have to +# request an exact version. Otherwise, if a newer version is available in the +# upstream feed, it will fail to install any version at all. +Install-PSResource -Verbose -TrustRepository -RequiredResource @{ + InvokeBuild = @{ + version = "5.12.1" + repository = $PSRepository + } + platyPS = @{ + version = "0.14.2" + repository = $PSRepository + } +} From a697084660be0fd559cda248205f34d800bad06c Mon Sep 17 00:00:00 2001 From: 1ES Gardener Date: Thu, 19 Sep 2024 17:13:44 +0000 Subject: [PATCH 2/5] Enable NuGet Central Package Management --- Directory.Build.props | 5 +++++ Directory.Packages.props | 8 ++++++++ .../Microsoft.PowerShell.ConsoleGuiTools.csproj | 8 ++++---- .../Microsoft.PowerShell.OutGridView.Models.csproj | 4 ++-- 4 files changed, 19 insertions(+), 6 deletions(-) create mode 100644 Directory.Build.props create mode 100644 Directory.Packages.props diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 0000000..1932808 --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,5 @@ + + + true + + diff --git a/Directory.Packages.props b/Directory.Packages.props new file mode 100644 index 0000000..ed171a5 --- /dev/null +++ b/Directory.Packages.props @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/Microsoft.PowerShell.ConsoleGuiTools/Microsoft.PowerShell.ConsoleGuiTools.csproj b/src/Microsoft.PowerShell.ConsoleGuiTools/Microsoft.PowerShell.ConsoleGuiTools.csproj index da77cf2..6fbb71e 100644 --- a/src/Microsoft.PowerShell.ConsoleGuiTools/Microsoft.PowerShell.ConsoleGuiTools.csproj +++ b/src/Microsoft.PowerShell.ConsoleGuiTools/Microsoft.PowerShell.ConsoleGuiTools.csproj @@ -15,9 +15,9 @@ - - - + + + @@ -33,4 +33,4 @@ true Recommended - + \ No newline at end of file diff --git a/src/Microsoft.PowerShell.OutGridView.Models/Microsoft.PowerShell.OutGridView.Models.csproj b/src/Microsoft.PowerShell.OutGridView.Models/Microsoft.PowerShell.OutGridView.Models.csproj index a77f3c0..8b1e036 100644 --- a/src/Microsoft.PowerShell.OutGridView.Models/Microsoft.PowerShell.OutGridView.Models.csproj +++ b/src/Microsoft.PowerShell.OutGridView.Models/Microsoft.PowerShell.OutGridView.Models.csproj @@ -4,6 +4,6 @@ net6.0 - + - + \ No newline at end of file From c8f581fd8433543236a857c1eeba02a9bef743f8 Mon Sep 17 00:00:00 2001 From: Andy Jordan <2226434+andyleejordan@users.noreply.github.com> Date: Fri, 31 Jan 2025 14:10:13 -0800 Subject: [PATCH 3/5] Bump to PowerShell 7.4 and .NET 8.0 due to end-of-support --- Directory.Packages.props | 2 +- global.json | 2 +- .../Microsoft.PowerShell.ConsoleGuiTools.csproj | 4 ++-- .../Microsoft.PowerShell.OutGridView.Models.csproj | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index ed171a5..be0590b 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,6 +1,6 @@ - + diff --git a/global.json b/global.json index b6023e0..19e4d7e 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "6.0.425", + "version": "8.0.405", "rollForward": "latestFeature", "allowPrerelease": false } diff --git a/src/Microsoft.PowerShell.ConsoleGuiTools/Microsoft.PowerShell.ConsoleGuiTools.csproj b/src/Microsoft.PowerShell.ConsoleGuiTools/Microsoft.PowerShell.ConsoleGuiTools.csproj index 6fbb71e..ed25247 100644 --- a/src/Microsoft.PowerShell.ConsoleGuiTools/Microsoft.PowerShell.ConsoleGuiTools.csproj +++ b/src/Microsoft.PowerShell.ConsoleGuiTools/Microsoft.PowerShell.ConsoleGuiTools.csproj @@ -1,7 +1,7 @@ - net6.0 + net8.0 @@ -33,4 +33,4 @@ true Recommended - \ No newline at end of file + diff --git a/src/Microsoft.PowerShell.OutGridView.Models/Microsoft.PowerShell.OutGridView.Models.csproj b/src/Microsoft.PowerShell.OutGridView.Models/Microsoft.PowerShell.OutGridView.Models.csproj index 8b1e036..a4f10f5 100644 --- a/src/Microsoft.PowerShell.OutGridView.Models/Microsoft.PowerShell.OutGridView.Models.csproj +++ b/src/Microsoft.PowerShell.OutGridView.Models/Microsoft.PowerShell.OutGridView.Models.csproj @@ -1,9 +1,9 @@ - net6.0 + net8.0 - \ No newline at end of file + From 1ce24ad6b1b72e12bc03975e5e5e850d4d4c4271 Mon Sep 17 00:00:00 2001 From: Andy Jordan <2226434+andyleejordan@users.noreply.github.com> Date: Fri, 31 Jan 2025 14:24:03 -0800 Subject: [PATCH 4/5] Allow release stage only on manual build --- .pipelines/ConsoleGuiTools-Official.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.pipelines/ConsoleGuiTools-Official.yml b/.pipelines/ConsoleGuiTools-Official.yml index 4f9edcf..6b7c557 100644 --- a/.pipelines/ConsoleGuiTools-Official.yml +++ b/.pipelines/ConsoleGuiTools-Official.yml @@ -8,7 +8,8 @@ # Support: https://aka.ms/onebranchsup # ################################################################################# -trigger: none +trigger: +- main schedules: - cron: '50 19 * * 3' @@ -119,7 +120,7 @@ extends: files_to_sign: "*.nupkg" - stage: release dependsOn: build - condition: ne(variables['Build.Reason'], 'Schedule') + condition: eq(variables['Build.Reason'], 'Manual') variables: version: $[ stageDependencies.build.main.outputs['package.version'] ] drop: $(Pipeline.Workspace)/drop_build_main From 1bbe93a06805bc0d8f755c45fbbdd31d9c1c34ae Mon Sep 17 00:00:00 2001 From: Andy Jordan <2226434+andyleejordan@users.noreply.github.com> Date: Wed, 26 Feb 2025 14:27:06 -0800 Subject: [PATCH 5/5] Remove workaround for PowerShell <7.4 in OneBranch --- .pipelines/ConsoleGuiTools-Official.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.pipelines/ConsoleGuiTools-Official.yml b/.pipelines/ConsoleGuiTools-Official.yml index 6b7c557..f2861d4 100644 --- a/.pipelines/ConsoleGuiTools-Official.yml +++ b/.pipelines/ConsoleGuiTools-Official.yml @@ -77,10 +77,7 @@ extends: inputs: packageType: sdk useGlobalJson: true - - pwsh: | - Register-PSRepository -Name CFS -SourceLocation "https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/powershell/nuget/v2" -InstallationPolicy Trusted - Install-Module -Repository CFS -Name Microsoft.PowerShell.PSResourceGet - ./tools/installPSResources.ps1 -PSRepository CFS + - pwsh: ./tools/installPSResources.ps1 -PSRepository CFS displayName: Install PSResources - pwsh: Invoke-Build -Configuration $(BuildConfiguration) displayName: Build