PowerShell Extension for Visual Studio Code July 2022 Update

This post was originally published on this site

We are excited to announce that the July update to the PowerShell Extension for Visual Studio Code

is now available on the extension marketplace.

This release renames the “PowerShell Integrated Console” to the “PowerShell Extension Terminal” to align with VS Code’s verbiage, adds many regression tests, and includes a number of bug fixes!

Updates in the July release

Note that these updates all shipped in our PowerShell Preview Extension
for VS Code before shipping in our stable channel.

Some highlights of July release:

For the full list of changes please refer to our changelog.

Improvements to our tests

We are currently building out regression tests for the extension to cover everything we broke and subsequently fixed during the major rewrite earlier this year. We have a strong focus on quality,
and want to ensure we continue to deliver a production-ready, high-quality extension to you, our users.
We have made a large investment in improving the extension so we want to be able to
confidently continue to iterate on this project without inadvertently impacting the performance, stability, or feature set.

We’ve begun this work already, and are tracking in our GitHub repository.

Some highlights of this work so far include:

Getting support and giving feedback

While we hope the new implementation provides a much better user experience, there are bound to be issues. Please let us know if you run into anything.

If you encounter any issues with the PowerShell Extension in Visual Studio Code or have feature requests, the best place to get support is through our GitHub repository.

Sydney
PowerShell Team

The post PowerShell Extension for Visual Studio Code July 2022 Update appeared first on PowerShell Team.

PowerShellGet 3.0 Preview 16

This post was originally published on this site

We are excited to announce that an update to our preview of PowerShellGet 3.0 is now available on the PowerShell Gallery!

This release includes ScriptFileInfo cmdlets, Update-ModuleManifest support, and an AuthenticodeCheck for Install.

How to Install PowerShellGet 3.0 Preview 16

Prerequisites

Please note that this preview release of PowerShellGet 3.0 does not support PowerShell 7.0, 7.1 or 7.2-preview1.

This is a temporary issue due to a dependency and should be resolved in future releases. This release does support Windows PowerShell 5.1, PowerShell 7.2 and 7.3-previews.

Please ensure that you have the latest (non-prerelease) version of PowerShellGet and PackageManagement installed. To check the version you currently have installed run the command Get-InstalledModule PowerShellGet, PackageManagement

The latest version of PowerShellGet is 2.2.5, and the latest version of PackageManagement is 1.4.7. To install the latest versions of these modules run the following: Install-Module PowerShellGet -Force -AllowClobber

Installing the Preview

To install this preview release side-by-side with your existing PowerShellGet version, open any PowerShell console and run: Install-Module PowerShellGet -Force -AllowPrerelease

What to expect in this update

This update adds a number of cmdlets related to package metadata as well as a new -AuthenticodeCheck parameter for Install-PSResourceSave-PSResourceUpdate-PSResource.

Features of this release

  • New-ScriptFileInfo
  • Update-ScriptFileInfo
  • Test-ScriptFileInfo
  • Update-ModuleManifest
  • Implementation of Authenticode validation via -AuthenticodeCheck for Install-PSResource

Bug Fixes

  • Bug fix for installing modules with manifests that contain dynamic script blocks

Using -AuthenticodeCheck

In PowerShellGetv2 we performed what was called a PublisherCheck, for the sake of clarity in PowerShellGet 3.0 we have renamed this check to be specific to the check being made. The parameter is now opt-in and is called -AuthenticodeCheck. This check validates signed files and catalog files on Windows.

Features to Expect in Coming Preview Releases

This module is not yet complete. The focus for our next preview release is improving the performance of find/install. For the full list of issues for our next preview release please refer to our GitHub project.

How to Track the Development of this Module

GitHub is the best place to track the bugs/feature requests related to this module. We have used a combination of projects and labels on our GitHub repo to track issues for this upcoming release. We are using the label Resolved-3.0 to label issues that we plan to release at some point before we release the module as GA (generally available).

To track issues/features for the next release, please refer to this GitHub project.

Timeline/Road Map

Expect to see preview releases as new functionality is added and bug fixes are made. User feedback will help us determine when we can have a Release Candidate version of the module which will be supported to be used in production. Based on user feedback, if we believe the 3.0 release is complete, then we will publish a 3.0 version of the module as Generally Available. Since these milestones are driven by quality, rather than date, we cannot offer an exact timeline at this point.

How to Give feedback and Get Support

We cannot overstate how critical user feedback is at this stage in the development of the module. Feedback from preview releases help inform design decisions without incurring a breaking change once generally available and used in production.

In order to help us to make key decisions around the behavior of the module please give us feedback by opening issues in our GitHub repository.

Sydney Smith

PowerShell Team

The post PowerShellGet 3.0 Preview 16 appeared first on PowerShell Team.

Archive Module 2.0 Preview 1

This post was originally published on this site

We are excited to announce that the first preview of a rewrite of Microsoft.PowerShell.Archive, the module that lets you create and extract archives, is now available on the PowerShell Gallery.

This release is the first preview release of a rewrite of the module and is not feature complete. Please note that this release only contains the Compress-Archive cmdlet and is only compatible with PowerShell 7.3.0-preview5 and up. For more information on what is proposed in this rewrite, or to give feedback on the design please refer to the RFC.

Goals of the 2.0 release

The goal for the Archive module is to build a high-performing and maintainable module that offers high utility and works cross-platform (especially with regard to file paths).

Currently, the archive module has a number of limitations. The module supports the zip32 format only. .NET 7 is planned to support the tar archive format, so there is an opportunity to support an additional archive format by taking advantage of these new APIs. Meanwhile, this opportunity can be leveraged not only to add tar support, but to rewrite the entire module in C# and address existing usability issues.

The module has limited performance compared to other archive software. Although performance is dictated by the .NET APIs, a rewrite of the module in C# can reduce the overhead from script modules and address performance issues to an extent.

The module has limited cross-platform support because archive entries are written in an OS-specific way due to different characters being used as directory separators in different OSs. This makes it difficult for Unix-based OS users to use archives compressed on a Windows computer or vice versa. The rewrite of the module can solve this problem by normalizing all paths to use Unix directory separators (the ‘/’ character) across all platforms.

There are a number of issues in regard to using wildcard characters in paths. For example, in some cases, wildcard characters are not interpreted literally, which makes it difficult to use paths containing wildcard characters to specify the location of the archive.

In some circumstances, error reporting can be improved and more descriptive. Compatibility with other archive software can also be improved as there are cases where an archive program may not recognize an archive produced by this module as valid. Interactions with other parts of PowerShell, such as the job system, advanced functions, and common parameters can be further improved, so that users can have a seamless experience when using the module.

Additionally, .NET has supported creating large archives and compressing large files, but the archive module has lacked support for this. It makes sense to support archive formats that are supported by .NET, such as zip64 and tar, and to provide options that .NET also provides. The next version of the archive module, Microsoft.PowerShell.Archive v2.0.0, plans on resolving these limitations and usability issues.

Installing the module

Please note that this release will only work with PowerShell 7.3.0-preview5 and up. Find and install the latest preview version of PowerShell here.

To install the Microsoft.PowerShell.Archive 2.0 preview 1 run the following command

Install-Module Microsoft.PowerShell.Archive -AllowPrerelease

Features of the release

This release is not feature complete and only contains the rewrite of the Compress-Archive cmdlet.

This cmdlet contains two parameter sets

    Compress-Archive [-Path] <string[]> [-DestinationPath] <string> [-WriteMode {Create | Update | Overwrite}] [-PassThru] [-CompressionLevel {Optimal | Fastest |
    NoCompression | SmallestSize}] [-Format {zip}] [-WhatIf] [-Confirm] [<CommonParameters>]

    Compress-Archive [-LiteralPath] <string[]> [-DestinationPath] <string> [-WriteMode {Create | Update | Overwrite}] [-PassThru] [-CompressionLevel {Optimal |
    Fastest | NoCompression | SmallestSize}] [-Format {zip}] [-WhatIf] [-Confirm] [<CommonParameters>]

Some features to note of this release

  • Support for zip32 & zip64
  • Preserves relative path structure (when relative paths are specified)
  • Improved performance from previous versions of the cmdlet
  • New -WriteMode support in case of destination path collisions

Features of the next release

The next release will focus in the Expand-Archive cmdlet. To track the progress of this release, look at this project in our GitHub repository.

Giving Feedback and Getting support

While we hope the new implementation provides a much better user experience, there are bound to be issues. Please let us know if you run into anything.

If you encounter any issues with the PowerShell Extension in Visual Studio Code or have feature requests, the best place to get support is through our GitHub repository.

Abdullah Yousuf

Sydney Smith

The post Archive Module 2.0 Preview 1 appeared first on PowerShell Team.

PowerShell Extension for Visual Studio Code June 2022 Update

This post was originally published on this site

We are excited to announce that an update to the PowerShell Extension for Visual Studio Code is now available on the extension marketplace.

This release fixes a number of issues related to IntelliSense and enables updates to PowerShell Editor Services (the engine of the VS Code extension) for other clients, such as Emacs and Vim with LSP plug-ins.

Updates from the June releases

Some highlights of June releases:

For the full list of changes please refer to our changelog.

IntelliSense improvements

In this release we have made a number of improvements to IntelliSense (the general term for various code editing features including: code completion, parameter info, tool-tip hovers, etc.).

Mark completion request handler as serial

Previously, if you typed Get- very quickly, you’d get no results at all. This stops completion from being cancelled whenever a DidChangeTextDocument notification is sent. This also lets completion cancel some other expensive requests like code lenses, which means everything is both speedier and less flaky.

Fix tasks never completing if cancelled quickly

We were exiting SynchronousTask.ExecuteSynchronously early if the cancellation was already requested. This was not setting our state correctly, causing the caller to just fall off without warning. This made some things like finally and using disposals never happen, which led to a lot of erratic behavior!

Make alias discovery possible on idle

The use of Runspace.SessionStateProxy while the pipeline thread is busy (even if you are on the pipeline thread) results in an exception. By fixing this we can also cancel GetAliasesAsync (a slow operation) when needed, and do it while idling instead of startup.

Add “space” character to completion trigger characters

Adding the “space” character to completion triggers lets us automatically give completion results for parameter values. This also required building in some support for marking completion results as “incomplete”. This means that the client will not cache results when standard identifier characters are typed.

Mainly, this solves the scenario where you type space, get file completion results, and then type -. You expect to then get parameter names, but without marking “incomplete”, it will instead filter the file results.

Also fixed a scenario where you type $script: and on typing the : it would not update to available script scope variables.

Make completion requests cancellable

Now any completion results from custom argument completers can be cancelled if they take too long and the user keeps typing. In non-remote runspaces, we can also use it as a completion source that we can cancel by way of issuing a pipeline stop request.

What’s next for the project?

We are currently building out regression tests for the extension to cover everything we broke and subsequently fixed during the major rewrite earlier this year. We have a strong focus on quality, and want to ensure we continue to deliver a production-ready, high-quality extension to you, our users. We have made a large investment in improving the extension so we want to be able to confidently continue to iterate on this project without inadvertently impacting the performance, stability, or feature set. We’ve begun this work already, and are tracking in our GitHub repository.

Getting support and giving feedback

While we hope the new implementation provides a much better user experience, there are bound to be issues. Please let us know if you run into anything.

If you encounter any issues with the PowerShell Extension in Visual Studio Code or have feature requests, the best place to get support is through our GitHub repository.

Sydney

PowerShell Team

The post PowerShell Extension for Visual Studio Code June 2022 Update appeared first on PowerShell Team.