iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
📘

PowerShell: Hello World on Debian

に公開
2024/06/16

[Update]
It can also be installed using mise.

mise plugin add powershell-core
mise install powershell-core
mise global powershell-core@7.4.2

Install the following packages to run snapd:

sudo apt install squashfs-tools squashfuse snapd

Restart the terminal once snapd is installed.

Install PowerShell

sudo snap install powershell --classic

Start it

pwsh

Display Hello World

Write-Host "Hello World!"

The default character encoding is as follows:

[Console]::OutputEncoding
CodePage          : 65001
IsSingleByte      : False
EncodingName      : Unicode (UTF-8)
WebName           : utf-8
Preamble          : 
BodyName          : 
HeaderName        : 
WindowsCodePage   : 
IsBrowserDisplay  : 
IsBrowserSave     : 
IsMailNewsDisplay : 
IsMailNewsSave    : 
EncoderFallback   : System.Text.EncoderReplacementFallback
DecoderFallback   : System.Text.DecoderReplacementFallback
IsReadOnly        : False

Discussion