The post AI Shell Preview 4 Release! appeared first on PowerShell Team.
]]>We’re excited to share the latest preview release of AI Shell that includes new features and
improvements based on your feedback. This release focuses on improving the user experience by
improving access to Azure OpenAI deployments, improvements to the Invoke-AIShell
command, and
expanded compatibility with macOS.
We’ve made significant improvements to the macOS side car experience with iTerm2. Previously, the
side car experience was unreliable and didn’t support the /code post
command. Now you have a more
reliable experience with feature parity with your experience on Windows. For this experience you
need to run PowerShell 7 in iTerm2. For more information about PowerShell 7 on macOS, see
Installing PowerShell on macOS.
To keep password and keys secure, we’ve added support for Entra ID authentication to to Azure OpenAI instances. Now you can access your Azure OpenAI resource without storing keys in the configuration file. The following example shows how to configure Entra ID authentication:
{
// Declare GPT instances.
"GPTs": [
// Declaration of an Azure OpenAI instance with EntraID authentication
{
"Name": "ps-az-entraId",
"Description": "A GPT instance with expertise in PowerShell scripting using Entra ID authentication.",
"Endpoint": "<Your Endpoint>",
"Deployment": "<Your Deployment Name>",
"ModelName": "<Your Model Name>",
"AuthType": "EntraID",
"SystemPrompt": "You are a helpful and friendly assistant with expertise in PowerShell scripting and command line."
}
],
// Specify the default GPT instance to use for user query.
"Active": "ps-az-entraId"
}
This is the hierarchy of credentials that AI Shell will use to authenticate to Azure OpenAI:
EnvironmentCredential
WorkloadIdentityCredential
ManagedIdentityCredential
SharedTokenCacheCredential
VisualStudioCredential
AzureCliCredential
AzurePowerShellCredential
AzureDeveloperCliCredential
InteractiveBrowserCredential
For more information on what these particular credentials are, please see the DefaultAzureCredential reference.
We’ve added additional parameters to the Invoke-AIShell
command to allow for easier use of the
side pane without leaving the left side of the screen.
-PostCode
– This parameter allows you to post code generated from the side pane to the connected
PowerShell session. It reduces the need to switch between the side pane and terminal to run the
/code post
command.-CopyCode
– This parameter allows you to copy code from the side pane without using the
/code copy
command.-Exit
– This parameter allows you to exit the side pane without using the /exit
command.These new parameters allow you to use your terminal normally. You can inject AI generated commands without cluttering your main buffer and keep all the details and descriptions in the side pane. This is a great way to use AI Shell as side by side shell assistant! Coupled with PSReadLine Predictive IntelliSense, you can quickly and easily use AI Shell in your normal shell workflow.
We’ve added a new experimental agent called Phi Silica. This agent uses the built-in Phi Silica model included with the latest Copilot+ PCs, allowing you to have an offline experience with AI Shell.
Note
This agent isn’t shipped with the default installation of AI Shell. To use this agent, you need to clone the repo and build the code. Follow the instructions at Locally Building AI Shell.This experimental AI provider is a proof of concept that’s still under development. You should only use it for testing. Expect breaking changes in future releases.
Here are a few additional improvements that have been made in this release:
To see the full list of changes, check out the changelog in the release page.
To install the latest version of AI Shell, run the following command in your PowerShell terminal:
Invoke-Expression "& { $(Invoke-RestMethod 'https://aka.ms/install-aishell.ps1') }"
As usual we would love for you to try AI Shell and provide feedback in our GitHub repository.
Thanks so much!
AI Shell Team
Steven Bucher & Dongbo Wang
The post AI Shell Preview 4 Release! appeared first on PowerShell Team.
]]>The post Announcing AI Shell Preview 2 appeared first on PowerShell Team.
]]>We’re excited to announce the Preview 2 release of AI Shell! With this update you can expect the following improvements:
AI Shell Preview 3 is released!
Preview 3 has been released just two weeks after Preview 2 due to a backend issue affecting the Azure Agent. This update addresses the problem, ensuring more reliable interactions with Azure services.The improvements to the azure
agent are designed to reduce friction when managing Azure resources
with the Azure CLI and PowerShell. The agent now offers deeper integration with Azure PowerShell,
making it easier to use AI-created Azure PowerShell scripts.
/replace
command now supports Azure PowerShell. The agent walks you through replacement of
parameter values in generated Azure PowerShell responses.Connect-AzAccount
command.
Previously, the agent only supported Azure CLI authentication.With this release, the openai-gpt
agent extends support to third party models that follow the
OpenAI API specifications, allowing for a more flexible AI experience. Many of these models are open
source tools for running SLMs and LLMs locally. The openai-gpt
agent nows supports the following
additional models:
To use these models, you only need to configure the endpoint
, key
and model name
in the agent
config file. The following openai.agents.config
file contains example configurations for two of
the new AI providers.
{
"GPTs": [
{
"Name": "gpt-deepseek",
"Description": "A GPT instance using DeepSeek v3.",
"Endpoint": "https://api.deepseek.com",
"ModelName": "deepseek-chat",
"Key": "<your-deepseek-api-key>",
"SystemPrompt": "You are a helpful assistant."
},
{
"Name": "gpt-gemini",
"Description": "A GPT instance using Google Gemini.",
"Endpoint": "https://generativelanguage.googleapis.com/v1beta/openai/",
"ModelName": "gemini-1.5-flash",
"Key": "<your-gemini-api-key>",
"SystemPrompt": "You are a helpful assistant."
}
]
"Active": "gpt-deepseek"
}
Resolve-Error
(alias fixit
) now uses the screen scraper API on Windows to capture the error
output of native commands. This allows AI Shell to provide better resolution of error messages that
come from native commands rather than from PowerShell.
We refactored the example code for the agent ollama
. This example provides the basic structure
that you can use to build out your own agent. The refactored code now uses the OllamaSharp
library and add the ability to configure the agent using settings files.
The ollama
agent isn’t shipped with AI Shell but you can build it yourself. See the instructions
in the locally build the repo section of the README. Thank you @kborowinski
on GitHub for
this contribution!
We added a Bicep template that deploys an Azure OpenAI instance in seconds. Using the template is much faster than manually creating an instance in the Azure portal. This template includes documentation with step by step instructions.
There are many bug fixes in this release. For a complete list of changes, see the changelog.
Use the following command in PowerShell 7 to install or upgrade AI Shell:
Invoke-Expression "& { $(Invoke-RestMethod 'https://aka.ms/install-aishell.ps1') }"
For more information, see Install AI Shell.
One piece of feedback we often hear is: How can I have AI Shell automatically start up when I open Windows Terminal?
It’s easy! Just add Start-AIShell
to your PowerShell profile script. Here’s how:
if ($PSVersionTable.PSVersion -ge ([version]'7.4.6') -and
(Get-Process -Id $pid).Parent.Name -eq 'WindowsTerminal') {
Start-AIShell
}
Now, AI Shell will automatically start when you open Windows Terminal.
NOTE
AI Shell only works with Windows Terminal and requires PowerShell 7.4.6 or higher.If you need help creating a profile scripts, see about_Profiles.
We would love to hear your feedback as we continue improving AI Shell. Join the discussion in our GitHub Issues and let us know how AI Shell is helping your automation workflows.
Stay tuned for future updates as we bring more AI-powered capabilities to your CLI experience.
Thanks!
Steven Bucher and Dongbo Wang
AI Shell Team
The post Announcing AI Shell Preview 2 appeared first on PowerShell Team.
]]>The post Microsoft Update changes for PowerShell 7 appeared first on PowerShell Team.
]]>It has been a while since we’ve updated folks on the latest behaviors for Microsoft Update! This post gives some background on Microsoft Update, explains our update rules, and announces our plans for updating your installs of PowerShell 7.2.
Microsoft Update (MU) is a service that provides automatic updates for Microsoft products and services. We first started using MU in PowerShell 7.2. MU provides a convenient way to automatically update PowerShell 7, which ensures you can control your update schedule, test it against your environment, and scale across your enterprise with ease.
During MSI installation, two checkboxes control update settings:
We recommend that you select both options to ensure comprehensive update coverage.
If you want to set these options while installing PowerShell from the command line, you can find detailed instructions in the PowerShell documentation.
After we release a new PowerShell version, it can take up to two weeks before the update is available through Microsoft Update. We strive to publish the update no later than 2 weeks after the GitHub release, but there is no guarantee. There may be circumstances that delay the update. If you need the update before it’s available via MU, you can download it directly from the PowerShell Releases page on GitHub.
We defined the rules for updates in an intentional way to ensure that users who are using LTS versions stay on LTS versions. This means that you might not be updated to the latest version of PowerShell 7 when you expected.
These are the rules for updates:
We will never update an LTS version to a stable non-LTS version, like 7.4 to 7.5. However, a stable non-LTS release WILL be upgraded to the higher LTS release when support for the stable release ends. The only time we update an LTS version to a different version would be when an LTS version is out of support. For example, we will update 7.4 to 7.6 (next LTS) once 7.4 goes out of support.
Preview versions will never be updated to the latest stable version. Instead, we will update you to the latest preview release. This means if you are on 7.5-rc.1 you will be updated to 7.6-preview.2 (since preview.1 was skipped) instead of 7.5.
NOTE
Beginning March 14, 2025, we will be updating users who are on 7.2 to 7.4.Hopefully this post helps you understand the MU process. If you want more information about our MU release process, PowerShell releases, or the PowerShell Support Lifecycle, check out the following articles.
As always, we look forward to your feedback. You can provide feedback via GitHub Issues.
Thank you so much!
Steven Bucher
PM on the PowerShell Team
The post Microsoft Update changes for PowerShell 7 appeared first on PowerShell Team.
]]>The post Announcing the Public Preview of AI Shell appeared first on PowerShell Team.
]]>We’re thrilled to unveil the public preview of AI Shell! AI Shell enhances your shell with AI capabilities to facilitate your interactions with the command line. AI Shell create an interactive shell that can interact with various large language model and provides a framework that you can use to build a custom system that meet your needs. Users can interact with the AI agents in a conversational manner.
The AI Shell project includes:
aish
) interfaceEach AI assistant is known as an agent. The initial release of AI Shell includes two agents:
NOTE
The Azure OpenAI agent needs additional configuration to connect to your Azure OpenAI instance. To get started, follow the instructions provided when you start start the agent.Recognizing that you may have different CLI command needs, AI Shell provides a framework for creating your own agents. For more information, see Creating an Agent.
We know every CLI user has their own preferences, so AI Shell offers two flexible modes to fit your workflow:
You can use AI Shell as a self-contained executable, allowing it to run independently from any shell. This setup is perfect if you’re looking for a dedicated, streamlined experience that’s easily accessible without dependencies.
This is the recommended method for using AI Shell because it enables an uninterrupted work flow. The
AIShell module connects the aish
tool to your PowerShell 7 session for deeply integrated user
experience. AI Shell opens in a side pane right next to your PowerShell 7 session that enables a
rich communication between panes, results from the chat can be carried seamlessly to your PowerShell
session for easy execution and the AI agent can be used to provide assistance to resolve a
PowerShell error.
Some system requirements are needed to run AI Shell.
AI Shell (aish
) and the AIShell module are separate downloads. For your convenience, we
created a script to download and install them for you.
Some prerequisites are needed to run AI Shell on Windows.
The following install script will:
aish.exe
to $env:LOCALAPPDATA\Programs\AIShell
and adds it to your PATHSome prerequisites are needed to run AI Shell on MacOS.
On MacOS, this script:
aish
executable to /usr/local/AIShell
and creates a symbolic link at
/usr/local/bin/aish
NOTE
This script only works on Windows and Mac systems. Linux users need to follow the manual installation instructions.To install AI Shell, run the following command in your PowerShell session:
Invoke-Expression "& { $(Invoke-RestMethod 'https://aka.ms/install-aishell.ps1') }"
To find details on manual installation please see, Installing AI Shell manually.
After running the install script, you can run Start-AIShell
to begin using AI Shell.
AI Shell starts in the side by side experience. You can switch between the agents by using the
@<agent name>
command. For example, to switch to the Azure OpenAI agent you would use the
@openai-gpt
command. Additionally you can do @<agent name> <question>
to send a question to the
agent immediately.
Copying and pasting a lot of code can be annoying. AI Shell makes it easy to insert the AI generated
code directly into your PowerShell 7 session with the /code post
command. In your AI Shell, run
/code post
or use the Ctrl+d,Ctrl+d keyboard shortcut
to copy the code into your PowerShell session.
If you are familiar with PowerShell 7 you may be familiar with Predictive Intellisense. When you get multi-step commands in your AI Shell response, you can easily get each subsequent step in your Predictive Intellisense buffer.
If you encounter an error in your working terminal, you can use the Resolve-Error
cmdlet to send
that error to the open AI Shell window for resolution. This command asks the AI model to help you
resolve the error.
One key scenario we wanted to support is being able to pipe output of one command into the AI Shell
to get more information or ask a follow up question on the data given. With the Invoke-AIShell
command you can easily do this.
Invoke-AIShell
can take input from the pipeline but also can just be used to call the AI agent
selected in AI Shell without having to switch back and forth.
There are other chat commands and hot-keys that make using AI Shell easier. For a full list of the chat commands, see the AI Shell reference.
Key bindings | Command | Functionality |
---|---|---|
Ctrl+d, Ctrl+c | /code copy |
Copy all the generated code snippets to clipboard |
Ctrl+<n> | /code copy <n> |
Copy the n-th generated code snippet to clipboard |
Ctrl+d, Ctrl+d | /code post |
Post all the generated code snippets to the connected application |
Ctrl+d,<n> | /code post <n> |
Post the n-th generated code snippet to the connected application |
Additionally, you can switch between the panes easier using the following keyboard shortcuts.
Key bindings | Functionality |
---|---|
Alt+RightArrow | Moves your cursor to the right AI Shell pane |
Alt+LeftArrow | Moves your cursor to the left PowerShell pane |
AI Shell was built for those who seek intelligence and adaptability from their command-line. With multi-agent support, AI Shell aims to be the assistant for any CLI tool. You’ll benefit from advanced AI capabilities, deeper integration with your PowerShell session, and an extensibility model to get the assistance you need.
This public preview is just the beginning. We’d love to hear your feedback and insights as we refine AI Shell to better serve the CLI and PowerShell community. Download it today in PowerShell with
Invoke-Expression "& { $(Invoke-RestMethod 'https://aka.ms/install-aishell.ps1') }"
Be sure to explore the capabilities of the Copilot in Azure and Azure OpenAI agents, and take command-line productivity to the next level! Feel free to give us feedback on the current tool and sign up for early access to future features at aka.ms/AIShell-Feedback.
Thank you so much!
Steven Bucher
Product Manager on the PowerShell/CLI Team
The post Announcing the Public Preview of AI Shell appeared first on PowerShell Team.
]]>The post PSReadLine 2.3.4 GA Release appeared first on PowerShell Team.
]]>We are excited to announce the general availability of PSReadLine 2.3.4! After three preview releases we are ready to release the GA version of PSReadLine 2.3.4. There are no new features in this release from the previous preview but wanted to highlight some of the key changes since the previous stable version, 2.2.6.
As usual, here are the instructions for installing the latest PSReadLine module. PSReadLine is available from the PowerShell Gallery.
Use the following command to install PSReadLine using PowerShellGet v2.x:
Install-Module -Name PSReadLine -Force
If you are using the new PSResourceGet, you can use the following command:
Install-PSResource -Name PSReadLine
You may you need ot use the Force parameter to install this version side by side with any previous preview releases installed.
Note
You must restart your PowerShell session to use the new version of PSReadLine.We have improved the user experience for ListView
for PowerShell
Predictive IntelliSense. This includes allowing more than 10 responses, and adding a scrollable list
view. To help with navigation, we have also included a metadata line that informs users of their
position in the scroll.
Another addition are tooltips for plugin predictors. Tooltips are descriptions of prediction results to help provide more details about what is being predicted. For example, the Az.Tools.Predictor module provides details about what the suggested cmdlet does.
Here are a few other changes and fixes that were made since the previous stable release:
You can find the full list of changes on our PSReadLine release page, Big thank you to the community members who have helped contributed to this release! Thank you @spaette, @dkaszews, @vimode, @springcomp, @jazzdelightsme and @3N4N for your contributions!
Here are links to all the previous blogs for the PSReadLine releases that highlight the feature changes more closely.
As per usual we love getting your feedback! Please submit bugs, feature requests, or questions to the repository. Your feedback is always welcomed and appreciated!
Thanks! Give the new version a try and let us know what you think!
Steven Bucher and Dongbo Wang
PSReadLine Maintainers
The post PSReadLine 2.3.4 GA Release appeared first on PowerShell Team.
]]>The post PowerShell Adapter Feedback Provider appeared first on PowerShell Team.
]]>We’ve renamed the JSON Adapter Feedback Provider to PowerShell Adapter Feedback Provider! We heard some good feedback that the name wasn’t as descriptive to what the feedback provider does so we’ve changed it to be more consistent with its functionality.
The Microsoft.PowerShell.PSAdapter is a module that identifies scripts and tools on the user machine that can help users more convert native command output into PowerShell objects. We designed this as a tool to help you discover what tools and scripts are available to help you convert native output to PowerShell objects.
Note
Feedback Providers are an experimental feature of 7.4-preview3+ and so you will be required to use one of the 7.4 previews for JSON Adapters to work and have `PSFeedbackProvider` experimental feature enabled .The release is available from the PowerShell Gallery.
Use the following command to install using PowerShellGet v2.x:
Install-Module -Name Microsoft.PowerShell.PSAdapter -AllowPrerelease
If you are using PSResourceGet, you can use the following command:
Install-PSResource -Name Microsoft.PowerShell.PSAdapter -AllowPrerelease
To use it you must import the module into your session:
Import-Module Microsoft.PowerShell.PSAdapter
We encourage you to include this command in your $PROFILE
so that it’s loaded in every PowerShell
session you start.
A PowerShell Adapter is a script that converts the text output of a native executable and converts it to PowerShell objects. The PowerShell Adapter module is a feedback provider that identifies these scripts and provides suggestions when you run the native command without any adapter script. You can read more about feedback providers in our blog post, What are feedback providers?.
You can make PowerShell Adapters for any command. Just use the exact name of the command as the
prefix to the script so that the module can identify the script and suggest it. For example, you
must name the script <name of command>-adapter.ps1
so that the PowerShell Adapter can identify it
as a adapter script. This script’s file location must included in your $env:PATH
variable to be
found.
For example, you want to use the macOS command vm_stat
like a PowerShell object. Create a file
called vm_stat-adapter.ps1
and add the location of this file to your $env:PATH
variable. The
PowerShell Adapter Feedback Provider will identify it as a possible suggestion for vm_stat
.
Here is an example PowerShell Adapter for vm_stat
:
[CmdletBinding()]
param ( [Parameter(ValueFromPipeline=$true)][string]$inputObject )
BEGIN {
$h = @{}
}
PROCESS {
if ( $inputObject -match "^Mach Virtual") {
if ($inputObject -match "page size of (\d+) ") {
$h['PageSize'] = [int]$matches[1]
}
}
else {
$k,$v = $inputObject -split ":"
$AdjustedK = ($k -replace "[ -]","_").trim() -replace '"'
$AdjustedV = "$v".Trim() -replace "\.$"
$h[$AdjustedK] = [int64]$AdjustedV
}
}
END {
[pscustomobject]$h
}
The following shows the suggestion from the Feedback Provider when you run vm_stat
without the
adapter script:
For another example, we can create a PowerShell Adapter for the df
utility using the TextUtility
PowerShell module. We just need to create a df-adapter.ps1
script and include the following:
$input | ConvertFrom-TextTable -ConvertPropertyValue
jc
The JSON Converter, jc
, is a command line utility that converts text output to JSON for variety of
command line tools. The PowerShell Adapter module can suggest using jc
as an adapter if the user
has it installed. When you use a command supported by jc
, the PowerShell Adapter Feedback Provider
suggests using jc
piped to ConvertFrom-JSON
.
You can find instructions on how to install jc
and more details about the tool in their
source code repository. When jc
supports the native command, this can be the simplest way
to convert the output without needing to write a PowerShell Adapter. You can see this suggestion in
the previous screenshot for the df
example.
jc
command supports many native commands, however, the Feedback Provider only provides jc
suggestions for the following commands:
"arp", "cksum", "crontab", "date", "df", "dig", "dir", "du", "file", "finger",
"free", "hash", "id", "ifconfig", "iostat", "jobs", "lsof", "mount", "mpstat",
"netstat", "route", "stat", "sysctl", "traceroute", "uname", "uptime", "w", "wc",
"who", "zipinfo"
Also, you need to use the appropriate parameters with your native command for jc
to work properly.
For example, if you want to use jc
with uname
, you need to use uname -a
because that produces
the output that jc
expect to convert to JSON.
We’ve also added Predictive IntelliSense support for the PowerShell Adapter feedback provider. With Predictive IntelliSense enabled, the PowerShell Adapter Feedback Provider provides suggestions that Predictive IntelliSense will show you on the command line. This makes it easy to try immediately, rather than manually running the suggestion.
We really appreciated the feedback we got on the first announcement of this tool and would love to continue getting great feedback! The GitHub repository for this tool is still named JSONAdapters, however the module name is Microsoft.PowerShell.PSAdapter and any reference to this tool will be PowerShell Adapters going forward. You can submit any feedback to the JsonAdapter repository.
Thank you so much!
Steven Bucher
PowerShell Team
The post PowerShell Adapter Feedback Provider appeared first on PowerShell Team.
]]>The post JSON Adapter Feedback Provider appeared first on PowerShell Team.
]]>Caution
This blog post is outdated, please see the updated blog, PowerShell Adapter Feedback Provider Blog
We are excited to announce the first release of our JSON Adapter Feedback Provider! If you are unfamiliar with what feedback providers are, check out this blog describing them, here.
Note
Feedback Providers are an experimental feature of 7.4-preview2+ and so you will be required to use one of the 7.4 previews for JSON Adapters to work.First to get the latest PowerShell preview for this to work on you can download them on our GitHub release page here.
The release is available from the PowerShell Gallery.
Use the following command to install JsonAdapter using PowerShellGet v2.x:
Install-Module -Name Microsoft.PowerShell.JsonAdapter -AllowPrerelease
If you are using PSResourceGet, you can use the following command:
Install-PSResource -Name Microsoft.PowerShell.JsonAdapter -PreRelease
To use it you will need to import the module into your session via:
Import-Module Microsoft.PowerShell.JsonAdapter
We encourage you to include the import message in your $PROFILE
so it can persistently be loaded
in every PowerShell session you start. If you have Visual Studio Code installed, type
code $PROFILE
to edit your profile or use your choice of editor.
A JSON adapter is a script that can parse the text output of a native executable and convert it to
PowerShell Object. JSON adapters can be made for
any command, it is just required to use the exact name of the command as the prefix to the script.
The script will have to be named like so <name of command>-json.ps1
to be identified by the JSON
adapter utility. This script’s file location must also be added to your $env:PATH
variable to be
found.
For example, say you are on a Mac and want to use the command vm_stat
like a PowerShell object. If
you add the following to a file called vm_stat-json.ps1
and add the location of this file to your
$env:PATH
variable, the JSON Adapter feedback provider will identify it as a possible suggestion
for vm_stat
.
[CmdletBinding()]
param ( [Parameter(ValueFromPipeline=$true)][string]$inputObject )
BEGIN {
$h = @{}
}
PROCESS {
if ( $inputObject -match "^Mach Virtual") {
if ($inputObject -match "page size of (\d+) ") {
$h['PageSize'] = [int]$matches[1]
}
}
else {
$k,$v = $inputObject -split ":"
$AdjustedK = ($k -replace "[ -]","_").trim() -replace '"'
$AdjustedV = "$v".Trim() -replace "\.$"
$h[$AdjustedK] = [int64]$AdjustedV
}
}
END {
[pscustomobject]$h
}
This is what the experience looks like in the shell.
JC or JSON Converter, is a command line utility that can convert text to JSON for variety of command
line tools. You can find instructions on how to install jc
and a full list of supported commands
on the repo of jc. It can be a great tool to use to convert the outputs without writing a JSON
Adapter yourself. The JSON Adapter
module supports using jc
as a JSON Adapter if the user has it
installed. This means if you have the jc
utility installed and use a command that is supported by JC, the JSON
Adapter feedback provider will suggest using JC piped to ConvertFrom-JSON
.
It is important to note that not all jc supported utilities are supported. The list of supported commands is:
"arp", "cksum", "crontab", "date", "df", "dig", "dir", "du", "file", "finger",
"free", "hash", "id", "ifconfig", "iostat", "jobs", "lsof", "mount", "mpstat",
"netstat", "route", "stat", "sysctl", "traceroute", "uname", "uptime", "w", "wc",
"who", "zipinfo"
Additionally, you will need to use the appropriate parameters that jc requires to work properly. For
example, if you want to use jc
with uname
, you will need to use uname -a
as that is what jc
requires to properly convert the output to JSON.
We have also added predictive IntelliSense support for the JSON Adapter feedback provider. This means after a JSON Adapter feedback provider is triggered, as you type the command name again, Predictive Intellisense will suggest the feedback command to you. This is a great way to easily try the suggestion after a JSON Adapter feedback provider is triggered.
As this is our very first release, we know there may be issues that arise. We definitely look forward to your feedback and suggestions! You can provide feedback on the repo for this project here. Many things are subject to change as we are in early development of this. Give it a try!
Jim Truher and Steven Bucher
PowerShell Team
The post JSON Adapter Feedback Provider appeared first on PowerShell Team.
]]>The post What are Feedback Providers? appeared first on PowerShell Team.
]]>PSFeedbackProvider
. This blog outlines what this experimental feature is, how to use it and
describes different feedback providers we have already created.
You can install the latest 7.4 preview via our GitHub page here. If you are on Windows you can download via the Microsoft store here.
Unless configured differently, the previews should have all experimental features enabled by deafult but in case they are not enabled you can check and enable them by using the following commands:
Checking experimental features enabled:
Get-ExperimentalFeature
Enabling experimental feature:
Enable-ExperimentalFeature -Name PSFeedbackProvider
You will also have to enable the experimental feature PSCommandNotFoundSuggestion
to get enable
the built-in feedback provider.
Enable-ExperimentalFeature -Name PSCommandNotFoundSuggestion
Note
You must restart your PowerShell session to enable experimental features.After we created PowerShell Predictive IntelliSense, we realized that no matter how hard we can try to be “preventative” of errors, they will still occur. This made us think there was a better way to give the users more feedback to their errors so they could recover quicker from them.
After prototyping and seeing how great it could work for errors, we got thinking that maybe we can help inform and teach users better practices to the shell and thus we expanded feedback providers to successful executions.
Feedback Providers are PowerShell modules that utilize the IFeedbackProvider
interface to give
feedback and suggestions after the shell users have attempted to execute something. Feedback
providers can trigger upon three different interactive scenarios:
Note
*As of August 2023, comments are no longer supported triggers for feedback providersThis means after the user has hit enter, Feedback Providers can trigger and know what scenario the user has faced.
We have created a built-in feedback provider named General
. This triggers on the CommandNotFound
exception error and gives the user suggestions on what command they may have meant to type from list
of commands already installed in the users $env:PATH
. Both native commands and PowerShell cmdlets
will be suggested if they are installed.
You have may seen something similar to this before in previous versions of the
PSCommandNotFoundSuggestion
experimental feature. We have given the UX an upgraded and turned this
into a feedback provider!
This is the old PSCommandNotFoundSuggestion
experience:
This is the same feature but with the new feedback provider model:
We have created an additional feedback provider that we call the command-not-found
feedback
provider. This utilizes the command-not-found
utility tool that is defaulted on Ubuntu systems.
This feedback provider will trigger when the user has attempted to execute a command that is not
installed on the system but will give the user suggestions on how to install the command on their
system using apt
. This is only compatible with Linux systems where the command-not-found
utility
tool has been installed.
Another thing we did with this feedback provider is that we have it subscribed to the
ICommandPredictor
interface so that it can give it suggestions directly to PowerShell Predictive
IntelliSense. This way as you start typing a suggestion, you can more quickly accept the suggestion.
We have open sourced this feedback provider so you can take a look at how we have implemented it here. You can install this feedback provider from the PowerShell Gallery via this command:
Install-Module -Name command-not-found
Or if you are using the latest version of PSResourceGet, you can use this command:
Install-PSResource -Name command-not-found
You will need to import the module to enable the feedback provider:
Import-Module -Name command-not-found
We recommend you save this in your PowerShell $PROFILE
so that it is always available to you.
We are still under rapid development with feedback providers so there may be changes to them in the future! Due to the changes we are doing to the feedback provider, we will be publishing documentation on how to create your own once we have finalized some design changes for creating the providers.
In the meantime if you have any ideas on how we can make this experience best work for your PowerShell workflow, please let us know in the issues tab of our PowerShell repo!
We are excited to be sharing more about feedback providers in the near future.
Thanks
Steven Bucher
The post What are Feedback Providers? appeared first on PowerShell Team.
]]>The post Completion Predictor v0.1.1 Release appeared first on PowerShell Team.
]]>We’ve recently released a new version of the Completion Predictor! We’ve been highlighting this predictor when showing off some of the new improvements in the PSReadLine 2.3.x betas and wanted to share some of the awesome things you can do with this predictor.
If you are unfamiliar with the Completion Predictor, this is a plugin in predictor that we released last year that provides tab completion to help give prediction results. This means it can work for helping fill out parameters of cmdlets and properties and methods of objects. The Version 0.1.1 release contains some experience improvements and some new completion capabilities.
First and foremost, how can you get this predictor? The release is available from the PowerShell Gallery.
Use the following command to install CompletionPredictor using PowerShellGet v2.x:
Install-Module -Name CompletionPredictor
If you are using PowerShellGet v3, you can use the following command:
Install-PSResource -Name CompletionPredictor
Using tab completion we’re able to give predictions on the next folders you may want to navigate to
with cd
or view the contents of with dir
.
Another argument completion improvement was with git
. These are improvements that we’ve found
works best for our workflow but may help with your git
workflow as well!
Completion Predictor is able to look at remote and local branches available to accelerate your flow
when using git merge
. Here is an example of it working.
Similarly, to the merge behavior, the completion predictor is now able to give predictions on what
branch you may want to use when checking out or deleting branches. This only works with the
subcommands git checkout
and git branch -D
. The predictor intentionally doesn’t include the
current branch you are in when giving results.
As I mentioned, we added these improvements to help with our specific git
workflows. Typically, the
rough flow we’ve is the following:
git fetch --all -p
-> to get the latest changes in that repogit merge
-> sync the default branchgit branch -D
-> delete the old working branches that were already removed from the remote sidegit checkout
-> checkout a new branch to work ingit push
-> push the new branch to remote to then create a PRThis isn’t a blog post about how to best use git
, so please refer to other online resources to
learn git
. This is just the workflow we like to use that helped us create the git
improvements
to the Completion Predictor.
You can find the rest of the changes in this release in the changelog on the release page. We love getting feedback on these predictors we make! The entire source code for this predictor is available on GitHub and can be a great starting point for making your own predictor! Please feel free to open issues or PRs on the GitHub page for improvements that may work for you and others! Enjoy!
Steven Bucher and Dongbo Wang
Completion Predictor and PSReadLine Maintainers
The post Completion Predictor v0.1.1 Release appeared first on PowerShell Team.
]]>The post PSReadLine 2.3.1-beta1 Release appeared first on PowerShell Team.
]]>We are pleased to announce another release of PSReadLine 2.3.1-beta1! We have had various bug fixes
and minor improvements in this release, as well as a big new feature to ListView
of Predictors! Let’s
jump right in!
How do you install this release? The release is available from the PowerShell Gallery.
Use the following command to install PSReadLine using PowerShellGet v2.x:
Install-Module -Name PSReadLine -AllowPrerelease -Force
If you are using PowerShellGet v3, you can use the following command:
Install-PSResource -Name PSReadLine -Prerelease
You must include the Force parameter to install this version side by side with the default stable version.
Note
You must restart your PowerShell session to use the new version of PSReadLine.In this preview, we enabled a new tooltip view in the ListView
mode of PSReadLine Predictors.
Tooltips were part of the original design but were never presented to the user until this release.
Tooltips are enabled by default, but you can disable them by running the following command:
Set-PSReadLineOption -ShowToolTips:$false
And then can re-enable by running:
Set-PSReadLineOption -ShowToolTips
The following screenshot shows the CompletionPredictor
providing tooltips to show details
about each parameter of Write-Host
and GetChildItem
.
Note
You will need the CompletionPredictor installed and imported to have the same experiences shown in this blog.
Tooltips are only available for results from plugin predictors. Predictions from History don’t have tooltips. A plugin predictor can populate the tooltip with other descriptions to help provide more details into what is being predicted. For example, the Az.Tools.Predictor module provides details about what the suggested cmdlet does.
It’s also helpful when working with .NET objects:
For long tooltips, ListView
shows up to four lines of the tooltip. You can get more information
for the selected item by pressing the F4 key.
See our changelog for a complete list of bug fixes and changes.
As usual, we love getting your feedback! Since this is a beta release, designs and features are subject to change. Please submit bugs, feature requests, or questions to the repository. Your feedback is greatly appreciated!
Steven Bucher and Dongbo Wang
PSReadLine Maintainers
The post PSReadLine 2.3.1-beta1 Release appeared first on PowerShell Team.
]]>