github PowerShell/vscode-powershell v0.8.0

latest releases: v2024.2.1, v2024.2.0, v2024.3.2-preview...
pre-release7 years ago

Improved PowerShell session management

It's now much easier to manage the active PowerShell session. We've added a
new item to the status bar to indicate the state of the session and the version
of PowerShell you're using:

Screenshot of status indicator

When this status item is clicked, a new menu appears to give you some session
management options:

Screenshot of session menu

You can restart the active session, switch between 32-bit and 64-bit PowerShell on
Windows or switch to another PowerShell process (like a 6.0 alpha build) that
you've configured with the powershell.developer.powerShellExePath.

We've also improved the overall experience of loading and using the extension:

  • It will prompt to restart the PowerShell session if it crashes for any reason
  • It will also prompt to restart the session if you change any relevant PowerShell
    configuration setting like the aforementioned powershell.developer.powerShellExePath.
  • You can easily access the logs of the current session by running the command
    Open PowerShell Extension Logs Folder.

Create new modules with Plaster

In this release we've added integration with the Plaster
module to provide a Create New Project from Plaster Template command. This command will
walk you through the experience of selecting a template and filling in all of
the project details:

Screenshot of Plaster template selection

Screenshot of Plaster input

We include one basic project template by default and will add more in the very
near future. However, you won't need to update the PowerShell extension to get these
new templates, they will appear when you install an update to the Plaster module from
the PowerShell Gallery.

Check out Plaster's documentation
for more details on how it can be used and how you can create your own templates.

New "quick fix" actions for PSScriptAnalyzer rules

The PowerShell extension now uses any "suggested corrections" which are returned with
a rule violation in your script file to provide a "quick fix" option for the affected
section of code. For example, when the PSAvoidUsingCmdletAliases rule finds the use
of a non-whitelisted alias, you will see a light bulb icon that gives the option to
change to the full name (right click or Ctrl+. on the marker):

Screenshot of PSScriptAnalyzer quick fix

If you'd like to see more quick fixes for PowerShell code, head over to the
PSScriptAnalyzer GitHub page and
get involved!

Easily enable and disable PSScriptAnalyzer rules

Another improvement related to PSScriptAnalyzer is the ability to change the active
PSScriptAnalyzer rules in the current editing session using a helpful selection menu:

Screenshot of PSScriptAnalyzer rule selection

You can enable and disable active rules by running the Select PSScriptAnalyzer Rules
command. For now this only changes the active session but in a future release we will
modify your PSScriptAnalyzer settings file so that the changes are persisted to future
editing sessions.

New "hit count" breakpoints in the debugger

When debugging PowerShell scripts you can now set "hit count" breakpoints which
cause the debugger to stop only after the breakpoint has been encountered a specified
number of times.

Screenshot of a hit count breakpoint

Other fixes and improvements

  • We now provide snippets for the launch.json configuration file which make it easier
    to add new PowerShell debugging configurations for your project.
  • In PowerShell launch.json configurations, the program parameter has now been
    renamed to script. Configurations still using program will continue to work.
  • Fixed #353: Cannot start PowerShell debugger on Windows when offline
  • Fixed #217: PowerShell output window should be shown when F8 is pressed
  • Fixed #292: Check for Homebrew's OpenSSL libraries correctly on macOS
  • Fixed #384: PowerShell snippets broken in VS Code 1.8.0

Don't miss a new vscode-powershell release

NewReleases is sending notifications on new releases.