PowerShell
Windowsのコマンドプロンプトに代わる、.NETベースのコマンドシェルである。
これは簡単
スクリプトの実行
$ curl.exe -s https://scrapbox.io/api/code/suto3/PowerShell/hello1.ps1 | powershell -Command -
日本語を表示させようとすると、とたんに難易度があがる
文字コードを確認
$ chcp
$ 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