Latest posts by Wolfgang Sommergut (see all)
$true ? "True" : "False"
Multi-platform version of Out-GridView ^
The Out-GridView cmdlet, known from Windows PowerShell, returns in PowerShell 7, allowing you to display data graphically in tabular form.
It exists for all platforms that PowerShell 7 supports. It is currently not on board by default; instead, the installation is done with Install-Module Microsoft.PowerShell.GraphicalTools.
This blog post by Microsoft summarizes additional innovations offered in Preview 4.
Installation on Windows ^
You can install PowerShell 7 both alongside Windows PowerShell and in parallel with PowerShell Core. On Windows, there are two ways to do this: manually and via the command line.
For the first option, download the desired release as an MSI from Github, run the installation package, and then let the wizard guide you through the setup. On Github, you can easily overlook the download files because they are hidden in the collapsed Assets section.
PowerShell 7 can also be added entirely from the command line. For this, you need the PSReleaseTools PowerShell module by Jeff Hicks. This can be loaded with the command
which may require a new NuGet provider first. It will be set up automatically after confirmation by the user.
Subsequently, you can use
to install the current preview with the default values.
Installing PowerShell 7 on Linux ^
On Linux, you can also add PowerShell 7 manually or from the command line. For example, in the case of Ubuntu 18.04, download the corresponding package and install it using the following command:
sudo dpkg -i powershell-preview_7.0.0-preview.4-1.ubuntu.18.04_amd64.deb
There is a good chance an error will occur when this command is executed, indicating the required libraries are not available on the system. You can use
sudo apt-get install -f
to solve this problem.
Alternatively, Microsoft provides a shell script that downloads and installs the appropriate package for each Linux distribution. This can be downloaded using the following command:
Afterward, make the file with
chmod 755 install-powershell.sh
and start it up by entering
sudo install-powershell.sh -preview
Without the "preview" switch, the script would currently install PowerShell Core 6, but will also display a wrong information about the added version. The preview of PowerShell 7 can then be started with the command
Another way to install Ubuntu is to use Canonical's Snap service. Microsoft also uploads its installation package there, and you can retrieve it with
sudo snap install powershell-preview --classic
In my test, PowerShell 7 proved to be unstable after this installation variant and crashed regularly.