From e90b65b2ee52568758a2345787dde9cfc1dd8899 Mon Sep 17 00:00:00 2001 From: OneBranch Resources Date: Wed, 13 Mar 2024 18:08:31 +0000 Subject: [PATCH 1/9] Adding OneBranch pipeline YAML config file for GraphicalTools-Official --- .config/tsaoptions.json | 8 + .pipelines/GraphicalTools-Official.yml | 144 ++++++++++ GraphicalTools.build.ps1 | 89 +----- NuGet.config | 13 +- global.json | 8 +- tools/azurePipelinesBuild.ps1 | 12 - tools/installPSResources.ps1 | 13 + tools/terms/FileTypeSet.xml | 379 ------------------------- tools/terms/UserExclusions.xml | 12 - 9 files changed, 188 insertions(+), 490 deletions(-) create mode 100644 .config/tsaoptions.json create mode 100644 .pipelines/GraphicalTools-Official.yml delete mode 100644 tools/azurePipelinesBuild.ps1 create mode 100644 tools/installPSResources.ps1 delete mode 100644 tools/terms/FileTypeSet.xml delete mode 100644 tools/terms/UserExclusions.xml diff --git a/.config/tsaoptions.json b/.config/tsaoptions.json new file mode 100644 index 0000000..c410423 --- /dev/null +++ b/.config/tsaoptions.json @@ -0,0 +1,8 @@ +{ + "instanceUrl": "https://msazure.visualstudio.com", + "projectName": "One", + "areaPath": "One\\MGMT\\Compute\\Powershell\\Powershell", + "notificationAliases": [ "andschwa@microsoft.com", "slee@microsoft.com" ], + "codebaseName": "PowerShell_GraphicalTools_20240404", + "tools": [ "CredScan", "PoliCheck", "BinSkim" ] +} diff --git a/.pipelines/GraphicalTools-Official.yml b/.pipelines/GraphicalTools-Official.yml new file mode 100644 index 0000000..914d008 --- /dev/null +++ b/.pipelines/GraphicalTools-Official.yml @@ -0,0 +1,144 @@ +################################################################################# +# OneBranch Pipelines # +# This pipeline was created by EasyStart from a sample located at: # +# https://aka.ms/obpipelines/easystart/samples # +# Documentation: https://aka.ms/obpipelines # +# Yaml Schema: https://aka.ms/obpipelines/yaml/schema # +# Retail Tasks: https://aka.ms/obpipelines/tasks # +# Support: https://aka.ms/onebranchsup # +################################################################################# + +trigger: none + +parameters: +- name: debug + displayName: Enable debug output + type: boolean + default: false + +variables: + system.debug: ${{ parameters.debug }} + BuildConfiguration: Release + WindowsContainerImage: onebranch.azurecr.io/windows/ltsc2019/vse2022:latest + DOTNET_NOLOGO: true + DOTNET_CLI_TELEMETRY_OPTOUT: true + DOTNET_GENERATE_ASPNET_CERTIFICATE: false + +resources: + repositories: + - repository: templates + type: git + name: OneBranch.Pipelines/GovernedTemplates + ref: refs/heads/main + +extends: + # https://aka.ms/obpipelines/templates + template: v2/OneBranch.Official.CrossPlat.yml@templates + parameters: + globalSdl: # https://aka.ms/obpipelines/sdl + asyncSdl: + enabled: true + forStages: [build] + stages: + - stage: build + jobs: + - job: main + displayName: Build package + pool: + type: windows + variables: + ob_outputDirectory: $(Build.SourcesDirectory)/module + steps: + - pwsh: | + $data = Import-PowerShellDataFile -Path src/Microsoft.PowerShell.ConsoleGuiTools/Microsoft.PowerShell.ConsoleGuiTools.psd1 + Write-Output "##vso[task.setvariable variable=version;isOutput=true]$($data.ModuleVersion)" + name: package + displayName: Get version from project properties + - task: onebranch.pipeline.version@1 + displayName: Set OneBranch version + inputs: + system: Custom + customVersion: $(package.version) + - task: UseDotNet@2 + displayName: Use .NET 6.x SDK + inputs: + packageType: sdk + version: 6.x + - task: PowerShell@2 + displayName: Install PSResources + inputs: + pwsh: true + filePath: tools/installPSResources.ps1 + - pwsh: Invoke-Build -Configuration $(BuildConfiguration) + displayName: Build + - task: onebranch.pipeline.signing@1 + displayName: Sign 1st-party files + inputs: + command: sign + signing_environment: external_distribution + search_root: $(Build.SourcesDirectory)/module + files_to_sign: | + **/*.psd1; + **/Microsoft.PowerShell.*.dll; + - task: onebranch.pipeline.signing@1 + displayName: Sign 3rd-party files + inputs: + command: sign + signing_environment: 135020002 + search_root: $(Build.SourcesDirectory)/module + files_to_sign: | + **/NStack.dll; + **/Terminal.Gui.dll; + - stage: release + dependsOn: build + variables: + version: $[ stageDependencies.build.main.outputs['package.version'] ] + drop: $(Pipeline.Workspace)/drop_build_main + jobs: + - job: github + displayName: Publish draft to GitHub + pool: + type: windows + variables: + ob_outputDirectory: $(Build.SourcesDirectory)/out + steps: + - download: current + displayName: Download artifacts + - task: ArchiveFiles@2 + displayName: Zip signed artifacts + inputs: + rootFolderOrFile: $(drop) + includeRootFolder: false + archiveType: zip + archiveFile: out/GraphicalTools.zip + - task: GitHubRelease@1 + displayName: Create GitHub release + inputs: + gitHubConnection: GitHub + repositoryName: PowerShell/GraphicalTools + assets: out/GraphicalTools.zip + tagSource: userSpecifiedTag + tag: v$(version) + isDraft: true + addChangeLog: false + releaseNotesSource: inline + releaseNotesInline: "" + - job: validation + displayName: Manual validation + pool: + type: agentless + timeoutInMinutes: 1440 + steps: + - task: ManualValidation@0 + displayName: Wait 24 hours for validation + inputs: + notifyUsers: $(Build.RequestedForEmail) + instructions: Please validate the release and then publish it! + timeoutInMinutes: 1440 + - pwsh: | + Set-PSRepository -Name PSGallery -InstallationPolicy Trusted + Install-Module -Name Microsoft.PowerShell.PSResourceGet -AllowPrerelease -Scope CurrentUser -Force + Import-Module -Name Microsoft.PowerShell.PSResourceGet -MinimumVersion 1.0.0 + Publish-PSResource -Path $(Pipeline.Workspace)/Publish/Microsoft.PowerShell.ConsoleGuiTools -Repository PSGallery -APIKey $(GalleryToken) -Verbose + dependsOn: validation + displayName: Publishing ConsoleGuiTools to PowerShell Gallery diff --git a/GraphicalTools.build.ps1 b/GraphicalTools.build.ps1 index cd3f276..f1c1546 100644 --- a/GraphicalTools.build.ps1 +++ b/GraphicalTools.build.ps1 @@ -6,81 +6,21 @@ param( [string[]]$ModuleName = @("Microsoft.PowerShell.ConsoleGuiTools" ) ) -$script:IsUnix = $PSVersionTable.PSEdition -and $PSVersionTable.PSEdition -eq "Core" -and !$IsWindows - $script:TargetFramework = "net6.0" -$script:RequiredSdkVersion = (Get-Content (Join-Path $PSScriptRoot 'global.json') | ConvertFrom-Json).sdk.version $script:ModuleLayouts = @{} foreach ($mn in $ModuleName) { $script:ModuleLayouts.$mn = Import-PowerShellDataFile -Path "$PSScriptRoot/src/$mn/ModuleLayout.psd1" } -task SetupDotNet -Before Clean, Build { - - $dotnetPath = "$PSScriptRoot/.dotnet" - $dotnetExePath = if ($script:IsUnix) { "$dotnetPath/dotnet" } else { "$dotnetPath/dotnet.exe" } - $originalDotNetExePath = $dotnetExePath - - if (!(Test-Path $dotnetExePath)) { - $installedDotnet = Get-Command dotnet -ErrorAction Ignore - if ($installedDotnet) { - $dotnetExePath = $installedDotnet.Source - } - else { - $dotnetExePath = $null - } - } - - # Make sure the dotnet we found is the right version - if ($dotnetExePath) { - # dotnet --version can write to stderr, which causes builds to abort, therefore use --list-sdks instead. - if ((& $dotnetExePath --list-sdks | ForEach-Object { $_.Split()[0] } ) -contains $script:RequiredSdkVersion) { - $script:dotnetExe = $dotnetExePath - } - else { - # Clear the path so that we invoke installation - $script:dotnetExe = $null - } - } - else { - # Clear the path so that we invoke installation - $script:dotnetExe = $null - } - - if ($script:dotnetExe -eq $null) { - - Write-Host "`n### Installing .NET CLI $script:RequiredSdkVersion...`n" -ForegroundColor Green +task FindDotNet -Before Clean, Build { + Assert (Get-Command dotnet -ErrorAction SilentlyContinue) "dotnet not found, please install it: https://aka.ms/dotnet-cli" - # The install script is platform-specific - $installScriptExt = if ($script:IsUnix) { "sh" } else { "ps1" } + # Strip out semantic version metadata so it can be cast to `Version` + [Version]$existingVersion, $null = (dotnet --version) -split " " -split "-" + Assert ($existingVersion -ge [Version]("6.0")) ".NET SDK 6.0 or higher is required, please update it: https://aka.ms/dotnet-cli" - # Download the official installation script and run it - $installScriptPath = "$([System.IO.Path]::GetTempPath())dotnet-install.$installScriptExt" - Invoke-WebRequest "https://dot.net/v1/dotnet-install.$installScriptExt" -OutFile $installScriptPath - $env:DOTNET_INSTALL_DIR = "$PSScriptRoot/.dotnet" - - if (!$script:IsUnix) { - & $installScriptPath -Version $script:RequiredSdkVersion -InstallDir "$env:DOTNET_INSTALL_DIR" - } - else { - & /bin/bash $installScriptPath -Version $script:RequiredSdkVersion -InstallDir "$env:DOTNET_INSTALL_DIR" - $env:PATH = $dotnetExeDir + [System.IO.Path]::PathSeparator + $env:PATH - } - - Write-Host "`n### Installation complete." -ForegroundColor Green - $script:dotnetExe = $originalDotnetExePath - } - - # This variable is used internally by 'dotnet' to know where it's installed - $script:dotnetExe = Resolve-Path $script:dotnetExe - if (!$env:DOTNET_INSTALL_DIR) { - $dotnetExeDir = [System.IO.Path]::GetDirectoryName($script:dotnetExe) - $env:PATH = $dotnetExeDir + [System.IO.Path]::PathSeparator + $env:PATH - $env:DOTNET_INSTALL_DIR = $dotnetExeDir - } - - Write-Host "`n### Using dotnet v$(& $script:dotnetExe --version) at path $script:dotnetExe`n" -ForegroundColor Green + Write-Host "Using dotnet v$(dotnet --version) at path $((Get-Command dotnet).Source)" -ForegroundColor Green } task Build { @@ -88,7 +28,7 @@ task Build { foreach ($moduleLayout in $script:ModuleLayouts.Values) { foreach ($projName in $moduleLayout.RequiredBuildAssets.Keys) { - exec { & $script:dotnetExe publish -c $Configuration "$PSScriptRoot/src/$projName/$projName.csproj" } + exec { & dotnet publish -c $Configuration "$PSScriptRoot/src/$projName/$projName.csproj" } } foreach ($nativeProj in $moduleLayout.NativeBuildAssets.Keys) { @@ -99,29 +39,24 @@ task Build { else { "/property:IsWindows=false" } - exec { & $script:dotnetExe publish -c $Configuration "$PSScriptRoot/src/$nativeProj/$nativeProj.csproj" -r $targetPlatform $buildPropertyParams } + exec { & dotnet publish -c $Configuration "$PSScriptRoot/src/$nativeProj/$nativeProj.csproj" -r $targetPlatform $buildPropertyParams } } } } } task Clean { - #Remove Module Build - Remove-Item $PSScriptRoot/module -Recurse -Force -ErrorAction Ignore + Remove-BuildItem $PSScriptRoot/module foreach ($moduleLayout in $script:ModuleLayouts.Values) { foreach ($projName in $moduleLayout.RequiredBuildAssets.Keys) { - exec { & $script:dotnetExe clean -c $Configuration "$PSScriptRoot/src/$projName/$projName.csproj" } + exec { & dotnet clean -c $Configuration "$PSScriptRoot/src/$projName/$projName.csproj" } } foreach ($projName in $moduleLayout.NativeBuildAssets.Keys) { - exec { & $script:dotnetExe clean -c $Configuration "$PSScriptRoot/src/$projName/$projName.csproj" } + exec { & dotnet clean -c $Configuration "$PSScriptRoot/src/$projName/$projName.csproj" } } } - - foreach ($mn in $ModuleName) { - Get-ChildItem "$PSScriptRoot\module\$mn\Commands\en-US\*-help.xml" -ErrorAction Ignore | Remove-Item -Force - } } task LayoutModule -After Build { @@ -132,7 +67,7 @@ task LayoutModule -After Build { # Create the destination dir $null = New-Item -Force $moduleBinPath -Type Directory - # For each PSES subproject + # For each subproject foreach ($projectName in $moduleLayout.RequiredBuildAssets.Keys) { # Get the project build dir path $basePath = [System.IO.Path]::Combine($PSScriptRoot, 'src', $projectName, 'bin', $Configuration, $script:TargetFramework) diff --git a/NuGet.config b/NuGet.config index 16746d6..f04dcd5 100644 --- a/NuGet.config +++ b/NuGet.config @@ -1,10 +1,7 @@ - + - - - - - - - + + + + diff --git a/global.json b/global.json index 95b7585..ff40deb 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,9 @@ { "sdk": { - "version": "6.0.416" + "version": "6.0.420", + "rollForward": "latestFeature", + "allowPrerelease": false } -} + } + + \ No newline at end of file diff --git a/tools/azurePipelinesBuild.ps1 b/tools/azurePipelinesBuild.ps1 deleted file mode 100644 index 788e64f..0000000 --- a/tools/azurePipelinesBuild.ps1 +++ /dev/null @@ -1,12 +0,0 @@ -Push-Location (Join-Path $PSScriptRoot ..) - -if (!(Get-Module -ListAvailable InvokeBuild)) { - Install-Module InvokeBuild -Force -Scope CurrentUser -} - -if (!(Get-Module -ListAvailable PlatyPS)) { - Install-Module PlatyPS -Force -Scope CurrentUser -} - -Invoke-Build -Configuration Release -Pop-Location diff --git a/tools/installPSResources.ps1 b/tools/installPSResources.ps1 new file mode 100644 index 0000000..a7b4b04 --- /dev/null +++ b/tools/installPSResources.ps1 @@ -0,0 +1,13 @@ +# 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 diff --git a/tools/terms/FileTypeSet.xml b/tools/terms/FileTypeSet.xml deleted file mode 100644 index 82f9f4d..0000000 --- a/tools/terms/FileTypeSet.xml +++ /dev/null @@ -1,379 +0,0 @@ - - - - - Pure Text Files - - .txt - .des - .pwd - .asm - .cmd - .ini - .poc - .pwt - .hpj - .sql - .inf - .log - .def - .url - .bat - .aspx - .idl - .sys - .resources - .strings - .md - .yml - .yaml - .spelling - .gitignore - .gitattributes - .gitmodules - .csv - .tsv - - - - CodeFiles - - .frm - .inc - .cpp - .cls - .c - .hpp - .vbs - .java - .cs - .cxx - .h - .jav - .bas - .hxx - .js - .pl - .rc - .vb - .json - .resjson - .fs - .fsi - .fsx - .m - .psm1 - .config - .ps1 - .psd1 - .cmake - .sh - .cshtml - .plist - .mof - .mc - - - - XML Files - - .xml - .hxa - .hxk - .hxl - .xsl - .hxc - .hxt - .hxm - .resx - .hxe - .hxf - .hxv - .acctb - .accfl - .xaml - .ttml - .ddue - .sln - .props - .ps1xml - .csproj - .xsd - .svg - .clixml - .nuspec - .cdxml - .manifest - - - - Microsoft Word Documents - - .doc - .dot - .wiz - - - - Microsoft Access Database Compatible - - .mdb - .mda - .mde - .mpd - .mdt - - - - Microsoft PowerPoint Presentation - - .ppt - .pot - .pps - - - - Microsoft Publisher Files - - .pub - - - - Microsoft Excel Workbooks - - .xls - .xlt - - - - Pure Binary Files - - .com - .bin - .tlb - .drv - .fon - .blg - .gif - .png - .icns - .ico - .bmp - .pfx - - - - Localization resource databases - - .edb - .lcl - .xlf - .xliff - - - - Microsoft Project Files - - .mpp - .mpt - - - - Microsoft Visio Files - - .vsd - .vdx - .vss - .vst - - - - Windows Installer databases - - .msi - .msm - - - - Zip Files - - .zip - .accdt - .axtr - - - - Cabinet / MS Compression Files - - .cab - - - - Table driven IME lexicons - - .mb - - - - IME ( IMD ) Files - - .imd - - - - TrueType Font Files - - .ttf - - - - Microsoft Outlook Mail Files - - .msg - .oft - - - - HTML Help 2.0 Files / InfoTech5.x Storage System Files - - .its - .hxh - .hxr - .hxw - .hxi - .hxs - .hxq - - - - Adobe Acrobat PDF Files - - .pdf - - - - HTML Files / Web Page - - .htm - .dtd - .hhk - .htw - .asp - .htc - .htx - .html - .hhc - .css - .stm - - - - Rich Text Files - - .rtf - - - - Windows 3.x Write Files - - .wri - - - - MHTML Files - - .eml - .nws - .mht - - - - Word 2007 Files - - .docx - .docm - .dotx - .dotm - - - - Excel 2007 Files - - .xlsx - .xlsm - .xltx - .xltm - .xlsb - .xlam - - - - Power Point 2007 Files - - .pptx - .pptm - .potx - .potm - .ppsx - .ppsm - .ppam - - - - Access 2007 Files - - .accdb - .accde - .accdr - - - - Win32/64-based executable (image) Files - - .exe - .dll - .ocx - .scr - .acm - .rll - .cpl - .mui - .ax - .ime - - - - HTML Help 1.0 Files - - .chm - - - - LocStudio lsg - - .lsg - - - - Microsoft Office OneNote Files - - .one - .onepkg - - - - Custom Parsers - - - - - Visio 2011 Files - - .vstx - .vsdx - .vssx - - - - - diff --git a/tools/terms/UserExclusions.xml b/tools/terms/UserExclusions.xml deleted file mode 100644 index f7ff9f7..0000000 --- a/tools/terms/UserExclusions.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - .GIT - - - - - - - From b766e7dd5cfc4e3d2ba9459446f01c4edae7817e Mon Sep 17 00:00:00 2001 From: Andy Jordan <2226434+andyleejordan@users.noreply.github.com> Date: Tue, 23 Apr 2024 16:53:46 -0700 Subject: [PATCH 2/9] Officially rename to `ConsoleGuiTools` Retiring the name of the deprecated module `GraphicalTools`. --- .config/tsaoptions.json | 2 +- ...icial.yml => ConsoleGuiTools-Official.yml} | 6 +- ConsoleGuiTools.Common.props | 10 ++ ...ols.build.ps1 => ConsoleGuiTools.build.ps1 | 0 GraphicalTools.Common.props | 11 -- LICENSE.txt | 2 +- README.md | 12 +- .../Out-GridView.md | 4 +- ...icrosoft.PowerShell.ConsoleGuiTools.csproj | 2 +- .../Microsoft.PowerShell.ConsoleGuiTools.psd1 | 115 +----------------- ...osoft.PowerShell.OutGridView.Models.csproj | 2 +- 11 files changed, 30 insertions(+), 136 deletions(-) rename .pipelines/{GraphicalTools-Official.yml => ConsoleGuiTools-Official.yml} (97%) create mode 100644 ConsoleGuiTools.Common.props rename GraphicalTools.build.ps1 => ConsoleGuiTools.build.ps1 (100%) delete mode 100644 GraphicalTools.Common.props diff --git a/.config/tsaoptions.json b/.config/tsaoptions.json index c410423..aeacdcb 100644 --- a/.config/tsaoptions.json +++ b/.config/tsaoptions.json @@ -3,6 +3,6 @@ "projectName": "One", "areaPath": "One\\MGMT\\Compute\\Powershell\\Powershell", "notificationAliases": [ "andschwa@microsoft.com", "slee@microsoft.com" ], - "codebaseName": "PowerShell_GraphicalTools_20240404", + "codebaseName": "PowerShell_ConsoleGuiTools_20240404", "tools": [ "CredScan", "PoliCheck", "BinSkim" ] } diff --git a/.pipelines/GraphicalTools-Official.yml b/.pipelines/ConsoleGuiTools-Official.yml similarity index 97% rename from .pipelines/GraphicalTools-Official.yml rename to .pipelines/ConsoleGuiTools-Official.yml index 914d008..79f00c0 100644 --- a/.pipelines/GraphicalTools-Official.yml +++ b/.pipelines/ConsoleGuiTools-Official.yml @@ -110,13 +110,13 @@ extends: rootFolderOrFile: $(drop) includeRootFolder: false archiveType: zip - archiveFile: out/GraphicalTools.zip + archiveFile: out/ConsoleGuiTools.zip - task: GitHubRelease@1 displayName: Create GitHub release inputs: gitHubConnection: GitHub - repositoryName: PowerShell/GraphicalTools - assets: out/GraphicalTools.zip + repositoryName: PowerShell/ConsoleGuiTools + assets: out/ConsoleGuiTools.zip tagSource: userSpecifiedTag tag: v$(version) isDraft: true diff --git a/ConsoleGuiTools.Common.props b/ConsoleGuiTools.Common.props new file mode 100644 index 0000000..ddb7958 --- /dev/null +++ b/ConsoleGuiTools.Common.props @@ -0,0 +1,10 @@ + + + Microsoft + © Microsoft Corporation. + latest + https://github.com/PowerShell/ConsoleGuiTools/blob/main/LICENSE.txt + git + https://github.com/PowerShell/ConsoleGuiTools + + diff --git a/GraphicalTools.build.ps1 b/ConsoleGuiTools.build.ps1 similarity index 100% rename from GraphicalTools.build.ps1 rename to ConsoleGuiTools.build.ps1 diff --git a/GraphicalTools.Common.props b/GraphicalTools.Common.props deleted file mode 100644 index 2976d35..0000000 --- a/GraphicalTools.Common.props +++ /dev/null @@ -1,11 +0,0 @@ - - - true - true - - - - - full - - diff --git a/LICENSE.txt b/LICENSE.txt index c5f79b7..84f9b36 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2019 PowerShell Team +Copyright (c) 2024 PowerShell Team Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index b9e8220..fc2ad43 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This repo contains the `Out-ConsoleGridView` PowerShell Cmdlet providing console-based GUI experiences based on [Terminal.Gui (gui.cs)](https://github.com/gui-cs/Terminal.Gui). -_Note:_ A module named `Microsoft.PowerShell.GraphicalTools` used to be built and published out of this repo, but per [#101](https://github.com/PowerShell/GraphicalTools/issues/101) it is deprecated and unmaintained until such time that it can be rewritten on top of [.NET MAUI](https://devblogs.microsoft.com/dotnet/introducing-net-multi-platform-app-ui/). +_Note:_ A module named `Microsoft.PowerShell.GraphicalTools` used to be built and published out of this repo, but per [#101](https://github.com/PowerShell/ConsoleGuiTools/issues/101) it is deprecated and unmaintained until such time that it can be rewritten on top of [.NET MAUI](https://devblogs.microsoft.com/dotnet/introducing-net-multi-platform-app-ui/). ## Installation @@ -149,7 +149,7 @@ Install PowerShell 7.2+ with [these instructions](https://github.com/PowerShell/ ### 2. Clone the GitHub repository ```powershell -git clone https://github.com/PowerShell/GraphicalTools.git +git clone https://github.com/PowerShell/ConsoleGuiTools.git ``` ### 3. Install [Invoke-Build](https://github.com/nightroman/Invoke-Build) @@ -163,7 +163,7 @@ Now you're ready to build the code. You can do so in one of two ways: ### 4. Building the code from PowerShell ```powershell -pushd ./GraphicalTools +pushd ./ConsoleGuiTools Invoke-Build Build -ModuleName Microsoft.PowerShell.ConsoleGuiTools popd ``` @@ -188,7 +188,7 @@ exit ### 5. Debugging in Visual Studio Code ```powershell -code ./GraphicalTools +code ./ConsoleGuiTools ``` Build by hitting `Ctrl-Shift-B` in VS Code. @@ -207,7 +207,7 @@ Your breakpoint should be hit. We would love to incorporate community contributions into this project. If you would like to contribute code, documentation, tests, or bug reports, -please read the [development section above](https://github.com/PowerShell/GraphicalTools#development) +please read the [development section above](https://github.com/PowerShell/ConsoleGuiTools#development) to learn more. ## Microsoft.PowerShell.ConsoleGuiTools Architecture @@ -237,4 +237,4 @@ For more information see the [Code of Conduct FAQ][conduct-FAQ] or contact [open [conduct-code]: https://opensource.microsoft.com/codeofconduct/ [conduct-FAQ]: https://opensource.microsoft.com/codeofconduct/faq/ [conduct-email]: mailto:opencode@microsoft.com -[conduct-md]: https://github.com/PowerShell/GraphicalTools/tree/master/CODE_OF_CONDUCT.md +[conduct-md]: https://github.com/PowerShell/ConsoleGuiTools/tree/master/CODE_OF_CONDUCT.md diff --git a/docs/Microsoft.PowerShell.GraphicalTools/Out-GridView.md b/docs/Microsoft.PowerShell.GraphicalTools/Out-GridView.md index c99a15d..358ec6a 100644 --- a/docs/Microsoft.PowerShell.GraphicalTools/Out-GridView.md +++ b/docs/Microsoft.PowerShell.GraphicalTools/Out-GridView.md @@ -1,8 +1,8 @@ --- -external help file: GraphicalToolsModule.dll-Help.xml +external help file: ConsoleGuiToolsModule.dll-Help.xml keywords: powershell,cmdlet locale: en-us -Module Name: GraphicalTools +Module Name: ConsoleGuiTools ms.date: 08/09/2019 schema: 2.0.0 title: Out-GridView diff --git a/src/Microsoft.PowerShell.ConsoleGuiTools/Microsoft.PowerShell.ConsoleGuiTools.csproj b/src/Microsoft.PowerShell.ConsoleGuiTools/Microsoft.PowerShell.ConsoleGuiTools.csproj index 27f2d44..293b2d0 100644 --- a/src/Microsoft.PowerShell.ConsoleGuiTools/Microsoft.PowerShell.ConsoleGuiTools.csproj +++ b/src/Microsoft.PowerShell.ConsoleGuiTools/Microsoft.PowerShell.ConsoleGuiTools.csproj @@ -1,5 +1,5 @@ - + net6.0 diff --git a/src/Microsoft.PowerShell.ConsoleGuiTools/Microsoft.PowerShell.ConsoleGuiTools.psd1 b/src/Microsoft.PowerShell.ConsoleGuiTools/Microsoft.PowerShell.ConsoleGuiTools.psd1 index d03f53f..ded1157 100644 --- a/src/Microsoft.PowerShell.ConsoleGuiTools/Microsoft.PowerShell.ConsoleGuiTools.psd1 +++ b/src/Microsoft.PowerShell.ConsoleGuiTools/Microsoft.PowerShell.ConsoleGuiTools.psd1 @@ -9,8 +9,7 @@ RootModule = 'Microsoft.PowerShell.ConsoleGuiTools.dll' # Version number of this module. -# NOTE: This will get updated by build.ps1; the build number will be incremented for each build. -ModuleVersion = '0.7.6.1' +ModuleVersion = '0.7.6' # Supported PSEditions CompatiblePSEditions = @( 'Core' ) @@ -28,7 +27,7 @@ CompanyName = 'Microsoft' Copyright = '(c) Microsoft Corporation.' # Description of the functionality provided by this module -Description = 'Cross-platform Console Gui Tools for PowerShell' +Description = 'Cross-platform Console GUI Tools for PowerShell' # Minimum version of the PowerShell engine required by this module PowerShellVersion = '7.2' @@ -96,120 +95,16 @@ PrivateData = @{ Tags = @('Console', 'Gui', 'Out-GridView', 'Out-ConsoleGridView', 'Show-ObjectTree', 'Terminal.Gui', 'gui.cs', 'MacOS', 'Windows', 'Linux', 'PSEdition_Core') # A URL to the license for this module. - LicenseUri = 'https://github.com/PowerShell/GraphicalTools/blob/master/LICENSE.txt' + LicenseUri = 'https://github.com/PowerShell/ConsoleGuiTools/blob/master/LICENSE.txt' # A URL to the main website for this project. - ProjectUri = 'https://github.com/PowerShell/GraphicalTools/' + ProjectUri = 'https://github.com/PowerShell/ConsoleGuiTools/' # A URL to an icon representing this module. # IconUri = '' # ReleaseNotes of this module - ReleaseNotes = '# Release Notes -## v0.7.6 - -* Fix child expand #223 - -## v0.7.5 - -* Adds Show-ObjectTree cmdlet #179 -* Fix clear last line on Windows Terminal Issue again #207 -* Adds support for -Diagnostic switch to Out-ConsoleGridView #208 -* Adds support for -UseNetDriver switch to Out-ConsoleGridView #208 - -## v0.7.4 - -* Fixes last line not cleared on exit in WT by updating to Terminal.Gui v1.13.5 #205 - -## v0.7.3 - -* Build updates and compliant release pipeline #168 -* Updates ConsoleGuiTools to Terminal.Gui v1.10 #184 -* Fixes #175. Column headers misaligned #185 -* Fixes# 148. Move to next row on select #187 -* Fixes #174. Changing Filter does not undo previously marked items #186 -* Marked are now at top; simplified code; fixed margin #188 -* Fixes #189 - Fixed typo in exception text. Added -verbose to launch.json #190 -* Fixes #195 - Incompatible with OpenSUS #196 -* Bump Newtonsoft.Json from 13.0.1 to 13.0.3 #198 -* Bump Newtonsoft.Json from 13.0.1 to 13.0.3 #200 -* Bump Microsoft.PowerShell.SDK from 7.2.6 to 7.2.13 #199 -* Bump Terminal.Gui from 1.13 to 1.13.4 #197 -* Remove PDB files from module #201 - -## v0.7.2 - -* Update Terminal.Gui to v1.7.1 #161 -* Filter edit chops off first char of filter string passed on command line #151 -* Color changes and terminal becomes unreadable #150 -If items are selected, then a filter is applied, items now hidden stay selected #121 -* Add UI for select-all/select-none #120 -* Add ability to minimize UI #116 -* Initial focus should be on the results (ListView) #87 -* Import-Module causes warning on PowerShell 7 RC3 #44 -* Runaway process on Ubuntu 20.4 displaying random characters upon exit. #139 -* PSAnsiRenderingFileInfo causes display issues with Out-ConsoleGridView #159 -* Removes building and distribution of Out-GridView and the other Avalonia-based components -* Remove ANSI escape sequences from property values #158 - -## v0.7.0 - -Upgraded to PowerShell 7.2 and .NET target framework `net60` - -Updated Terminal.Gui to 1.7 - -Fixed #131 - Strip ANSI - -## v0.6.3 - -Unreleased! - -## v0.6.2 - -Update Terminal.Gui to 1.0. - -Disable mouse mode to fix bug with mouse movement being printed to console. - -Gracefully fail when running in remote sessions. - -## v0.6.1 - -Fix off-by-one error with ellipsis so columns should be better aligned. - -## v0.6.0 - -Now supports `-Filter` parameter. - -Updated to use the final release of `Terminal.Gui` v0.90 (which is feature complete for 1.0). - -## v0.5.0 - -`Out-ConsoleGridView` has been totally refactored! - -First off, no more silly F9 menu to accept! -All you have to do is hit `ENTER` to accept your selection or `ESC` to cancel. - -Also, `-OutputMode` works as expected now. `Single` lets you only select one item. `Multiple` is the default. - -## v0.4.1 - -* Fix filter indexing to return correct selected objects - -## v0.4.0 - -* Regex filter -* Newlines rendering fix (Thanks @tig!) - -## v0.3.0 - -* Windows OS support (PS 6.2+) -* dynamic column widths -* Fix arrow key issue on non-Windows - -## v0.2.0 - -Initial Release -' + ReleaseNotes = 'Please see release notes at: https://github.com/PowerShell/ConsoleGuiTools/releases' # Prerelease string of this module # Prerelease = '' 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 5604e73..a77f3c0 100644 --- a/src/Microsoft.PowerShell.OutGridView.Models/Microsoft.PowerShell.OutGridView.Models.csproj +++ b/src/Microsoft.PowerShell.OutGridView.Models/Microsoft.PowerShell.OutGridView.Models.csproj @@ -1,5 +1,5 @@ - + net6.0 From 2da94880fd6feb853b0dc2c202dc182e3085e732 Mon Sep 17 00:00:00 2001 From: Andy Jordan <2226434+andyleejordan@users.noreply.github.com> Date: Tue, 30 Apr 2024 18:26:39 -0700 Subject: [PATCH 3/9] Rewrite and simplify build system --- .gitignore | 51 +-- Build.ps1 | 58 --- ConsoleGuiTools.build.ps1 | 127 ++----- .../Out-GridView.md | 346 ------------------ .../ModuleLayout.psd1 | 16 - tools/installPSResources.ps1 | 1 + 6 files changed, 39 insertions(+), 560 deletions(-) delete mode 100644 Build.ps1 delete mode 100644 docs/Microsoft.PowerShell.GraphicalTools/Out-GridView.md delete mode 100644 src/Microsoft.PowerShell.ConsoleGuiTools/ModuleLayout.psd1 diff --git a/.gitignore b/.gitignore index 995941e..80046ed 100644 --- a/.gitignore +++ b/.gitignore @@ -1,47 +1,6 @@ -*.swp -*.*~ -project.lock.json -.DS_Store -*.pyc -nupkg/ - -# Rider -.idea - -# User-specific files -*.suo -*.user -*.userosscache -*.sln.docstates - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -build/ -bld/ -[Bb]in/ -[Oo]bj/ -[Oo]ut/ -msbuild.log -msbuild.err -msbuild.wrn - -#Module build module/ - -# Visual Studio 2015 -.vs/ - -# ingore downloaded .NET -.dotnet - -# Ignore package -Microsoft.PowerShell.GraphicalTools.zip -Microsoft.PowerShell.ConsoleGuiTools.zip - -# git artifacts -*.orig \ No newline at end of file +out/ +bin/ +obj/ +publish/ +*.sln diff --git a/Build.ps1 b/Build.ps1 deleted file mode 100644 index 42b6507..0000000 --- a/Build.ps1 +++ /dev/null @@ -1,58 +0,0 @@ -# Build script for buildling/testing from the commnad line. See tasks.json for how build is invoked within VS Code -# GraphicalTools includes two modules: Microsoft.PowerShell.GraphicalTools and Microsoft.PowerShell.ConsoleGuiTools -# To build them all leave -ModuleName off the `InvokeBuild` command (e.g. Invoke-Build Build). -# To build only one, specify it using the -ModuleName paramater (e.g. Invoke-Build Build -ModuleName Microsoft.PowerShell.ConsoleGuiTools). -$ModuleName = "Microsoft.PowerShell.ConsoleGuiTools" -$BuildPath = "$PSScriptRoot/module/$ModuleName" -$PsdPath = "src/$ModuleName/$ModulePath/$($ModuleName).psd1" - -# Assume this is the first build -$build = 0 - -$psd1Content = Get-Content $PsdPath -Raw -ErrorAction SilentlyContinue -if ($psd1Content) { - # Extract the ModuleVersion from the .psd1 content using regular expression - if ($psd1Content -match "ModuleVersion\s+=\s+'(.*?)'") { - $prevVersion = $Matches[1] - $prevVersionParts = $prevVersion -split '\.' - $build = [int]$prevVersionParts[3] + 1 - $ModuleVersion = "{0}.{1}.{2}.{3}" -f $prevVersionParts[0], $prevVersionParts[1], $prevVersionParts[2], $build - } - else { - "No previous version found. Assuming this is the first build." - # Get the ModuleVersion using dotnet-gitversion - $prevVersion = "1.0.0.0" - $ModuleVersion = "$($prevVersion)" - } - "Rewriting $PsdPath with new ModuleVersion: $ModuleVersion" - $updatedpsd1Content = $psd1Content -replace "ModuleVersion\s+=\s+'([\d\.]+)'", "ModuleVersion = '$ModuleVersion'" - $updatedpsd1Content = $updatedpsd1Content.TrimEnd() - $updatedpsd1Content | Out-File -FilePath $PsdPath -Encoding ascii -} -else { - throw "$PsdPath not found." -} - -"Buildihg $ModuleName..." -Invoke-Build Build -ModuleName $ModuleName - -# Publish to a local PSRepository to enable downstream dependenies to use development builds -# - If `local` doesn't exist, create with `Register-PSRepository -Name local -SourceLocation "~/psrepo" -InstallationPolicy Trusted` -$localRepository = Get-PSRepository | Where-Object { $_.Name -eq 'local' } -if ($localRepository) { - $localRepositoryPath = $localRepository | Select-Object -ExpandProperty SourceLocation - # Un-publishing $ModuleName from local repository at $localRepositoryPath" - Remove-Item "${localRepositoryPath}/${ModuleName}.{$ModuleVersion}.nupkg" -Recurse -Force -ErrorAction SilentlyContinue - "Publishing ${localRepositoryPath}/${ModuleName}.$ModuleVersion.nupkg to `local'" - Publish-Module -Path $BuildPath -Repository 'local' -} - - -# Run what was built as a bit of test of: -# - Scale: recursive ls of the project -# - Filter: proving regex works -# - SelectMultiple -$testCommand = "Get-ChildItem -Recurse | Out-ConsoleGridView -Debug -OutputMode Multiple -Title 'Imported Modules' -Filter \.xml" -"Running test in new pwsh session: $testCommand" -pwsh -noprofile -command "Import-Module -verbose $BuildPath; $testCommand" -"Test exited. Build complete." diff --git a/ConsoleGuiTools.build.ps1 b/ConsoleGuiTools.build.ps1 index f1c1546..bf32421 100644 --- a/ConsoleGuiTools.build.ps1 +++ b/ConsoleGuiTools.build.ps1 @@ -1,111 +1,50 @@ param( [ValidateSet("Debug", "Release")] - [string]$Configuration = "Debug", - - [string[]]$ModuleName = @("Microsoft.PowerShell.ConsoleGuiTools" ) + [string]$Configuration = "Debug" ) -$script:TargetFramework = "net6.0" - -$script:ModuleLayouts = @{} -foreach ($mn in $ModuleName) { - $script:ModuleLayouts.$mn = Import-PowerShellDataFile -Path "$PSScriptRoot/src/$mn/ModuleLayout.psd1" -} - task FindDotNet -Before Clean, Build { - Assert (Get-Command dotnet -ErrorAction SilentlyContinue) "dotnet not found, please install it: https://aka.ms/dotnet-cli" - - # Strip out semantic version metadata so it can be cast to `Version` - [Version]$existingVersion, $null = (dotnet --version) -split " " -split "-" - Assert ($existingVersion -ge [Version]("6.0")) ".NET SDK 6.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 Build { - Remove-Item $PSScriptRoot/module -Recurse -Force -ErrorAction Ignore - - foreach ($moduleLayout in $script:ModuleLayouts.Values) { - foreach ($projName in $moduleLayout.RequiredBuildAssets.Keys) { - exec { & dotnet publish -c $Configuration "$PSScriptRoot/src/$projName/$projName.csproj" } - } - - foreach ($nativeProj in $moduleLayout.NativeBuildAssets.Keys) { - foreach ($targetPlatform in $moduleLayout.NativeBuildAssets[$nativeProj]) { - $buildPropertyParams = if ($targetPlatform -eq "win-x64") { - "/property:IsWindows=true" - } - else { - "/property:IsWindows=false" - } - exec { & dotnet publish -c $Configuration "$PSScriptRoot/src/$nativeProj/$nativeProj.csproj" -r $targetPlatform $buildPropertyParams } - } - } - } + Assert (Get-Command dotnet -ErrorAction SilentlyContinue) "The dotnet CLI was not found, please install it: https://aka.ms/dotnet-cli" + $DotnetVersion = dotnet --version + Assert ($?) "The required .NET SDK was not found, please install it: https://aka.ms/dotnet-cli" + Write-Host "Using dotnet $DotnetVersion at path $((Get-Command dotnet).Source)" -ForegroundColor Green } task Clean { - Remove-BuildItem $PSScriptRoot/module - - foreach ($moduleLayout in $script:ModuleLayouts.Values) { - foreach ($projName in $moduleLayout.RequiredBuildAssets.Keys) { - exec { & dotnet clean -c $Configuration "$PSScriptRoot/src/$projName/$projName.csproj" } - } - - foreach ($projName in $moduleLayout.NativeBuildAssets.Keys) { - exec { & dotnet clean -c $Configuration "$PSScriptRoot/src/$projName/$projName.csproj" } - } - } + Remove-BuildItem ./module, ./out + Push-Location src/Microsoft.PowerShell.ConsoleGuiTools + Invoke-BuildExec { & dotnet clean } + Pop-Location } -task LayoutModule -After Build { - foreach ($mn in $ModuleName) { - $moduleLayout = $script:ModuleLayouts[$mn] - $moduleBinPath = "$PSScriptRoot/module/$mn/" - - # Create the destination dir - $null = New-Item -Force $moduleBinPath -Type Directory - - # For each subproject - foreach ($projectName in $moduleLayout.RequiredBuildAssets.Keys) { - # Get the project build dir path - $basePath = [System.IO.Path]::Combine($PSScriptRoot, 'src', $projectName, 'bin', $Configuration, $script:TargetFramework) - - # For each asset in the subproject - foreach ($bin in $moduleLayout.RequiredBuildAssets[$projectName]) { - # Get the asset path - $binPath = Join-Path $basePath $bin - - # Binplace the asset - Copy-Item -Force -Verbose $binPath $moduleBinPath - } - } - - foreach ($projectName in $moduleLayout.NativeBuildAssets.Keys) { - foreach ($targetPlatform in $moduleLayout.NativeBuildAssets[$projectName]) { - $destDir = Join-Path $moduleBinPath $projectName $targetPlatform - - $null = New-Item -Force $destDir -Type Directory - - # Get the project build dir path - $publishPath = [System.IO.Path]::Combine($PSScriptRoot, 'src', $projectName, 'bin', $Configuration, $script:TargetFramework, $targetPlatform, "publish\*" ) - - Write-Host $publishPath - # Binplace the asset - Copy-Item -Recurse -Force $publishPath $destDir - } - } - - Copy-Item -Force "$PSScriptRoot/README.md" $moduleBinPath - Copy-Item -Force "$PSScriptRoot/LICENSE.txt" $moduleBinPath +task Build { + New-Item -ItemType Directory -Force ./module | Out-Null + + Push-Location src/Microsoft.PowerShell.ConsoleGuiTools + Invoke-BuildExec { & dotnet publish --configuration $Configuration --output publish } + $Assets = $( + "../../README.md", + "../../LICENSE.txt", + "./publish/Microsoft.PowerShell.ConsoleGuiTools.dll", + "./publish/Microsoft.PowerShell.ConsoleGuiTools.psd1", + "./publish/Microsoft.PowerShell.OutGridView.Models.dll", + "./publish/Terminal.Gui.dll", + "./publish/NStack.dll") + $Assets | ForEach-Object { + Copy-Item -Force -Path $_ -Destination ../../module } + Pop-Location + + New-ExternalHelp -Path docs/Microsoft.PowerShell.ConsoleGuiTools -OutputPath module/en-US -Force } -task BuildCmdletHelp { - foreach ($mn in $ModuleName) { - New-ExternalHelp -Path "$PSScriptRoot/docs/$mn" -OutputPath "$PSScriptRoot/module/$mn/en-US" -Force +task Package { + New-Item -ItemType Directory -Force ./out | Out-Null + if (-Not (Get-PSResourceRepository -Name ConsoleGuiTools -ErrorAction SilentlyContinue)) { + Register-PSResourceRepository -Name ConsoleGuiTools -Uri ./out } + Publish-PSResource -Path ./module -Repository ConsoleGuiTools -Verbose } -task . Clean, Build, BuildCmdletHelp +task . Clean, Build diff --git a/docs/Microsoft.PowerShell.GraphicalTools/Out-GridView.md b/docs/Microsoft.PowerShell.GraphicalTools/Out-GridView.md deleted file mode 100644 index 358ec6a..0000000 --- a/docs/Microsoft.PowerShell.GraphicalTools/Out-GridView.md +++ /dev/null @@ -1,346 +0,0 @@ ---- -external help file: ConsoleGuiToolsModule.dll-Help.xml -keywords: powershell,cmdlet -locale: en-us -Module Name: ConsoleGuiTools -ms.date: 08/09/2019 -schema: 2.0.0 -title: Out-GridView ---- - -# Out-GridView - -## SYNOPSIS -Sends output to an interactive table in a separate window. - -## SYNTAX - -### PassThru (Default) -``` -Out-GridView [-InputObject ] [-Title ] [-PassThru] [] -``` - -### Wait -``` -Out-GridView [-InputObject ] [-Title ] [-Wait] [] -``` - -### OutputMode -``` -Out-GridView [-InputObject ] [-Title ] [-OutputMode ] [] -``` - -## DESCRIPTION -The **Out-GridView** cmdlet sends the output from a command to a grid view window where the output is displayed in an interactive table. - -You can use the following features of the table to examine your data: - -- Hide, Show, and Reorder Columns: To hide, show, use the columns dropdown. Drag and drop column headers to reorder. -- Sort. To sort the data, click a column header. Click again to toggle from ascending to descending order. -- Quick Filter. Use the Filter box at the top of the window to search the text in the table. You can search for text in a particular column, search for literals, and search for multiple words. -- Column Filter. Use the Add Column Filter drop-down to create rules to filter the data. This is very useful for very large data sets, such as event logs. - -For instructions for using these features, type `Get-Help Out-GridView -Full` and see How to Use the Grid View Window Features in the Notes section. - -## EXAMPLES - -### Example 1: Output processes to a grid view -``` -PS C:\> Get-Process | Out-GridView -``` - -This command gets the processes running on the local computer and sends them to a grid view window. - -### Example 2: Use a variable to output processes to a grid view -``` -PS C:\> $P = Get-Process -PS C:\> $P | Out-GridView -``` - -This command also gets the processes running on the local computer and sends them to a grid view window. - -The first command uses the Get-Process cmdlet to get the processes on the computer and then saves the process objects in the $P variable. - -The second command uses a pipeline operator to send the $P variable to **Out-GridView**. - -### Example 3: Display a formatted table in a grid view -``` -PS C:\> Get-Process | Select-Object -Property Name, WorkingSet, PeakWorkingSet | Sort-Object -Property WorkingSet -Descending | Out-GridView -``` - -This command displays a formatted table in a grid view window. - -It uses the Get-Process cmdlet to get the processes on the computer. - -Then, it uses a pipeline operator (|) to send the process objects to the Select-Object cmdlet. -The command uses the **Property** parameter of **Select-Object** to select the Name, WorkingSet, and PeakWorkingSet properties to be displayed in the table. - -Another pipeline operator sends the filtered objects to the Sort-Object cmdlet, which sorts them in descending order by the value of the **WorkingSet** property. - -The final part of the command uses a pipeline operator (|) to send the formatted table to **Out-GridView**. - -You can now use the features of the grid view to search, sort, and filter the data. - -### Example 4: Save output to a variable, and then output a grid view -``` -PS C:\> ($A = Get-ChildItem -Path $pshome -Recurse) | Out-GridView -``` - -This command saves its output in a variable and sends it to **Out-GridView**. - -The command uses the Get-ChildItem cmdlet to get the files in the Windows PowerShell installation directory and its subdirectories. -The path to the installation directory is saved in the $pshome automatic variable. - -The command uses the assignment operator (=) to save the output in the $A variable and the pipeline operator (|) to send the output to **Out-GridView**. - -The parentheses in the command establish the order of operations. -As a result, the output from the Get-ChildItem command is saved in the $A variable before it is sent to **Out-GridView**. - -### Example 5: Output processes for a specified computer to a grid view -``` -PS C:\> Get-Process -ComputerName "Server01" | ogv -Title "Processes - Server01" -``` - -This command displays the processes that are running on the Server01 computer in a grid view window. - -The command uses `ogv`, which is the built-in alias for the **Out-GridView** cmdlet, it uses the *Title* parameter to specify the window title. - -### Example 6: Output data from remote computers to a grid view -``` -PS C:\> Invoke-Command -ComputerName S1, S2, S3 -ScriptBlock {Get-Culture} | Out-GridView -``` - -This example shows the correct format for sending data collected from remote computers to the **Out-GridView** cmdlet. - -The command uses the Invoke-Command cmdlet to run a Get-Culture command on three remote computers. -It uses a pipeline operator to send the data that is returned to the **Out-GridView** cmdlet. - -Notice that the script block that contains the commands that are run remotely does not include the **Out-GridView** command. -If it did, the command would fail when it tried to open a grid view window on each of the remote computers. - -### Example 7: Pass multiple items through Out-GridView -``` -PS C:\> Get-Process | Out-GridView -PassThru | Export-Csv -Path .\ProcessLog.csv -``` - -This command lets you select multiple processes from the **Out-GridView** window. -The processes that you select are passed to the **Export-Csv** command and written to the ProcessLog.csv file. - -The command uses the *PassThru* parameter of **Out-GridView**, which lets you send multiple items down the pipeline. -The *PassThru* parameter is equivalent to using the Multiple value of the *OutputMode* parameter. - -### Example 8: Create a Windows shortcut to Out-GridView -``` -PS C:\> Powershell.exe -Command "Get-Service | Out-GridView -Wait" -``` - -This command shows how to use the *Wait* parameter of **Out-GridView** to create a Windows shortcut to the **Out-GridView** window. -Without the *Wait* parameter, Windows PowerShell would exit as soon as the **Out-GridView** window opened, which would close the **Out-GridView** window almost immediately. - -## PARAMETERS - -### -InputObject -Specifies that the cmdlet accepts input for **Out-GridView**. - -When you use the **InputObject** parameter to send a collection of objects to **Out-GridView**, **Out-GridView** treats the collection as one collection object, and it displays one row that represents the collection. -To display the each object in the collection, use a pipeline operator (|) to send objects to **Out-GridView**. - -```yaml -Type: PSObject -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: True (ByValue) -Accept wildcard characters: False -``` - -### -OutputMode -Specifies the items that the interactive window sends down the pipeline as input to other commands. -By default, this cmdlet does not generate any output. -To send items from the interactive window down the pipeline, click to select the items and then click OK. - -The values of this parameter determine how many items you can send down the pipeline. - -- None. No items. This is the default value. -- Single. Zero items or one item. Use this value when the next command can take only one input object. -- Multiple. Zero, one, or many items. Use this value when the next command can take multiple input objects. This value is equivalent to the *Passthru* parameter. - -This parameter was introduced in Windows PowerShell 3.0. - -```yaml -Type: OutputModeOption -Parameter Sets: OutputMode -Aliases: -Accepted values: None, Single, Multiple - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -PassThru -Indicates that the cmdlet sends items from the interactive window down the pipeline as input to other commands. -By default, this cmdlet does not generate any output. -This parameter is equivalent to using the Multiple value of the *OutputMode* parameter. - -To send items from the interactive window down the pipeline, click to select the items and then click OK. -Shift-click and Ctrl-click are supported. - -This parameter was introduced in Windows PowerShell 3.0. - -```yaml -Type: SwitchParameter -Parameter Sets: PassThru -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Title -Specifies the text that appears in the title bar of the **Out-GridView** window. - -By default, the title bar displays the command that invokes **Out-GridView**. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Wait -Indicates that the cmdlet suppresses the command prompt and prevents Windows PowerShell from closing until the **Out-GridView** window is closed. -By default, the command prompt returns when the **Out-GridView** window opens. - -This feature lets you use the **Out-GridView** cmdlets in Windows shortcuts. -When **Out-GridView** is used in a shortcut without the *Wait* parameter, the **Out-GridView** window appears only momentarily before Windows PowerShell closes. - -This parameter was introduced in Windows PowerShell 3.0. - -```yaml -Type: SwitchParameter -Parameter Sets: Wait -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.Management.Automation.PSObject -You can send any object to this cmdlet. - -## OUTPUTS - -### None -**Out-GridView** does not return any objects. - -## NOTES -* You cannot use a remote command to open a grid view window on another computer. -* The command output that you send to **Out-GridView** cannot be formatted, such as by using the Format-Table or Format-Wide cmdlets. To select properties, use the Select-Object cmdlet. -* Deserialized output from remote commands might not be formatted correctly in the grid view window. - How to Use the Grid View Window Features - - The following topics explain how to use the features of the window that **Out-GridView** displays. - - **How to Hide, Show, and Reorder Columns** - - **To hide or show a column:** - - 1. Click on the Columns expander. - - 2. In the Columns expander, toggle Columns that should appear. - Only selected columns appear in the grid view window. - - **To reorder columns:** - - - Drag and drop the column into the desired location. - - **How to Sort Table Data** - - - To sort the data, click a column header. - - - To change the sort order, click the column header again. -Each time you click the same header, the sort order toggles between ascending to descending order. -The current order is indicated by a triangle in the column header. - - **How to Search in the Table (Quick Filter)** - - Use the Filter box to search for data in the table. -When you type in the box, only items that include the typed text appear in the table. - - - Search for text. -To search for text in the table, in the Filter box, type the text to find. - - - Search for multiple words. -To search for multiple words in the table, type the words separated by spaces. -**Out-GridView** displays rows that include all of the words (logical AND). - - - Search for literal phrases. -To search for phrases that include spaces or special characters, enclose the phrase in quotation marks. -**Out-GridView** displays rows that include an exact match for the phrase. - - **Use Column Filters to Filter the Table** - - You can use column filters to determine which items are displayed in the table. - Items appear only when they satisfy all of the column filters that you establish. - - Each column filter has the following format: - - \ \ \ - - Column filters for different properties are connected by AND. -Column filters for the same property are connected by OR. -You cannot change the logical connectors. - - The column filters only affects the display. -It does not delete items from the table. - - **How to Add Column Filters** - - 1. Click the Add Column Filters menu button. - - 2. Click the column (property) you wish to add. - - **How to Edit a Column Filter** - - - To change an operator, click the operator drop down, and then click to select a different operator from the drop-down list. - - - To enter or change a value, type a value in the value box. - - - To create an OR statement, add a column filter with the same property. - - **How to Delete Column Filters** - - - To delete selected column filters, click the remove button beside each column filter. - - - To delete all column filters, click the Clear Filters button. - -## RELATED LINKS - -[Out-File](Out-File.md) - -[Out-Printer](Out-Printer.md) - -[Out-String](Out-String.md) diff --git a/src/Microsoft.PowerShell.ConsoleGuiTools/ModuleLayout.psd1 b/src/Microsoft.PowerShell.ConsoleGuiTools/ModuleLayout.psd1 deleted file mode 100644 index b1887f8..0000000 --- a/src/Microsoft.PowerShell.ConsoleGuiTools/ModuleLayout.psd1 +++ /dev/null @@ -1,16 +0,0 @@ -@{ - RequiredBuildAssets = @{ - 'Microsoft.PowerShell.ConsoleGuiTools' = @( - 'publish/Microsoft.PowerShell.ConsoleGuiTools.dll', - 'publish/Microsoft.PowerShell.ConsoleGuiTools.psd1', - 'publish/Terminal.Gui.dll', - 'publish/NStack.dll' - ) - - 'Microsoft.PowerShell.OutGridView.Models' = @( - 'publish/Microsoft.PowerShell.OutGridView.Models.dll' - ) - } - - NativeBuildAssets = @() -} diff --git a/tools/installPSResources.ps1 b/tools/installPSResources.ps1 index a7b4b04..cfceed1 100644 --- a/tools/installPSResources.ps1 +++ b/tools/installPSResources.ps1 @@ -11,3 +11,4 @@ if ($PSVersionTable.PSVersion.Major -lt 6) { # TODO: Switch to Install-PSResource when CI uses PowerShell 7.4 Install-Module -Name InvokeBuild -Scope CurrentUser Install-Module -Name platyPS -Scope CurrentUser +Install-Module -Name Microsoft.PowerShell.PSResourceGet -Scope CurrentUser From 4af36e3815331354924d02f8b507e7a27bc25be9 Mon Sep 17 00:00:00 2001 From: Andy Jordan <2226434+andyleejordan@users.noreply.github.com> Date: Tue, 30 Apr 2024 18:29:29 -0700 Subject: [PATCH 4/9] Remove deprecated files and update CFS feed --- .vscode/launch.json | 32 --------- .vscode/settings.json | 5 -- .vscode/tasks.json | 22 ------- .vsts-ci/azure-pipelines-ci.yml | 31 --------- .vsts-ci/azure-pipelines-release.yml | 76 ---------------------- .vsts-ci/misc-analysis.yml | 25 -------- .vsts-ci/templates/ci-general.yml | 67 ------------------- .vsts-ci/templates/publish-github.yml | 31 --------- .vsts-ci/templates/publish-markets.yml | 20 ------ .vsts-ci/templates/release-general.yml | 89 -------------------------- NuGet.config => nuget.config | 2 +- 11 files changed, 1 insertion(+), 399 deletions(-) delete mode 100644 .vscode/launch.json delete mode 100644 .vscode/settings.json delete mode 100644 .vscode/tasks.json delete mode 100644 .vsts-ci/azure-pipelines-ci.yml delete mode 100644 .vsts-ci/azure-pipelines-release.yml delete mode 100644 .vsts-ci/misc-analysis.yml delete mode 100644 .vsts-ci/templates/ci-general.yml delete mode 100644 .vsts-ci/templates/publish-github.yml delete mode 100644 .vsts-ci/templates/publish-markets.yml delete mode 100644 .vsts-ci/templates/release-general.yml rename NuGet.config => nuget.config (64%) diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index 3858d91..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.7.0", - "configurations": [ - { - "name": ".NET Core Launch (console)", - "preLaunchTask": "build ConsoleGuiTools", - "type": "coreclr", - "request": "launch", - "program": "pwsh", - "args": [ - "-NoExit", - "-NoProfile", - "-Command", - "Import-Module -verbose ${workspaceFolder}/module/Microsoft.PowerShell.ConsoleGuiTools" - ], - "cwd": "${workspaceFolder}", - "console": "integratedTerminal", - "stopAtEntry": false, - "justMyCode": false - }, - { - "name": ".NET Core Attach", - "type": "coreclr", - "request": "attach", - "processId": "${command:pickProcess}", - "justMyCode": false - } - ] -} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index d528a62..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "files.associations": { - "**/.vsts-ci/**/*.yml":"azure-pipelines", - } -} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json deleted file mode 100644 index e0a35c4..0000000 --- a/.vscode/tasks.json +++ /dev/null @@ -1,22 +0,0 @@ - // See https://go.microsoft.com/fwlink/?LinkId=733558 - // for the documentation about the tasks.json format - { - "version": "2.0.0", - "tasks": [ - { - "label": "build ConsoleGuiTools", - "command": "Invoke-Build", - "type": "shell", - "args": [ - "Build", - "-Module", - "Microsoft.PowerShell.ConsoleGuiTools" - ], - "group": "build", - "presentation": { - "reveal": "silent" - }, - "problemMatcher": "$msCompile" - } - ] -} \ No newline at end of file diff --git a/.vsts-ci/azure-pipelines-ci.yml b/.vsts-ci/azure-pipelines-ci.yml deleted file mode 100644 index bc9155b..0000000 --- a/.vsts-ci/azure-pipelines-ci.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: PR-$(System.PullRequest.PullRequestNumber)-$(Date:yyyyMMdd)$(Rev:.rr) - -variables: - # Don't download unneeded packages - - name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE - value: 'true' - # Improve performance by not sending telemetry - - name: DOTNET_CLI_TELEMETRY_OPTOUT - value: 'true' - -jobs: -- job: windows2022pwsh - displayName: Windows 2022 PowerShell 7 - pool: - vmImage: windows-2022 - steps: - - template: templates/ci-general.yml - -- job: macOS11 - displayName: macOS 11 - pool: - vmImage: macOS-11 - steps: - - template: templates/ci-general.yml - -- job: ubuntu2004 - displayName: Ubuntu 20.04 - pool: - vmImage: ubuntu-20.04 - steps: - - template: templates/ci-general.yml diff --git a/.vsts-ci/azure-pipelines-release.yml b/.vsts-ci/azure-pipelines-release.yml deleted file mode 100644 index f127c70..0000000 --- a/.vsts-ci/azure-pipelines-release.yml +++ /dev/null @@ -1,76 +0,0 @@ -name: Release-$(Build.SourceBranchName)-$(Date:yyyyMMdd)$(Rev:.rr) - -variables: - # Don't download unneeded packages - - name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE - value: 'true' - # Improve performance by not sending telemetry - - name: DOTNET_CLI_TELEMETRY_OPTOUT - value: 'true' - -trigger: - branches: - include: - - release - -resources: - repositories: - - repository: ComplianceRepo - type: github - endpoint: GitHub - name: PowerShell/compliance - -stages: -- stage: Build - displayName: Build the release - jobs: - - job: Build - pool: - name: 1ES - demands: ImageOverride -equals PSMMS2019-Secure - steps: - - template: templates/ci-general.yml - -- stage: Sign - displayName: Sign the release - jobs: - - job: Sign - pool: - name: 1ES - demands: ImageOverride -equals PSMMS2019-Secure - variables: - - group: ESRP - steps: - - template: templates/release-general.yml - -- stage: PublishGitHub - displayName: Publish the draft release - jobs: - - deployment: Publish - environment: GraphicalTools-GitHub - pool: - name: 1ES - demands: ImageOverride -equals PSMMSUbuntu20.04-Secure - variables: - - group: Publish - strategy: - runOnce: - deploy: - steps: - - template: templates/publish-github.yml - -- stage: PublishMarkets - displayName: Publish to marketplace and gallery - jobs: - - deployment: Publish - environment: GraphicalTools-Gallery - pool: - name: 1ES - demands: ImageOverride -equals PSMMSUbuntu20.04-Secure - variables: - - group: Publish - strategy: - runOnce: - deploy: - steps: - - template: templates/publish-markets.yml diff --git a/.vsts-ci/misc-analysis.yml b/.vsts-ci/misc-analysis.yml deleted file mode 100644 index 2647eb1..0000000 --- a/.vsts-ci/misc-analysis.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: PR-$(System.PullRequest.PullRequestNumber)-$(Date:yyyyMMdd)$(Rev:.rr) - -trigger: - branches: - include: - - master - -pr: -- master - -resources: - repositories: - - repository: ComplianceRepo - type: github - endpoint: GitHub - name: PowerShell/compliance - -jobs: -- job: Compliance - pool: - vmImage: windows-latest - steps: - - checkout: self - - checkout: ComplianceRepo - - template: ci-compliance.yml@ComplianceRepo diff --git a/.vsts-ci/templates/ci-general.yml b/.vsts-ci/templates/ci-general.yml deleted file mode 100644 index 8eb60b2..0000000 --- a/.vsts-ci/templates/ci-general.yml +++ /dev/null @@ -1,67 +0,0 @@ -parameters: -- name: pwsh - type: boolean - default: true - -steps: -- task: PowerShell@2 - displayName: PowerShell version - inputs: - targetType: inline - script: $PSVersionTable - pwsh: ${{ parameters.pwsh }} - -- task: UseDotNet@2 - displayName: Install .NET 6.0.x SDK - inputs: - packageType: sdk - version: 6.0.x - performMultiLevelLookup: true - -- task: PowerShell@2 - displayName: Build and test - inputs: - filePath: tools/azurePipelinesBuild.ps1 - pwsh: ${{ parameters.pwsh }} - -- task: PublishTestResults@2 - displayName: Publish VSTest results - inputs: - testRunner: VSTest - testResultsFiles: '**/*.trx' - condition: succeededOrFailed() - -- task: PublishTestResults@2 - displayName: Publish NUnit results - inputs: - testRunner: NUnit - testResultsFiles: '**/TestResults.xml' - condition: succeededOrFailed() - -# NOTE: We zip the artifacts because they're ~20 MB compressed, but ~300 MB raw, -# and we have limited pipeline artifact storage space. -- task: ArchiveFiles@2 - displayName: Zip build output - inputs: - rootFolderOrFile: module - includeRootFolder: false - archiveType: zip - archiveFile: GraphicalTools-Build.zip - verbose: true - -- publish: GraphicalTools-Build.zip - artifact: GraphicalTools-Build-$(System.JobId) - displayName: Publish build output archive - -- task: ArchiveFiles@2 - displayName: Zip sources with `project.assets.json` - inputs: - rootFolderOrFile: src - includeRootFolder: false - archiveType: zip - archiveFile: GraphicalTools-Sources.zip - verbose: true - -- publish: GraphicalTools-Sources.zip - artifact: GraphicalTools-Sources-$(System.JobId) - displayName: Publish sources archive diff --git a/.vsts-ci/templates/publish-github.yml b/.vsts-ci/templates/publish-github.yml deleted file mode 100644 index b15b0b4..0000000 --- a/.vsts-ci/templates/publish-github.yml +++ /dev/null @@ -1,31 +0,0 @@ -steps: -- checkout: self - -- download: current - artifact: GraphicalTools - displayName: Download signed pipeline artifacts - -- pwsh: | - Set-PSRepository -Name PSGallery -InstallationPolicy Trusted | Out-Null - Install-Module -Name PowerShellForGitHub -Scope CurrentUser -Force - Set-GitHubConfiguration -SuppressTelemetryReminder - - $password = ConvertTo-SecureString -String $(GitHubToken) -AsPlainText -Force - Set-GitHubAuthentication -Credential (New-Object System.Management.Automation.PSCredential ("token", $password)) - - $Info = Import-PowerShellDataFile -Path ./src/Microsoft.PowerShell.ConsoleGuiTools/Microsoft.PowerShell.ConsoleGuiTools.psd1 - - $ReleaseParams = @{ - Tag = "v$($Info.ModuleVersion)" - Committish = "release" - Name = "v$($Info.ModuleVersion)" - Draft = $True - PreRelease = $False - OwnerName = "PowerShell" - RepositoryName = "GraphicalTools" - } - - $Release = New-GitHubRelease @ReleaseParams - Write-Host "Draft release URL: $($Release.html_url)" - $Release | New-GitHubReleaseAsset -Path $(Pipeline.Workspace)/GraphicalTools/GraphicalTools.zip - displayName: Drafting a GitHub Release diff --git a/.vsts-ci/templates/publish-markets.yml b/.vsts-ci/templates/publish-markets.yml deleted file mode 100644 index 4b12582..0000000 --- a/.vsts-ci/templates/publish-markets.yml +++ /dev/null @@ -1,20 +0,0 @@ -steps: -- checkout: self - -- download: current - artifact: GraphicalTools - displayName: Download signed artifacts - -- task: ExtractFiles@1 - displayName: Extract signed artifacts - inputs: - archiveFilePatterns: $(Pipeline.Workspace)/GraphicalTools/GraphicalTools.zip - destinationFolder: $(Pipeline.Workspace)/Publish - cleanDestinationFolder: true - -- pwsh: | - Set-PSRepository -Name PSGallery -InstallationPolicy Trusted - Install-Module -Name Microsoft.PowerShell.PSResourceGet -AllowPrerelease -Scope CurrentUser -Force - Import-Module -Name Microsoft.PowerShell.PSResourceGet -MinimumVersion 1.0.0 - Publish-PSResource -Path $(Pipeline.Workspace)/Publish/Microsoft.PowerShell.ConsoleGuiTools -Repository PSGallery -APIKey $(GalleryToken) -Verbose - displayName: Publishing ConsoleGuiTools to PowerShell Gallery diff --git a/.vsts-ci/templates/release-general.yml b/.vsts-ci/templates/release-general.yml deleted file mode 100644 index 96d80db..0000000 --- a/.vsts-ci/templates/release-general.yml +++ /dev/null @@ -1,89 +0,0 @@ -steps: -- download: current - displayName: Download unsigned pipeline artifacts - -- task: ExtractFiles@1 - displayName: Extract unsigned artifacts - inputs: - archiveFilePatterns: $(Pipeline.Workspace)/GraphicalTools-Build-*/GraphicalTools-Build.zip - destinationFolder: $(Pipeline.Workspace)/Unsigned - cleanDestinationFolder: true - -- checkout: ComplianceRepo - -# NOTE: The signing templates explicitly copy everything along as they run, so -# the last output path has every signed (and intentionally unsigned) file. -- template: EsrpSign.yml@ComplianceRepo - parameters: - buildOutputPath: $(Pipeline.Workspace)/Unsigned - signOutputPath: $(Pipeline.Workspace)/FirstPartySigned - alwaysCopy: true - certificateId: CP-230012 # Authenticode certificate - shouldSign: true # We always want to sign - useMinimatch: true # This enables the use of globbing - pattern: | - **/Microsoft.PowerShell.*.{dll,psd1,psm1} - -- template: EsrpSign.yml@ComplianceRepo - parameters: - buildOutputPath: $(Pipeline.Workspace)/FirstPartySigned - signOutputPath: $(Pipeline.Workspace)/ThirdPartySigned - alwaysCopy: true - certificateId: CP-231522 # Third-party certificate - shouldSign: true # We always want to sign - useMinimatch: true # This enables the use of globbing - pattern: | - **/NStack.dll - **/Terminal.Gui.dll - -# The SBOM generation requires our original sources with the `dotnet restore` -# produced `project.assets.json` files. -- task: ExtractFiles@1 - displayName: Extract source artifacts - inputs: - archiveFilePatterns: $(Pipeline.Workspace)/GraphicalTools-Sources-*/GraphicalTools-Sources.zip - destinationFolder: $(Pipeline.Workspace)/Sources - cleanDestinationFolder: true - -- template: Sbom.yml@ComplianceRepo - parameters: - BuildDropPath: $(Pipeline.Workspace)/ThirdPartySigned - Build_Repository_Uri: https://github.com/PowerShell/GraphicalTools.git - packageName: GraphicalTools - packageVersion: $(System.JobId) - sourceScanPath: $(Pipeline.Workspace)/Sources - -- task: ArchiveFiles@2 - displayName: Zip signed artifacts - inputs: - rootFolderOrFile: $(Pipeline.Workspace)/ThirdPartySigned - includeRootFolder: false - archiveType: zip - archiveFile: GraphicalTools.zip - replaceExistingArchive: true - verbose: true - -- checkout: self - -- template: assembly-module-compliance.yml@ComplianceRepo - parameters: - # binskim - AnalyzeTarget: $(Pipeline.Workspace)/*.dll - AnalyzeSymPath: 'SRV*' - # component-governance: requires the `project.assets.json` files - sourceScanPath: $(Pipeline.Workspace)/Sources - # credscan - suppressionsFile: '' - # TermCheck AKA PoliCheck - targetArgument: $(Build.SourcesDirectory)/GraphicalTools - optionsUEPATH: $(Build.SourcesDirectory)/GraphicalTools/tools/terms/UserExclusions.xml - optionsRulesDBPath: '' - optionsFTPath: $(Build.SourcesDirectory)/GraphicalTools/tools/terms/FileTypeSet.xml - # tsa-upload - codeBaseName: PowerShell_GraphicalTools_20220823 - # We don't use any Windows APIs directly, so we don't need API scan - APIScan: false - -- publish: GraphicalTools.zip - artifact: GraphicalTools - displayName: Publish signed pipeline artifacts diff --git a/NuGet.config b/nuget.config similarity index 64% rename from NuGet.config rename to nuget.config index f04dcd5..f003b0f 100644 --- a/NuGet.config +++ b/nuget.config @@ -2,6 +2,6 @@ - + From 00dde83ea5072e98c534dee35c6e1b5f45dc154a Mon Sep 17 00:00:00 2001 From: Andy Jordan <2226434+andyleejordan@users.noreply.github.com> Date: Tue, 30 Apr 2024 18:36:55 -0700 Subject: [PATCH 5/9] Add GitHub Workflow CI --- .github/workflows/ci-test.yml | 51 +++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/ci-test.yml diff --git a/.github/workflows/ci-test.yml b/.github/workflows/ci-test.yml new file mode 100644 index 0000000..9b5ac02 --- /dev/null +++ b/.github/workflows/ci-test.yml @@ -0,0 +1,51 @@ +name: CI Tests + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + merge_group: + types: [ checks_requested ] + +jobs: + ci: + name: dotnet + strategy: + matrix: + os: [ windows-latest, macos-latest, ubuntu-latest ] + runs-on: ${{ matrix.os }} + env: + DOTNET_NOLOGO: true + DOTNET_CLI_TELEMETRY_OPTOUT: true + DOTNET_GENERATE_ASPNET_CERTIFICATE: false + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install dotnet + uses: actions/setup-dotnet@v4 + with: + cache: true + cache-dependency-path: '**/*.csproj' + + - name: Install PSResources + shell: pwsh + run: ./tools/installPSResources.ps1 + + - name: Build and test + shell: pwsh + run: Invoke-Build -Configuration Release Build, Package + + - name: Upload module + if: always() + uses: actions/upload-artifact@v4 + with: + name: ConsoleGuiTools-module-${{ matrix.os }} + path: module + + - name: Upload NuGet package + uses: actions/upload-artifact@v4 + with: + name: ConsoleGuiTools-nupkg-${{ matrix.os }} + path: out/*.nupkg From 0aec130cf0331c224cbae5bf930d2bd879f61caa Mon Sep 17 00:00:00 2001 From: Andy Jordan <2226434+andyleejordan@users.noreply.github.com> Date: Tue, 30 Apr 2024 19:28:48 -0700 Subject: [PATCH 6/9] Add version update script --- .pipelines/ConsoleGuiTools-Official.yml | 44 +++++++++++++------------ ConsoleGuiTools.Common.props | 2 ++ tools/updateVersion.ps1 | 32 ++++++++++++++++++ 3 files changed, 57 insertions(+), 21 deletions(-) create mode 100644 tools/updateVersion.ps1 diff --git a/.pipelines/ConsoleGuiTools-Official.yml b/.pipelines/ConsoleGuiTools-Official.yml index 79f00c0..04cbb51 100644 --- a/.pipelines/ConsoleGuiTools-Official.yml +++ b/.pipelines/ConsoleGuiTools-Official.yml @@ -63,7 +63,7 @@ extends: displayName: Use .NET 6.x SDK inputs: packageType: sdk - version: 6.x + useGlobalJson: true - task: PowerShell@2 displayName: Install PSResources inputs: @@ -75,20 +75,29 @@ extends: displayName: Sign 1st-party files inputs: command: sign - signing_environment: external_distribution + signing_profile: external_distribution search_root: $(Build.SourcesDirectory)/module files_to_sign: | - **/*.psd1; - **/Microsoft.PowerShell.*.dll; + *.psd1; + Microsoft.PowerShell.*.dll; - task: onebranch.pipeline.signing@1 displayName: Sign 3rd-party files inputs: command: sign - signing_environment: 135020002 + signing_profile: 135020002 search_root: $(Build.SourcesDirectory)/module files_to_sign: | - **/NStack.dll; - **/Terminal.Gui.dll; + NStack.dll; + Terminal.Gui.dll; + - pwsh: Invoke-Build -Configuration $(BuildConfiguration) Package + displayName: Package + - task: onebranch.pipeline.signing@1 + displayName: Sign NuGet package + inputs: + command: sign + signing_profile: external_distribution + search_root: $(Build.SourcesDirectory)/out + files_to_sign: "*.nupkg" - stage: release dependsOn: build variables: @@ -104,19 +113,12 @@ extends: steps: - download: current displayName: Download artifacts - - task: ArchiveFiles@2 - displayName: Zip signed artifacts - inputs: - rootFolderOrFile: $(drop) - includeRootFolder: false - archiveType: zip - archiveFile: out/ConsoleGuiTools.zip - task: GitHubRelease@1 displayName: Create GitHub release inputs: gitHubConnection: GitHub repositoryName: PowerShell/ConsoleGuiTools - assets: out/ConsoleGuiTools.zip + assets: $(drop)/*.nupkg tagSource: userSpecifiedTag tag: v$(version) isDraft: true @@ -135,10 +137,10 @@ extends: notifyUsers: $(Build.RequestedForEmail) instructions: Please validate the release and then publish it! timeoutInMinutes: 1440 - - pwsh: | - Set-PSRepository -Name PSGallery -InstallationPolicy Trusted - Install-Module -Name Microsoft.PowerShell.PSResourceGet -AllowPrerelease -Scope CurrentUser -Force - Import-Module -Name Microsoft.PowerShell.PSResourceGet -MinimumVersion 1.0.0 - Publish-PSResource -Path $(Pipeline.Workspace)/Publish/Microsoft.PowerShell.ConsoleGuiTools -Repository PSGallery -APIKey $(GalleryToken) -Verbose + - task: NuGetCommand@2 dependsOn: validation - displayName: Publishing ConsoleGuiTools to PowerShell Gallery + displayName: Publish ConsoleGuiTools to PowerShell Gallery + inputs: + command: push + packagesToPush: $(drop)/*.nupkg + publishFeedCredentials: PSGet-PSGalleryPush diff --git a/ConsoleGuiTools.Common.props b/ConsoleGuiTools.Common.props index ddb7958..adc7492 100644 --- a/ConsoleGuiTools.Common.props +++ b/ConsoleGuiTools.Common.props @@ -1,5 +1,7 @@ + 0.7.6 + Microsoft © Microsoft Corporation. latest diff --git a/tools/updateVersion.ps1 b/tools/updateVersion.ps1 new file mode 100644 index 0000000..16b7f79 --- /dev/null +++ b/tools/updateVersion.ps1 @@ -0,0 +1,32 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +param( + [Parameter(Mandatory)] + [semver]$Version, + + [Parameter(Mandatory)] + [string]$Changes +) + +git diff --staged --quiet --exit-code +if ($LASTEXITCODE -ne 0) { + throw "There are staged changes in the repository. Please commit or reset them before running this script." +} + +$v = "$($Version.Major).$($Version.Minor).$($Version.Patch)" + +$Path = "ConsoleGuiTools.Common.props" +$f = Get-Content -Path $Path +$f = $f -replace '^(?\s+)(.+)(?)$', "`${prefix}${v}`${suffix}" +$f = $f -replace '^(?\s+)(.*)(?)$', "`${prefix}$($Version.PreReleaseLabel)`${suffix}" +$f | Set-Content -Path $Path +git add $Path + +$Path = "src/Microsoft.PowerShell.ConsoleGuiTools/Microsoft.PowerShell.ConsoleGuiTools.psd1" +$f = Get-Content -Path $Path +$f = $f -replace "^(?ModuleVersion\s+=\s+')(.+)(?')`$", "`${prefix}${v}`${suffix}" +$f | Set-Content -Path $Path +git add $Path + +git commit --edit --message "v$($Version): $Changes" From c12d4e3a7c92b2f25ac4c7b705c23c57166723a7 Mon Sep 17 00:00:00 2001 From: Andy Jordan <2226434+andyleejordan@users.noreply.github.com> Date: Wed, 1 May 2024 11:36:02 -0700 Subject: [PATCH 7/9] Fix OneBranch publish steps --- .pipelines/ConsoleGuiTools-Official.yml | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/.pipelines/ConsoleGuiTools-Official.yml b/.pipelines/ConsoleGuiTools-Official.yml index 04cbb51..01e965d 100644 --- a/.pipelines/ConsoleGuiTools-Official.yml +++ b/.pipelines/ConsoleGuiTools-Official.yml @@ -47,7 +47,7 @@ extends: pool: type: windows variables: - ob_outputDirectory: $(Build.SourcesDirectory)/module + ob_outputDirectory: $(Build.SourcesDirectory)/out steps: - pwsh: | $data = Import-PowerShellDataFile -Path src/Microsoft.PowerShell.ConsoleGuiTools/Microsoft.PowerShell.ConsoleGuiTools.psd1 @@ -60,7 +60,7 @@ extends: system: Custom customVersion: $(package.version) - task: UseDotNet@2 - displayName: Use .NET 6.x SDK + displayName: Use .NET SDK inputs: packageType: sdk useGlobalJson: true @@ -118,7 +118,7 @@ extends: inputs: gitHubConnection: GitHub repositoryName: PowerShell/ConsoleGuiTools - assets: $(drop)/*.nupkg + assets: $(drop)/Microsoft.PowerShell.ConsoleGuiTools.$(version).nupkg tagSource: userSpecifiedTag tag: v$(version) isDraft: true @@ -137,10 +137,19 @@ extends: notifyUsers: $(Build.RequestedForEmail) instructions: Please validate the release and then publish it! timeoutInMinutes: 1440 + - job: publish + dependsOn: validation + displayName: Publish to PowerShell Gallery + pool: + type: windows + variables: + ob_outputDirectory: $(Build.SourcesDirectory)/out + steps: + - download: current + displayName: Download artifacts - task: NuGetCommand@2 - dependsOn: validation displayName: Publish ConsoleGuiTools to PowerShell Gallery inputs: command: push - packagesToPush: $(drop)/*.nupkg - publishFeedCredentials: PSGet-PSGalleryPush + packagesToPush: $(drop)/Microsoft.PowerShell.ConsoleGuiTools.$(version).nupkg + publishFeedCredentials: PowerShellGallery From e38d0ef5d921438d28be0a31a00d9bdd17d3502d Mon Sep 17 00:00:00 2001 From: Andy Jordan <2226434+andyleejordan@users.noreply.github.com> Date: Wed, 1 May 2024 13:17:35 -0700 Subject: [PATCH 8/9] Update third party notices --- ConsoleGuiTools.build.ps1 | 10 +- NOTICE.txt | 274 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 282 insertions(+), 2 deletions(-) create mode 100644 NOTICE.txt diff --git a/ConsoleGuiTools.build.ps1 b/ConsoleGuiTools.build.ps1 index bf32421..3fa225b 100644 --- a/ConsoleGuiTools.build.ps1 +++ b/ConsoleGuiTools.build.ps1 @@ -24,8 +24,6 @@ task Build { Push-Location src/Microsoft.PowerShell.ConsoleGuiTools Invoke-BuildExec { & dotnet publish --configuration $Configuration --output publish } $Assets = $( - "../../README.md", - "../../LICENSE.txt", "./publish/Microsoft.PowerShell.ConsoleGuiTools.dll", "./publish/Microsoft.PowerShell.ConsoleGuiTools.psd1", "./publish/Microsoft.PowerShell.OutGridView.Models.dll", @@ -36,6 +34,14 @@ task Build { } Pop-Location + $Assets = $( + "./README.md", + "./LICENSE.txt", + "./NOTICE.txt") + $Assets | ForEach-Object { + Copy-Item -Force -Path $_ -Destination ./module + } + New-ExternalHelp -Path docs/Microsoft.PowerShell.ConsoleGuiTools -OutputPath module/en-US -Force } diff --git a/NOTICE.txt b/NOTICE.txt new file mode 100644 index 0000000..0f4b724 --- /dev/null +++ b/NOTICE.txt @@ -0,0 +1,274 @@ +NOTICES AND INFORMATION +Do Not Translate or Localize + +This software incorporates material from third parties. +Microsoft makes certain open source code available at https://3rdpartysource.microsoft.com, +or you may send a check or money order for US $5.00, including the product name, +the open source component name, platform, and version number, to: + +Source Code Compliance Team +Microsoft Corporation +One Microsoft Way +Redmond, WA 98052 +USA + +Notwithstanding any other terms, you may reverse engineer this software to the extent +required to debug changes to any libraries licensed under the GNU Lesser General Public License. + +--------------------------------------------------------- + +NStack.Core 1.1.1 - MIT + + + +MIT License + +Copyright (c) 2009 The Go Authors. All rights reserved. +Copyright (c) 2017 Microsoft. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +System.CodeDom 8.0.0 - MIT + + +Copyright (c) Six Labors +(c) Microsoft Corporation +Copyright (c) Andrew Arnott +Copyright 2019 LLVM Project +Copyright 2018 Daniel Lemire +Copyright (c) .NET Foundation +Copyright (c) 2011, Google Inc. +Copyright (c) 2020 Dan Shechter +(c) 1997-2005 Sean Eron Anderson +Copyright (c) 1998 Microsoft. To +Copyright (c) 2022, Wojciech Mula +Copyright (c) 2017 Yoshifumi Kawai +Copyright (c) 2022, Geoff Langdale +Copyright (c) 2005-2020 Rich Felker +Copyright (c) 2012-2021 Yann Collet +Copyright (c) Microsoft Corporation +Copyright (c) 2007 James Newton-King +Copyright (c) 1991-2022 Unicode, Inc. +Copyright (c) 2013-2017, Alfred Klomp +Copyright 2012 the V8 project authors +Copyright (c) 1999 Lucent Technologies +Copyright (c) 2008-2016, Wojciech Mula +Copyright (c) 2011-2020 Microsoft Corp +Copyright (c) 2015-2017, Wojciech Mula +Copyright (c) 2021 csFastFloat authors +Copyright (c) 2005-2007, Nick Galbreath +Copyright (c) 2015 The Chromium Authors +Copyright (c) 2018 Alexander Chermyanin +Copyright (c) The Internet Society 1997 +Portions (c) International Organization +Copyright (c) 2004-2006 Intel Corporation +Copyright (c) 2011-2015 Intel Corporation +Copyright (c) 2013-2017, Milosz Krajewski +Copyright (c) 2016-2017, Matthieu Darbois +Copyright (c) The Internet Society (2003) +Copyright (c) .NET Foundation Contributors +Copyright (c) 2020 Mara Bos +Copyright (c) .NET Foundation and Contributors +Copyright (c) 2012 - present, Victor Zverovich +Copyright (c) 2006 Jb Evain (jbevain@gmail.com) +Copyright (c) 2008-2020 Advanced Micro Devices, Inc. +Copyright (c) 2019 Microsoft Corporation, Daan Leijen +Copyright (c) 2011 Novell, Inc (http://www.novell.com) +Copyright (c) 1995-2022 Jean-loup Gailly and Mark Adler +Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com) +Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors +Copyright (c) 2014 Ryan Juckett http://www.ryanjuckett.com +Copyright (c) 1990- 1993, 1996 Open Software Foundation, Inc. +Copyright (c) YEAR W3C(r) (MIT, ERCIM, Keio, Beihang). Disclaimers +Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip +Copyright (c) 1980, 1986, 1993 The Regents of the University of California +Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California +Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass + +The MIT License (MIT) + +Copyright (c) .NET Foundation and Contributors + +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +--------------------------------------------------------- + +--------------------------------------------------------- + +System.Management 8.0.0 - MIT + + +Copyright (c) Six Labors +(c) Microsoft Corporation +Copyright (c) Andrew Arnott +Copyright 2019 LLVM Project +Copyright 2018 Daniel Lemire +Copyright (c) .NET Foundation +Copyright (c) 2011, Google Inc. +Copyright (c) 2020 Dan Shechter +(c) 1997-2005 Sean Eron Anderson +Copyright (c) 1998 Microsoft. To +Copyright (c) 2022, Wojciech Mula +Copyright (c) 2017 Yoshifumi Kawai +Copyright (c) 2022, Geoff Langdale +Copyright (c) 2005-2020 Rich Felker +Copyright (c) 2012-2021 Yann Collet +Copyright (c) Microsoft Corporation +Copyright (c) 2007 James Newton-King +Copyright (c) 1991-2022 Unicode, Inc. +Copyright (c) 2013-2017, Alfred Klomp +Copyright 2012 the V8 project authors +Copyright (c) 1999 Lucent Technologies +Copyright (c) 2008-2016, Wojciech Mula +Copyright (c) 2011-2020 Microsoft Corp +Copyright (c) 2015-2017, Wojciech Mula +Copyright (c) 2021 csFastFloat authors +Copyright (c) 2005-2007, Nick Galbreath +Copyright (c) 2015 The Chromium Authors +Copyright (c) 2018 Alexander Chermyanin +Copyright (c) The Internet Society 1997 +Portions (c) International Organization +Copyright (c) 2004-2006 Intel Corporation +Copyright (c) 2011-2015 Intel Corporation +Copyright (c) 2013-2017, Milosz Krajewski +Copyright (c) 2016-2017, Matthieu Darbois +Copyright (c) The Internet Society (2003) +Copyright (c) .NET Foundation Contributors +Copyright (c) 2020 Mara Bos +Copyright (c) .NET Foundation and Contributors +Copyright (c) 2012 - present, Victor Zverovich +Copyright (c) 2006 Jb Evain (jbevain@gmail.com) +Copyright (c) 2008-2020 Advanced Micro Devices, Inc. +Copyright (c) 2019 Microsoft Corporation, Daan Leijen +Copyright (c) 2011 Novell, Inc (http://www.novell.com) +Copyright (c) 1995-2022 Jean-loup Gailly and Mark Adler +Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com) +Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors +Copyright (c) 2014 Ryan Juckett http://www.ryanjuckett.com +Copyright (c) 1990- 1993, 1996 Open Software Foundation, Inc. +Copyright (c) YEAR W3C(r) (MIT, ERCIM, Keio, Beihang). Disclaimers +Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip +Copyright (c) 1980, 1986, 1993 The Regents of the University of California +Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California +Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass + +The MIT License (MIT) + +Copyright (c) .NET Foundation and Contributors + +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +--------------------------------------------------------- + +--------------------------------------------------------- + +System.ValueTuple 4.5.0 - MIT + + +(c) 2023 GitHub, Inc. +(c) Microsoft Corporation +Copyright (c) 2011, Google Inc. +(c) 1997-2005 Sean Eron Anderson +Copyright (c) 1991-2017 Unicode, Inc. +Copyright (c) 2015 The Chromium Authors +Portions (c) International Organization +Copyright (c) 2004-2006 Intel Corporation +Copyright (c) .NET Foundation Contributors +Copyright (c) .NET Foundation and Contributors +Copyright (c) 2011 Novell, Inc (http://www.novell.com) +Copyright (c) 1995-2017 Jean-loup Gailly and Mark Adler +Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com) +Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors +Copyright (c) YEAR W3C(r) (MIT, ERCIM, Keio, Beihang). Disclaimers + +The MIT License (MIT) + +Copyright (c) .NET Foundation and Contributors + +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +--------------------------------------------------------- + +--------------------------------------------------------- + +Terminal.Gui 1.16.0 - MIT + + + +MIT License + +Copyright (c) 2007-2011 Novell Inc +Copyright (c) 2017 Microsoft Corp + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- From 031531cd01d6d1cb004d6d3e8a2e4c81079c0d5c Mon Sep 17 00:00:00 2001 From: Andy Jordan <2226434+andyleejordan@users.noreply.github.com> Date: Wed, 1 May 2024 14:15:54 -0700 Subject: [PATCH 9/9] Publish ZIP module too --- .pipelines/ConsoleGuiTools-Official.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.pipelines/ConsoleGuiTools-Official.yml b/.pipelines/ConsoleGuiTools-Official.yml index 01e965d..b246120 100644 --- a/.pipelines/ConsoleGuiTools-Official.yml +++ b/.pipelines/ConsoleGuiTools-Official.yml @@ -89,8 +89,15 @@ extends: files_to_sign: | NStack.dll; Terminal.Gui.dll; + - task: ArchiveFiles@2 + displayName: Zip module + inputs: + rootFolderOrFile: $(Build.SourcesDirectory)/module + includeRootFolder: false + archiveType: zip + archiveFile: out/ConsoleGuiTools-v$(package.version).zip - pwsh: Invoke-Build -Configuration $(BuildConfiguration) Package - displayName: Package + displayName: Package module - task: onebranch.pipeline.signing@1 displayName: Sign NuGet package inputs: @@ -118,7 +125,9 @@ extends: inputs: gitHubConnection: GitHub repositoryName: PowerShell/ConsoleGuiTools - assets: $(drop)/Microsoft.PowerShell.ConsoleGuiTools.$(version).nupkg + assets: | + $(drop)/Microsoft.PowerShell.ConsoleGuiTools.$(version).nupkg + $(drop)/ConsoleGuiTools-v$(version).zip tagSource: userSpecifiedTag tag: v$(version) isDraft: true