From abb468bf73a30b90c9aae3f7e75ff6cb07409c14 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Thu, 26 Aug 2021 11:37:03 -0700 Subject: [PATCH 1/2] Extend CI test matrix to match PowerShellEditorServices --- .vsts-ci/azure-pipelines-ci.yml | 32 ++++++++++++++++++++++++------- .vsts-ci/templates/ci-general.yml | 23 ++++++++++++++++------ README.md | 17 +++++++++++----- 3 files changed, 54 insertions(+), 18 deletions(-) diff --git a/.vsts-ci/azure-pipelines-ci.yml b/.vsts-ci/azure-pipelines-ci.yml index d53ec24773..30a6998520 100644 --- a/.vsts-ci/azure-pipelines-ci.yml +++ b/.vsts-ci/azure-pipelines-ci.yml @@ -22,23 +22,41 @@ resources: ref: master jobs: -- job: Win2019 - displayName: Windows Server 2019 +- job: PS51_Win2016 + displayName: PowerShell 5.1 - Windows Server 2016 + pool: + vmImage: vs2017-win2016 + steps: + - template: templates/ci-general.yml + parameters: + pwsh: false + +- job: PS51_Win2019 + displayName: PowerShell 5.1 - Windows Server 2019 + pool: + vmImage: windows-2019 + steps: + - template: templates/ci-general.yml + parameters: + pwsh: false + +- job: PS7_Win2019 + displayName: PowerShell 7 - Windows Server 2019 pool: vmImage: windows-2019 steps: - template: templates/ci-general.yml -- job: macOS - displayName: macOS 10.15 +- job: PS7_macOS + displayName: PowerShell 7 - macOS 10.15 pool: vmImage: macOS-10.15 steps: - template: templates/ci-general.yml -- job: Ubuntu - displayName: Ubuntu 20.04 +- job: PS7_Ubuntu + displayName: PowerShell 7 - Ubuntu 20.04 pool: - vmImage: Ubuntu-20.04 + vmImage: ubuntu-20.04 steps: - template: templates/ci-general.yml diff --git a/.vsts-ci/templates/ci-general.yml b/.vsts-ci/templates/ci-general.yml index 668369ba00..3bd642c534 100644 --- a/.vsts-ci/templates/ci-general.yml +++ b/.vsts-ci/templates/ci-general.yml @@ -1,11 +1,18 @@ parameters: + - name: pwsh + type: boolean + default: true - name: usePipelineArtifact type: boolean default: false steps: -- pwsh: $PSVersionTable +- task: PowerShell@2 displayName: PowerShell version + inputs: + targetType: inline + script: $PSVersionTable + pwsh: ${{ parameters.pwsh }} - checkout: self @@ -34,12 +41,16 @@ steps: archiveFilePatterns: $(Pipeline.Workspace)/PowerShellEditorServices.zip destinationFolder: $(Build.SourcesDirectory)/vscode-powershell/modules -- pwsh: | - Install-Module InvokeBuild -Scope CurrentUser -Force - Invoke-Build - Write-Host "##vso[task.setvariable variable=vsixPath]$(Resolve-Path powershell-*.vsix)" +- task: PowerShell@2 displayName: Build and test - workingDirectory: $(Build.SourcesDirectory)/vscode-powershell + inputs: + targetType: inline + script: | + Install-Module InvokeBuild -Scope CurrentUser -Force + Invoke-Build + Write-Host "##vso[task.setvariable variable=vsixPath]$(Resolve-Path powershell-*.vsix)" + workingDirectory: $(Build.SourcesDirectory)/vscode-powershell + pwsh: ${{ parameters.pwsh }} - publish: $(vsixPath) artifact: vscode-powershell-vsix-$(System.JobId) diff --git a/README.md b/README.md index 82cc80b2df..b3f10d267e 100644 --- a/README.md +++ b/README.md @@ -21,16 +21,23 @@ not activated by default, but after installing this extension either click "Set Theme" or use the [theme picker](https://code.visualstudio.com/docs/getstarted/themes) and select "PowerShell ISE" for a fun and familiar experience. -## Platform support +## Platform Support -- **Windows 7 through 10** with Windows PowerShell v3 and higher, and PowerShell Core -- **Linux** with PowerShell Core (all PowerShell-supported distributions) -- **macOS and OS X** with PowerShell Core +The extension _should_ work anywhere VS Code itself and PowerShell Core 7 or higher is +[supported][]. For Windows PowerShell, only version 5.1 is supported. Please note that +PowerShell Core 6 is end-of-life and so not supported. Our test matrix includes the +following: + +- **Windows Server 2016 and 2019** with Windows PowerShell 5.1 and PowerShell Core 7.1.4 +- **macOS 10.15** with PowerShell Core 7.1.4 +- **Ubuntu 20.04** with PowerShell Core 7.1.4 + +[supported]: https://docs.microsoft.com/en-us/powershell/scripting/powershell-support-lifecycle?view=powershell-7.1#supported-platforms Read the [installation instructions](https://docs.microsoft.com/en-us/powershell/scripting/components/vscode/using-vscode) to get more details on how to use the extension on these platforms. -Read the [troubleshooting guide](./docs/troubleshooting.md) for answers to common questions. +**Read the [troubleshooting guide](./docs/troubleshooting.md) for answers to common questions.** ## Features From 087cd0bda551fa7b87b31381a40d8b0fa6c894b2 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Thu, 26 Aug 2021 12:42:57 -0700 Subject: [PATCH 2/2] Update readme(s) --- README.md | 28 +++--- .../README_FOR_MARKETPLACE.md | 91 ++++++++++++------- 2 files changed, 74 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index b3f10d267e..c755d56c8c 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![Discord](https://img.shields.io/discord/180528040881815552.svg?label=%23vscode&logo=discord&logoColor=white)](https://aka.ms/powershell-vscode-discord) [![Join the chat at https://gitter.im/PowerShell/vscode-powershell](https://badges.gitter.im/PowerShell/vscode-powershell.svg)](https://gitter.im/PowerShell/vscode-powershell?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -This extension provides rich PowerShell language support for [Visual Studio Code](https://github.com/Microsoft/vscode). +This extension provides rich PowerShell language support for [Visual Studio Code](https://github.com/Microsoft/vscode) (VS Code). Now you can write and debug PowerShell scripts using the excellent IDE-like interface that Visual Studio Code provides. @@ -66,12 +66,12 @@ You can also install a VSIX package from our [Releases page](https://github.com/ instructions. The easiest way is through the command line: ```powershell -code --install-extension PowerShell-.vsix +code --install-extension powershell-.vsix ``` > NOTE: If you are using VS Code Insiders, the command will be `code-insiders`. -## Script-based Installation +### Script-based Installation If you're on Windows 7 or greater with the [PowerShellGet](https://msdn.microsoft.com/powershell/gallery/readme) module installed, you can easily install both Visual Studio Code and the PowerShell @@ -99,7 +99,7 @@ If you experience any problems with the PowerShell Extension, see [the troubleshooting docs](./docs/troubleshooting.md) for information on diagnosing and reporting issues. -### Security Note +## Security Note For any security issues, please see [here](./docs/troubleshooting.md#note-on-security). @@ -113,19 +113,14 @@ how to use them. This folder can be found at the following path: ```powershell -$HOME/.vscode[-insiders]/extensions/ms-vscode.PowerShell-/examples +$HOME/.vscode[-insiders]/extensions/ms-vscode.powershell[-preview]-/examples ``` -or if you're using the preview version of the extension - - ```powershell -$HOME/.vscode[-insiders]/extensions/ms-vscode.powershell-preview-/examples -``` - -To open/view the extension's examples in Visual Studio Code, run the following from your PowerShell command prompt: +To open/view the extension's examples in Visual Studio Code, run the following from your +PowerShell session: ```powershell -code (Get-ChildItem $Home\.vscode\extensions\ms-vscode.PowerShell-*\examples)[-1] +code (Get-ChildItem $HOME/.vscode/extensions/ms-vscode.powershell-*/examples)[-1] ``` ## Contributing to the Code @@ -137,6 +132,13 @@ on how to contribute to this extension! - [Rob Holt](https://github.com/rjmholt) - [@rjmholt](https://twitter.com/rjmholt) - [Andy Schwartzmeyer](https://github.com/andschwa) - [andschwa.com](https://andschwa.com/) +- [Sydney Smith](https://github.com/SydneyhSmith) - [@SydneyhSmith](https://github.com/SydneyhSmith) + +### Emeriti + +- [Keith Hill](https://github.com/rkeithhill) - [@r_keith_hill](http://twitter.com/r_keith_hill) +- [Tyler Leonhardt](https://github.com/tylerl0706) - [@TylerLeonhardt](http://twitter.com/tylerleonhardt) +- [David Wilson](https://github.com/daviwil) - [@daviwil](https://twitter.com/daviwil) ## License diff --git a/docs/azure_data_studio/README_FOR_MARKETPLACE.md b/docs/azure_data_studio/README_FOR_MARKETPLACE.md index 06a2831bdc..2e32f6b3d2 100644 --- a/docs/azure_data_studio/README_FOR_MARKETPLACE.md +++ b/docs/azure_data_studio/README_FOR_MARKETPLACE.md @@ -1,20 +1,43 @@ # PowerShell Language Support for Azure Data Studio -[![Codacy Badge](https://api.codacy.com/project/badge/Grade/df06b9909e7442cebc1132bda0b8c0e3)](https://app.codacy.com/app/TylerLeonhardt/vscode-powershell?utm_source=github.com&utm_medium=referral&utm_content=PowerShell/vscode-powershell&utm_campaign=Badge_Grade_Dashboard) -[![Build Status](https://powershell.visualstudio.com/vscode-powershell/_apis/build/status/PowerShell.vscode-powershell?branchName=master)](https://powershell.visualstudio.com/vscode-powershell/_build/latest?definitionId=51&branchName=master) +[![Build Status](https://dev.azure.com/powershell/vscode-powershell/_apis/build/status/PowerShell.vscode-powershell?branchName=master)](https://dev.azure.com/powershell/vscode-powershell/_build/latest?definitionId=51&branchName=master) +[![Version](https://vsmarketplacebadge.apphb.com/version/ms-vscode.PowerShell.svg)](https://marketplace.visualstudio.com/items?itemName=ms-vscode.PowerShell) +[![Installs](https://vsmarketplacebadge.apphb.com/installs-short/ms-vscode.PowerShell.svg)](https://marketplace.visualstudio.com/items?itemName=ms-vscode.PowerShell) +[![Discord](https://img.shields.io/discord/180528040881815552.svg?label=%23vscode&logo=discord&logoColor=white)](https://aka.ms/powershell-vscode-discord) [![Join the chat at https://gitter.im/PowerShell/vscode-powershell](https://badges.gitter.im/PowerShell/vscode-powershell.svg)](https://gitter.im/PowerShell/vscode-powershell?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -This extension provides rich PowerShell language support for [Azure Data Studio](github.com/Microsoft/azuredatastudio). +This extension provides rich PowerShell language support for [Azure Data Studio](https://github.com/Microsoft/azuredatastudio) (ADS). Now you can write and run PowerShell scripts using the excellent IDE-like interface that Azure Data Studio provides. -## Platform support +This extension is powered by the PowerShell language server, +[PowerShell Editor Services](https://github.com/PowerShell/PowerShellEditorServices). +This leverages the +[Language Server Protocol](https://microsoft.github.io/language-server-protocol/) +where `PowerShellEditorServices` is the server and `vscode-powershell` is the client. -- **Windows 7 through 10** with Windows PowerShell v3 and higher, and PowerShell Core -- **Linux** with PowerShell Core (all PowerShell-supported distributions) -- **macOS** with PowerShell Core +Also included in this extension is the PowerShell ISE theme for Visual Studio Code. It is +not activated by default, but after installing this extension either click "Set Color +Theme" or use the [theme picker](https://code.visualstudio.com/docs/getstarted/themes) and +select "PowerShell ISE" for a fun and familiar experience. -Read the [FAQ](https://github.com/PowerShell/vscode-powershell/wiki/FAQ) for answers to common questions. +## Platform Support + +The extension _should_ work anywhere ADS itself and PowerShell Core 7 or higher is +[supported][]. For Windows PowerShell, only version 5.1 is supported. Please note that +PowerShell Core 6 is end-of-life and so not supported. Our test matrix includes the +following: + +- **Windows Server 2016 and 2019** with Windows PowerShell 5.1 and PowerShell Core 7.1.4 +- **macOS 10.15** with PowerShell Core 7.1.4 +- **Ubuntu 20.04** with PowerShell Core 7.1.4 + +[supported]: https://docs.microsoft.com/en-us/powershell/scripting/powershell-support-lifecycle?view=powershell-7.1#supported-platforms + +Read the [installation instructions](https://docs.microsoft.com/en-us/powershell/scripting/components/vscode/using-vscode) +to get more details on how to use the extension on these platforms. + +**Read the [troubleshooting guide](./docs/troubleshooting.md) for answers to common questions.** ## Features @@ -27,28 +50,27 @@ Read the [FAQ](https://github.com/PowerShell/vscode-powershell/wiki/FAQ) for ans - Document and workspace symbol discovery - Run selected selection of PowerShell code using F8 - Launch online help for the symbol under the cursor using Ctrl+F1 -- Basic interactive console support! +- Local script debugging +- Integrated console support +- PowerShell ISE color theme ## Installing the Extension You can install the official release of the PowerShell extension by following the steps -in the [Azure Data Studio documentation](docs.microsoft.com/en-us/sql/azure-data-studio/extensions). +in the [Azure Data Studio documentation](https://docs.microsoft.com/en-us/sql/azure-data-studio/extensions). In the Extensions pane, search for "PowerShell" extension and install it there. You will get notified automatically about any future extension updates! -You can also install a VSIX package from our [Releases page](https://github.com/PowerShell/vscode-powershell/releases) and install it through the command line: +You can also install a VSIX package from our [Releases page](https://github.com/PowerShell/vscode-powershell/releases) by following the +[Install from a VSIX](https://code.visualstudio.com/docs/editor/extension-gallery#_install-from-a-vsix) +instructions. The easiest way is through the command line: ```powershell -azuredatastudio --install-extension PowerShell-.vsix +azuredatastudio --install-extension powershell-.vsix ``` -## Reporting Problems - -If you experience any problems with the PowerShell Extension, see -[the troubleshooting docs](./docs/troubleshooting.md) for information -on diagnosing and reporting issues. +## Security Note -#### Security Note For any security issues, please see [here](./docs/troubleshooting.md#note-on-security). ## Example Scripts @@ -61,23 +83,20 @@ how to use them. This folder can be found at the following path: ```powershell -$HOME/.azuredatastudio/extensions/ms-vscode.PowerShell-/examples -``` - -or if you're using the preview version of the extension - - ```powershell -$HOME/.azuredatastudio/extensions/ms-vscode.powershell-preview-/examples +$HOME/.azuredatastudio/extensions/ms-vscode.powershell-/examples ``` -To open/view the extension's examples in Azure Data Studio, run the following from your PowerShell command prompt: +To open/view the extension's examples in Azure Data Studio, run the following from your +PowerShell session: ```powershell -azuredatastudio (Get-ChildItem $Home\.azuredatastudio\extensions\ms-vscode.PowerShell-*\examples)[-1] +azuredatastudio (Get-ChildItem $HOME/.azuredatastudio/extensions/ms-vscode.powershell-*/examples)[-1] ``` ### SQL PowerShell Examples -In order to use these examples (below), you need to install the SqlServer module from the [PowerShell Gallery](https://www.powershellgallery.com/packages/SqlServer). + +In order to use these examples (below), you need to install the SqlServer module from the +[PowerShell Gallery](https://www.powershellgallery.com/packages/SqlServer). ```powershell Install-Module -Name SqlServer @@ -85,7 +104,9 @@ Install-Module -Name SqlServer > NOTE: With version `21.1.18102` and up, the `SqlServer` module supports [PowerShell Core](https://github.com/PowerShell/PowerShell) 6.2 and up, in addion to Windows PowerShell. -In this example, we use the `Get-SqlInstance` cmdlet to Get the Server SMO objects for ServerA & ServerB. The default output for this command will include the Instance name, version, Service Pack, & CU Update Level of the instances. +In this example, we use the `Get-SqlInstance` cmdlet to Get the Server SMO objects for +ServerA and ServerB. The default output for this command will include the Instance name, +version, Service Pack, and CU Update Level of the instances. ```powershell Get-SqlInstance -ServerInstance ServerA, ServerB @@ -93,7 +114,7 @@ Get-SqlInstance -ServerInstance ServerA, ServerB Here is a sample of what that output will look like: -``` +```powershell Instance Name Version ProductLevel UpdateLevel HostPlatform HostDistribution ------------- ------- ------------ ----------- ------------ ---------------- ServerA 13.0.5233 SP2 CU4 Windows Windows Server 2016 Datacenter @@ -112,7 +133,7 @@ FOREACH { Here is a sample of what that output will look like: -``` +```powershell Name Status Size Space Recovery Compat. Owner Available Model Level ---- ------ ---- ---------- -------- ------- ----- @@ -152,9 +173,15 @@ on how to contribute to this extension! ## Maintainers +- [Rob Holt](https://github.com/rjmholt) - [@rjmholt](https://twitter.com/rjmholt) +- [Andy Schwartzmeyer](https://github.com/andschwa) - [andschwa.com](https://andschwa.com/) +- [Sydney Smith](https://github.com/SydneyhSmith) - [@SydneyhSmith](https://github.com/SydneyhSmith) + +### Emeriti + - [Keith Hill](https://github.com/rkeithhill) - [@r_keith_hill](http://twitter.com/r_keith_hill) - [Tyler Leonhardt](https://github.com/tylerl0706) - [@TylerLeonhardt](http://twitter.com/tylerleonhardt) -- [Rob Holt](https://github.com/rjmholt) +- [David Wilson](https://github.com/daviwil) - [@daviwil](https://twitter.com/daviwil) ## License