generated at
PowerShell
Windowsのコマンドプロンプトに代わる、.NETベースのコマンドシェルである。

hello1.ps1
Write-Host "Hello world"

これは簡単
スクリプトの実行
$ curl.exe -s https://scrapbox.io/api/code/suto3/PowerShell/hello1.ps1 | powershell -Command -

日本語を表示させようとすると、とたんに難易度があがる
hello2.ps1
Write-Host "こんにちは"

文字コードを確認
$ chcp

文字コードをutf-8に変更
$ chcp 65001

フォントを確認・変更
メニューバーで右クリック
プロパティ
「フォント」タブ
MSゴシックに変更

パイプの文字コードを変更
$ $OutputEncoding = [Console]::OutputEncoding

スクリプトの実行
$ curl.exe -s https://scrapbox.io/api/code/suto3/PowerShell/hello2.ps1 | powershell -Command -


デフォルトのブラウザからURLをひらく
$ start ‘https://scrapbox.io/suto3/PowerShell’

$ start ‘https://scrapbox.io/suto3/new’

文字コードをShift_JISに変更
$ chcp 932