From 754d60c4f03214c663794399cfecbb3ec90cd254 Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Mon, 1 Jul 2019 11:00:37 -0700 Subject: [PATCH 1/5] Update README_FOR_MARKETPLACE.md --- docs/azure_data_studio/README_FOR_MARKETPLACE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/azure_data_studio/README_FOR_MARKETPLACE.md b/docs/azure_data_studio/README_FOR_MARKETPLACE.md index 1ada551055..06a2831bdc 100644 --- a/docs/azure_data_studio/README_FOR_MARKETPLACE.md +++ b/docs/azure_data_studio/README_FOR_MARKETPLACE.md @@ -5,7 +5,7 @@ [![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). -Now you can write and debug PowerShell scripts using the excellent IDE-like interface +Now you can write and run PowerShell scripts using the excellent IDE-like interface that Azure Data Studio provides. ## Platform support From f932f0449ccfcacd551280bc029ff605005023ce Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Mon, 1 Jul 2019 11:09:01 -0700 Subject: [PATCH 2/5] Delete remoting.md --- docs/remoting.md | 87 ------------------------------------------------ 1 file changed, 87 deletions(-) delete mode 100644 docs/remoting.md diff --git a/docs/remoting.md b/docs/remoting.md deleted file mode 100644 index 6b521dc70f..0000000000 --- a/docs/remoting.md +++ /dev/null @@ -1,87 +0,0 @@ -# PowerShell Remote Editing and Debugging in VSCode - -# ATTENTION! THIS DOC HAS MOVED - -[THIS DOC IS NOW HOSTED ON DOCS.MICROSOFT.COM.](https://docs.microsoft.com/en-us/powershell/scripting/components/vscode/using-vscode-for-remote-editing-and-debugging) - -PLEASE REFER TO THE DOC THERE FOR FUTURE REFERENCE AS ANY CHANGES WILL BE MADE TO THAT DOC. - -## Summary - -For those of you that were familiar with the ISE, you may recall that you were able to use run `psedit file.ps1` from the integrated console to open files - local or remote - right in the ISE. - -As it turns out, this feature is also availible out of the box in the PowerShell extension for VSCode. This guide will show you how to do it. - -NOTE: `Open-EditorFile` was added in 1.6.0. Pre-1.6.0 it was called `psedit`. In 1.6.0+ `psedit` is an alias of `Open-EditorFile`. - -## Prerequisites - -This guide assumes that you have: - -* a remote resource (ex: a VM, a container) that you have access to -* PowerShell running on it and the host machine -* VSCode and the PowerShell extension for VSCode - -NOTE: - -This works on Windows PowerShell and the cross-platform version, [PowerShell Core](https://github.com/powershell/powershell). - -This also works when connecting to a remote machine via WinRM, PowerShell Direct, or SSH. If you want to use SSH, but are using Windows, check out the Win32 version of SSH [here](https://github.com/PowerShell/Win32-OpenSSH)! - -## Let's go - -In this section, I will walk through remote editing and debugging from my MacBook Pro, to an Ubuntu VM running in Azure. I might not be using Windows, but **the process is identical**. - -### Local file editing with Open-EditorFile - -With the PowerShell extension for VSCode started and the PowerShell Integrated Console opened, we can type `Open-EditorFile foo.ps1` or `psedit foo.ps1` to open the local foo.ps1 file right in the editor. - -![Open-EditorFile foo.ps1 works locally](https://user-images.githubusercontent.com/2644648/34895897-7c2c46ac-f79c-11e7-9410-a252aff52f13.png) - -NOTE: foo.ps1 must already exist. - -From there, we can: - -add breakpoints to the gutter -![adding breakpoint to gutter](https://user-images.githubusercontent.com/2644648/34895893-7bdc38e2-f79c-11e7-8026-8ad53f9a1bad.png) - -and hit F5 to debug the PowerShell script. -![debugging the PowerShell local script](https://user-images.githubusercontent.com/2644648/34895894-7bedb874-f79c-11e7-9180-7e0dc2d02af8.png) - -While debugging, you can interact with the debug console, check out the variables in the scope on the left, and all the other standard debugging tools. - -### Remote file editing with Open-EditorFile - -Now let's get into remote file editing and debugging. The steps are nearly the same, there's just one thing we need to do first - enter our PowerShell session to the remote server. - -There's a cmdlet for that. It's called `Enter-PSSession`. - -The watered down explaination of the cmdlet is: - -* `Enter-PSSession -ComputerName foo` starts a session via WinRM -* `Enter-PSSession -ContainerId foo` and `Enter-PSSession -VmId foo` start a session via PowerShell Direct -* `Enter-PSSession -HostName foo` starts a session via SSH - -For more info on `Enter-PSSession`, check out the docs [here](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/enter-pssession?view=powershell-6). - -Since I will be remoting from macOS to an Ubuntu VM in Azure, I will use SSH for this. - -First, in the Integrated Console, let's run our Enter-PSSession. You will know that you're in the session because `[something]` will show up to the left of your prompt. - -NOTE: I've blacked out the IP address. - -![The call to Enter-PSSession](https://user-images.githubusercontent.com/2644648/34895896-7c18e0bc-f79c-11e7-9b36-6f4bd0e9b0db.png) - -From there, we can do the exact steps as if we were editing a local script. - -1. Run `Open-EditorFile test.ps1` or `psedit test.ps1` to open the remote `test.ps1` file -![Open-EditorFile the test.ps1 file](https://user-images.githubusercontent.com/2644648/34895898-7c3e6a12-f79c-11e7-8bdf-549b591ecbcb.png) -2. Edit the file/set breakpoints -![edit and set breakpoints](https://user-images.githubusercontent.com/2644648/34895892-7bb68246-f79c-11e7-8c0a-c2121773afbb.png) -3. Start debugging (F5) the remote file - -![debugging the remote file](https://user-images.githubusercontent.com/2644648/34895895-7c040782-f79c-11e7-93ea-47724fa5c10d.png) - -That's all there is to it! We hope that this helped clear up any questions about remote debugging and editing PowerShell in VSCode. - -If you have any problems, feel free to open issues [on the GitHub repo](http://github.com/powershell/vscode-powershell). From 964750d3671f8fda1496ba436d305d3150c271d6 Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Mon, 1 Jul 2019 11:09:11 -0700 Subject: [PATCH 3/5] Delete ise_compatibility.md --- docs/ise_compatibility.md | 131 -------------------------------------- 1 file changed, 131 deletions(-) delete mode 100644 docs/ise_compatibility.md diff --git a/docs/ise_compatibility.md b/docs/ise_compatibility.md deleted file mode 100644 index 714cec466b..0000000000 --- a/docs/ise_compatibility.md +++ /dev/null @@ -1,131 +0,0 @@ -# ISE Compatibility - -# ATTENTION! THIS DOC HAS MOVED - -[THIS DOC IS NOW HOSTED ON DOCS.MICROSOFT.COM.](https://docs.microsoft.com/en-us/powershell/scripting/components/vscode/how-to-replicate-the-ise-experience-in-vscode) - -PLEASE REFER TO THE DOC THERE FOR FUTURE REFERENCE AS ANY CHANGES WILL BE MADE TO THAT DOC. - -## Summary - -While the PowerShell extension for VSCode does not seek -complete feature parity with the PowerShell ISE, -there are features in place to make the VSCode experience more natural -for users of the ISE. - -This document tries to list settings you can configure in VSCode -to make the user experience a bit more familiar compared to the ISE. - -## Key bindings - -| Function | ISE Binding | VSCode Binding | -| ---------------- | ----------- | -------------- | -| Interrupt and break debugger | Ctrl+B | F6 | -| Execute current line/highlighted text | F8 | F8 | -| List available snippets | Ctrl+J | Ctrl+Alt+J | - -### Custom Keybindings - -You can [configure your own keybindings](https://code.visualstudio.com/docs/getstarted/keybindings#_custom-keybindings-for-refactorings) -in VSCode as well. - -## Tab completion - -To enable more ISE-like tab completion, add this setting: - -```json -"editor.tabCompletion": "on" -``` - -This is a setting added directly to VSCode (rather than in the extension), -so its behavior is determined by VSCode directly and cannot be changed by the extension. - -## No focus on console when executing - -To keep the focus in the editor when you execute with F8: - -```json -"powershell.integratedConsole.focusConsoleOnExecute": false -``` - -The default is `true` for accessibility purposes. - -## Do not start integrated console on startup - -To stop the integrated console on startup, set: - -```json -"powershell.integratedConsole.showOnStartup": false -``` - -**Note:** The background PowerShell process will still start, -since that provides intellisense, script analysis, symbol navigation, etc. -But the console will not be shown. - -## Assume files are PowerShell by default - -To make new/untitled files register as PowerShell by default: - -```json -"files.defaultLanguage": "powershell" -``` - -## Color scheme - -There are a number of ISE themes available for VSCode -to make the editor look much more like the ISE. - -In the [Command Palette] -type `theme` to get `Preferences: Color Theme` and press Enter. -In the drop down list, select `PowerShell ISE`. - -You can set this in the settings with: - -```json -"workbench.colorTheme": "PowerShell ISE" -``` - -## PowerShell Command Explorer - -Thanks to the work of [@corbob](https://github.com/corbob), -the PowerShell extension has the beginnings of its own command explorer. - -In the [Command Palette] -enter `PowerShell Command Explorer` and press Enter. - -## Open in the ISE - -If you end up wanting to open a file in the ISE anyway, -you can use Shift+Alt+P. - -## Other resources - -- 4sysops has [a great article](https://4sysops.com/archives/make-visual-studio-code-look-and-behave-like-powershell-ise/) - on configuring VSCode to be more like the ISE. -- Mike F Robbins has [a really good post](https://mikefrobbins.com/2017/08/24/how-to-install-visual-studio-code-and-configure-it-as-a-replacement-for-the-powershell-ise/) on setting up VSCode. -- Learn PowerShell has [an excellent write up](https://www.learnpwsh.com/setup-vs-code-for-powershell/) - on getting VSCode setup for PowerShell. - -## More settings - -If you know of more ways to make VSCode feel more familiar -for ISE users, please contribute to this doc. -If there's a compatibility configuration you're looking for, -but you can't find any way to enable it, -please [open an issue](https://github.com/PowerShell/vscode-powershell/issues/new/choose) -and ask away! - -We are always happy to accept PRs and contributions as well! - -## VSCode Tips - -### Command Palette - -F1 OR Ctrl+Shift+P -(Cmd+Shift+P on macOS) - -A handy way of executing commands in VSCode. -See [the VSCode docs](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette) -for more details. - -[Command Palette]: #command-palette From 9812f547e0b0a9dbd3f0ec9c978dd0c2110b2018 Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Mon, 1 Jul 2019 11:30:07 -0700 Subject: [PATCH 4/5] Update troubleshooting.md --- docs/troubleshooting.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 83a4f79e79..5f064c5be5 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -42,9 +42,9 @@ and you can ask for new features [in their repository](https://github.com/Micros - Highlighting/completions/command history don't work as I expect in the Integrated Console - [#535] - The Integrated Console implements a [custom host] - to work with VSCode, making it incompatible with - [PSReadLine] (the module providing these features in regular PowerShell). - Resolving this incompatibility is being actively worked on. + to work with VSCode, meaning that functionality could be different than that of the regular host in the PowerShell Console + - [PSReadLine] (the module providing these features in regular PowerShell) is available in the PowerShell Preview Extension, helping to bridge this gap + - Making PSReadline fully available is being actively worked on. - Command history is not preserved when debugging in the Integrated Console - [#550] - This feature is also provided by [PSReadLine]. @@ -61,8 +61,7 @@ and you can ask for new features [in their repository](https://github.com/Micros - "Go to Definition" doesn't work through module imports - [#499] - Again this is a best-effort task. - Completions don't cycle when Tab is pressed like in the ISE - [#25] - - VSCode itself provides the user experience for completions, and they - currently don't allow us to customize this. + - [Use the tab comletion settings in VSCode](https://docs.microsoft.com/en-us/powershell/scripting/components/vscode/how-to-replicate-the-ise-experience-in-vscode?view=powershell-6#tab-completion) - My command that opens a dialog does nothing - [#410 (comment)] - Check that the dialog hasn't opened behind VSCode. This is a known [VSCode issue]. @@ -76,6 +75,7 @@ and you can ask for new features [in their repository](https://github.com/Micros may be opportunities to improve our integration with it in the [PowerShell Extension] too. - `Write-Progress` doesn't output to the console - [#140] + - `Write-Progress` is available in the PowerShell Preview Extension ## Reporting an Issue @@ -133,7 +133,8 @@ For solving most issues, the following information is important to provide: ### Logs -Logs provide context for what was happening when the issue occurred +Logs provide context for what was happening when the issue occurred. +**Note: You should skim through your logs for any sensitive information you would not like to share online** - Before sending through logs, try and reproduce the issue with **log level set to Verbose** or **Diagnostic**. You can set this @@ -148,7 +149,6 @@ Logs provide context for what was happening when the issue occurred ```json "powershell.developer.editorServicesLogLevel": "Diagnostic" ``` - After you have captured the issue with the log level turned up, you may want to return it (since verbose logging can use disk space): @@ -171,7 +171,7 @@ Logs provide context for what was happening when the issue occurred For example: ```powershell - $HOME/vscode/extensions/ms-vscode.powershell-1.8.4/logs + $HOME/vscode/extensions/ms-vscode.powershell-2019.5.1/logs ``` - In VSCode you can open and read the logs directly from the [Command Palette] From 4dd621d56303cc5bfefab2df258f96429f72a6df Mon Sep 17 00:00:00 2001 From: Sydney Smith <43417619+SydneyhSmith@users.noreply.github.com> Date: Mon, 1 Jul 2019 11:32:59 -0700 Subject: [PATCH 5/5] Update development.md --- docs/development.md | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/docs/development.md b/docs/development.md index 0167ef38a9..c7f7c4b136 100644 --- a/docs/development.md +++ b/docs/development.md @@ -16,7 +16,7 @@ to before you can proceed. Insiders means the extension can be developed ready for new features and changes in the next VSCode release. -5. Install [Node.js](https://nodejs.org/en/) 8.x or higher. +5. Install [Node.js](https://nodejs.org/en/) 10.x or higher. ## Building the Code @@ -45,18 +45,6 @@ press Ctrl+F5 or Cmd+F5 on macOS. code --extensionDevelopmentPath="c:\path\to\vscode-powershell" . ``` -## Building a "Preview" version - -To build a preview version of the extension, that is to say, -a version of the extension named "PowerShell Preview", -You can simply change the `name` in the package.json to include `-Preview` at the end. -When you build, this will: - -- Add a warning to the top of the README.md to warn users not to have the stable and preview version enabled at the same time -- Adds "Preview" in a few places in the package.json - -This mechanism is mostly used for releases - ## Contributing Snippets For more information on contributing snippets please read our [snippet requirements](https://github.com/PowerShell/vscode-powershell/blob/master/docs/community_snippets.md#contributing).