Skip to content

Releases: PowerShell/vscode-powershell

v1.5.0

27 Oct 18:50
Compare
Choose a tag to compare

Fixes and Improvements

v1.4.3

13 Sep 15:26
Compare
Choose a tag to compare
  • #1016 - Fixed a conflict with the "Azure Resource Manager for Visual Studio Code" extension which prevented the PowerShell extension from loading successfully.

v1.4.2

06 Sep 00:50
Compare
Choose a tag to compare
  • #993 - powershell.powerShellExePath using Sysnative path should be automatically corrected when using 64-bit Visual Studio Code
  • #1008 - Windows PowerShell versions (x64 and x86) are not enumerated correctly when using 64-bit Visual Studio Code
  • #1009 - PowerShell version indicator in status bar is missing tooltip #1020 - "Show Session Menu", "Show Integrated Console", and "Restart Current Session" commands should cause PowerShell extension to be activated
  • #1020 - "Show Session Menu", "Show Integrated Console", and "Restart Current Session" commands should cause PowerShell extension to be activated

v1.4.1

22 Jun 21:55
Compare
Choose a tag to compare

v1.4.0

21 Jun 16:09
Compare
Choose a tag to compare

New HTML content view commands enabling custom UI tabs

You can now show editor tabs with custom HTML-based UI by using the new HTML content view commands! This is the first step toward UI extensions for VS Code written in PowerShell.

Here's an example:

$view = New-VSCodeHtmlContentView -Title "My Custom View" -ShowInColumn One
Set-VSCodeHtmlContentView -View $view -Content "<h1>Hello world!</h1>"
Write-VSCodeHtmlContentView $view -Content "<b>I'm adding new content!</b><br />"

And here's the result:

HTML view demo

Check out the cmdlet help for the following commands to learn more:

  • New-VSCodeHtmlContentView
  • Show-VSCodeHtmlContentView
  • Close-VSCodeHtmlContentView
  • Set-VSCodeHtmlContentView
  • Write-VSCodeHtmlContentView

Since this is a first release, we've restricted the use of JavaScript inside of the HTML. We will add this capability in a future release!

Code formatting setting presets for common styles

We've now added code formatting presets for the most common code style conventions used in the PowerShell community. You can now set the powershell.codeFormatting.preset setting to one of the following presets:

  • OTBS - Known as the "One True Brace Style". Causes else, catch, and other keywords to be "cuddled", keeping them on the same line as the previous closing brace:

    if ($var -eq $true) {
      # Do the thing
    } else {
      # Do something else
    }
  • Stroustrup - Causes beginning curly braces to be placed on the same line as the statement:

    if ($var -eq $true) {
      # Do the thing
    }
    else {
      # Do something else
    }
  • Allman - All curly braces are preceded by a newline:

    if ($var -eq $true)
    {
      # Do the thing
    }
    else
    {
      # Do something else
    }
  • Custom - Allows full customization of the code formatting settings.

In addition, code formatting now respects your editor.insertSpaces and editor.tabSize settings!

Debugging in a temporary PowerShell Integrated Console

We've added the ability to debug your PowerShell code in a temporary PowerShell Integrated Console so that you have a fresh runspace and PowerShell process each time you hit F5!

This setting is necessary if you are developing with PowerShell 5 classes or modules using .NET assemblies because .NET types cannot be reloaded inside of the same PowerShell process. This new setting
saves you from reloading your PowerShell session each time you debug your code!

You can configure this behavior in two ways:

  • Use the launch.json configuration parameter createTemporaryIntegratedConsole:

    {
      "type": "PowerShell",
      "request": "launch",
      "name": "PowerShell Launch Current File in Temporary Console",
      "script": "${file}",
      "args": [],
      "cwd": "${file}",
      "createTemporaryIntegratedConsole": true
    },
  • Configure the setting powershell.debugging.createTemporaryIntegratedConsole:

    "powershell.debugging.createTemporaryIntegratedConsole": true,

The default value for these settings is false, meaning that the temporary console behavior is opt-in.

Configuring the user or workspace setting will cause all debugging sessions to be run in a temporary Integrated Console so it's useful if you would prefer this to be the default behavior. The launch.json setting overrides the user setting so you can always customize the behavior for a specific launch configuration.

NewFile() API and Out-CurrentFile command

You can now create a new untitled file from within the Integrated Console by using the $psEditor.Workspace.NewFile() command! Also, you can send the formatted output of any PowerShell command to the current file by using the Out-CurrentFile command:

Get-Process | Out-CurrentFile

Special thanks to Doug Finke for the contribution!

Other fixes and improvements

  • #881 - When you select a different PowerShell version in the session menu, your choice is persisted to the powershell.powerShellExePath setting.

  • #891 - Pester CodeLenses now run tests without string interpolation of test names

v1.3.2

12 Jun 20:17
Compare
Choose a tag to compare

Fixes and improvements

v1.3.1

10 Jun 00:12
Compare
Choose a tag to compare

Fixes and improvements

  • #850 -
    Fixed an issue where lower-cased "describe" blocks were not identified by
    the CodeLens feature.

  • #851 -
    Fixed an issue where the language server would hang when typing out a describe
    block.

  • #852 -
    Fixed an issue where Pester test names would not be detected correctly when
    other arguments like -Tags were being used on a Describe block.

v1.3.0

09 Jun 18:41
Compare
Choose a tag to compare

CodeLens for running and debugging Pester tests

We've added two new CodeLens actions that show up above Describe blocks in your Pester tests, "Run tests" and "Debug tests". By clicking one of these CodeLenses, your tests will be executed in the Integrated Console with the debugger attached. You can now set breakpoints and quickly debug a portion of your test script:

Pester CodeLens

CodeLens support for finding references of a function or cmdlet

We've also added CodeLenses for showing the number of references for a function or cmdlet that is defined in a script. If you click this CodeLens, the references pane will appear so that you can navigate through all of the references:

References CodeLens

We will add CodeLens support for PowerShell 5+ classes and class methods in a future update!

Document symbol support for Pester tests

We've also added document symbol support for Pester tests so that you can easily navigate among the Describe, Context, and It blocks in large Pester script files:

Pester symbols

New PowerShell ISE theme

We now include a new color theme that tries to provide a faithful interpretation of the PowerShell ISE's style, including a blue console background! To use this theme open the Command Palette (Ctrl+Shift+P), run the "Preferences: Color Theme" command, then select "PowerShell ISE".

ISE theme

This is a first attempt at making this happen so give us feedback if you think that the colors can be improved! Super huge thanks to Matt McNabb for putting this together!

New cmdlets inside the Integrated Console

Thanks to new PowerShell Editor Services co-maintainer Patrick Meinecke, we've gained a new set of useful commands for interacting with the $psEditor APIs within the Integrated Console:

This should also resolve the issues some people were seeing when we tried to load the unsigned temporary script containing Register-EditorCommand on machines with an AllSigned execution policy (#784).

Fixes and improvements

  • #827 - Fixed an issue where an Output panel will appear with an error when you close the PowerShell Integrated Terminal

v1.2.1

01 Jun 20:13
Compare
Choose a tag to compare

Fixes and improvements

  • PowerShell/PowerShellEditorServices#478 - Dynamic comment help snippets now generate parameter fields correctly when <# is typed above a param() block.

  • #808 - An extra PS> is no longer being written to the Integrated Console for some users who have custom prompt functions.

  • #813 - Finding references of symbols across the workspace now properly handles inaccessible folders and file paths

  • #810 - $psEditor.GetEditorContext() now doesn't throw exceptions when in an untitled file

  • #807 - The users's previously selected PowerShell session type is now retained when running the "PowerShell: Restart Current Session" command.

  • #821 - Note properties on PSObjects are now visible in the debugger's Variables view

v1.2.0

31 May 15:53
Compare
Choose a tag to compare

Dynamic comment-based help snippets now work inside functions (#763)

You asked for it, you got it! Dynamic comment-based help snippets now work inside function definitions, both above the param() block and at the end of the function body:

Comment help GIF

NOTE: There is an issue where parameter sections don't get generated inside of a function with a [CmdletBinding()] attribute. This is being tracked at PowerShell/PSScriptAnalyzer#768.

Session menu now contains entries for PowerShell Core installations on Windows (#794)

It's now much easier to switch between Windows PowerShell and PowerShell Core installs on Windows. When you run the "PowerShell: Show Session Menu" command or click the PowerShell version indication in the status bar you'll now see PowerShell Core entries in the menu:

Session menu

Improved PSScriptAnalyzer marker display and suppression snippets (#781) and (#783)

The green squiggle markers you receive from PSScriptAnalyzer now include the name of the corresponding rule in their description:

Rule name

This is really helpful with the new rule suppression snippets contributed by Jos Verlinde! You can access them by typing suppress- and selecting one of the suppression snippet options:

Suppress rule

New built-in Pester problem matcher (#798)

We now include a built-in problem matcher for Pester test output so that you don't need to define one in your tasks.json file any longer! You can reference the built-in problem matcher in your test tasks by using the name $pester:

    {
        "taskName": "Test",
        "suppressTaskName": true,
        "isTestCommand": true,
        "showOutput": "always",
        "args": [ "Invoke-Pester -PesterOption @{IncludeVSCodeMarker=$true}" ],
        "problemMatcher": "$pester"
    }

NOTE: There is an issue with problem matchers when using the new 2.0.0 version of VS Code's task runner. Pester errors may show up multiple times in the Problems panel. This issue is being tracked at #797.

Other fixes and improvements

  • #710 - Variable definitions can now be found across the workspace

  • #771 - Improved dynamic comment help snippet performance in scripts with many functions

  • #786 - Running the "Show Integrated Console" command will now start the extension if it isn't already started

  • #774 - Pressing Enter now causes custom prompt functions to be fully evaluated

  • #770 - Fixed issue where custom prompt function might be written twice when starting the integrated console

  • #767 - Fixed placeholder navigation for many built-in snippets

  • #782 - Fixed extension host crash when restarting the PowerShell session

  • #737 - Fixed hangs and high CPU when restarting or switching between PowerShell sessions

  • #777 - Changed "Starting PowerShell" message to clearly indicate that we're in the PowerShell Integrated Console