windows:powershell

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
次のリビジョン両方とも次のリビジョン
windows:powershell [2020/02/15 10:28] ともやんwindows:powershell [2020/09/11 19:31] ともやん
行 1: 行 1:
-<html> +~~CLOSETOC~~ 
-  <style> +====== PowerShell(Windows) ======
-    #result pre { +
-      height: 200px; +
-      overflow: scroll; +
-      overflow-x: hidden; +
-    } +
-  </style> +
-</html> +
-====== PowerShell ======+
 [[linux:powershell|PowerShell - Linux]]\\ [[linux:powershell|PowerShell - Linux]]\\
 \\ \\
行 32: 行 24:
 //$lines = explode("\n", $res); //$lines = explode("\n", $res);
 //var_dump($res); //var_dump($res);
-echo '最新バージョン: '.$lines[0];+echo '最新バージョン: v7.0.1'.$lines[0];
 </php>\\ </php>\\
 \\ \\
-{{:windows:powershell_v7.0.0-rc.2.png?600|PowerShell}}\\+{{:windows:powershell_v7.0.0-rc.2.png?470|PowerShell}}\\
 **PowerShell** (パワーシェル)は、マイクロソフトが開発した拡張可能なコマンドラインインターフェース (CLI) シェルおよびスクリプト言語である。オブジェクト指向に基づいて設計されており、.NET Frameworkと.NET Coreを基盤としている。\\ **PowerShell** (パワーシェル)は、マイクロソフトが開発した拡張可能なコマンドラインインターフェース (CLI) シェルおよびスクリプト言語である。オブジェクト指向に基づいて設計されており、.NET Frameworkと.NET Coreを基盤としている。\\
 \\ \\
行 42: 行 34:
 Windows 7 以降のオペレーティングシステム (OS) には標準で搭載されている。\\ Windows 7 以降のオペレーティングシステム (OS) には標準で搭載されている。\\
 \\ \\
 +
 +===== インストール =====
 +[[windows:scoop|Scoop]] によるインストール\\
 +<code powershell>
 +PS > scoop bucket add dorado https://github.com/h404bi/dorado
 +</code>
 +<WRAP prewrap 100% #result>
 +<code>
 +Checking repo... ok
 +The dorado bucket was added successfully.
 +</code>
 +</WRAP>
 +
 +**Powershell** のインストール\\
 +<code powershell>
 +PS > scoop install powershell
 +</code>
 +<WRAP prewrap 100% #result>
 +<code>
 +Installing 'powershell' (6.2.4) [64bit]
 +PowerShell-6.2.4-win-x64.zip (55.3 MB) [======================================================================] 100%
 +Checking hash of PowerShell-6.2.4-win-x64.zip ... ok.
 +Extracting PowerShell-6.2.4-win-x64.zip ... done.
 +Linking ~\scoop\apps\powershell\current => ~\scoop\apps\powershell\6.2.4
 +Creating shim for 'pwsh'.
 +Creating shortcut for PowerShell Core (pwsh.exe)
 +'powershell' (6.2.4) was installed successfully!
 +</code>
 +</WRAP>
 +
 +**Powershell** のグローバルインストール\\
 +<code powershell>
 +PS > sudo scoop install -g powershell
 +</code>
 +<WRAP prewrap 100% #result>
 +<code>
 +Installing 'powershell' (7.0.0) [64bit]
 +PowerShell-7.0.0-win-x64.zip (88.7 MB) [======================================================================] 100%
 +Checking hash of PowerShell-7.0.0-win-x64.zip ... ok.
 +Extracting PowerShell-7.0.0-win-x64.zip ... done.
 +Linking C:\ProgramData\scoop\apps\powershell\current => C:\ProgramData\scoop\apps\powershell\7.0.0
 +Creating shim for 'pwsh'.
 +Creating shortcut for PowerShell (pwsh.exe)
 +'powershell' (7.0.0) was installed successfully!
 +</code>
 +</WRAP>
 +
 +**Powershell(Preview版)** のインストール\\
 +<code powershell>
 +PS > scoop install powershell-preview
 +</code>
 +<WRAP prewrap 100% #result>
 +<code>
 +Installing 'powershell-preview' (7.0.0-rc.3) [64bit]
 +PowerShell-7.0.0-rc.3-win-x64.zip (88.8 MB) [=================================================================] 100%
 +Checking hash of PowerShell-7.0.0-rc.3-win-x64.zip ... ok.
 +Extracting PowerShell-7.0.0-rc.3-win-x64.zip ... done.
 +Linking ~\scoop\apps\powershell-preview\current => ~\scoop\apps\powershell-preview\7.0.0-rc.3
 +Creating shim for 'pwsh'.
 +WARN  Overwriting shim to pwsh.exe installed from powershell
 +Creating shortcut for PowerShell Preview (pwsh.exe)
 +'powershell-preview' (7.0.0-rc.3) was installed successfully!
 +</code>
 +</WRAP>
  
 ===== ダウンロード ===== ===== ダウンロード =====
行 47: 行 103:
 [[https://aka.ms/pscore6|]]\\ [[https://aka.ms/pscore6|]]\\
 [[https://aka.ms/pscore6-docs|]]\\ [[https://aka.ms/pscore6-docs|]]\\
 +[[https://aka.ms/PowerShell-Release?tag=v7.0.0|]]\\
 [[https://github.com/PowerShell/PowerShell/releases/tag/v7.0.0-rc.1|Releases · PowerShell/PowerShell - Release Candidate 1]]\\ [[https://github.com/PowerShell/PowerShell/releases/tag/v7.0.0-rc.1|Releases · PowerShell/PowerShell - Release Candidate 1]]\\
 [[https://github.com/PowerShell/PowerShell/releases/tag/v7.0.0-rc.2|Releases · PowerShell/PowerShell - Release Candidate 2]]\\ [[https://github.com/PowerShell/PowerShell/releases/tag/v7.0.0-rc.2|Releases · PowerShell/PowerShell - Release Candidate 2]]\\
 +[[https://github.com/PowerShell/PowerShell/releases/tag/v7.0.0-rc.3|Releases · PowerShell/PowerShell - Release Candidate 3]]\\
 +
 +===== PowerShellGet =====
 +[[https://www.powershellgallery.com/|PowerShell Gallery | Home]]\\
 +PowerShell ギャラリー
 +
 +PowerShellGet をインストールするには、以下のコマンドを実行する。\\
 +<code>
 +$ sudo Install-Module -Name PowerShellGet -Force
 +</code>
 +PowerShellGet を新しいバージョンに更新するには、以下のコマンドを実行する。\\
 +<code>
 +$ sudo Update-Module -Name PowerShellGet
 +</code>
 +
 +**参考文献**\\
 +[[https://docs.microsoft.com/ja-jp/powershell/scripting/gallery/overview|PowerShell ギャラリー - PowerShell | Microsoft Docs]]\\
 +[[https://docs.microsoft.com/ja-jp/powershell/scripting/gallery/installing-psget|PowerShellGet のインストール - PowerShell | Microsoft Docs]]\\
 +
 +===== Powershell のテーマ設定 =====
 +現在のコンソール設定をバックアップする。\\
 +<code>
 +$ concfg export console-backup.json
 +</code>
 +<WRAP prewrap 100% #result>
 +<code>
 +console settings exported to console-backup.json
 +</code>
 +</WRAP>
 +
 +ソラリゼーションカラーテーマを使用する。\\
 +<code>
 +$ concfg import solarized-dark
 +</code>
 +<WRAP prewrap 100% #result>
 +<code>
 +Console settings were imported from 'solarized-dark'
 +Overrides in the registry and shortcut files might interfere with your concfg settings. Would you like to find and remove them? (Y/n): y <- 入力する
 +Removing 'Registry::HKEY_CURRENT_USER\Console\%SystemRoot%_System32_WindowsPowerShell_v1.0_powershell.exe'
 +Removing 'Registry::HKEY_CURRENT_USER\Console\%SystemRoot%_SysWOW64_WindowsPowerShell_v1.0_powershell.exe'
 +Reset console properties of shortcut 'C:\Users\tomoyan\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Windows PowerShell\Windows PowerShell (x86).lnk'
 +Reset console properties of shortcut 'C:\Users\tomoyan\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Windows PowerShell\Windows PowerShell.lnk'
 +
 +Would you like to open a new console to see the changes? (Y/n): n <- 入力する
 +</code>
 +
 +上記の翻訳\\
 +<code>
 +Overrides in the registry and shortcut files might interfere with your concfg settings. Would you like to find and remove them?
 +</code>
 +<code>
 +レジストリファイルおよびショートカットファイルのオーバーライドは、concfg設定に干渉する可能性があります。それらを見つけて削除しますか?
 +</code>
 +
 +<code>
 +Would you like to open a new console to see the changes?
 +</code>
 +<code>
 +変更を確認するために新しいコンソールを開きますか?
 +</code>
 +</WRAP>
 +
 +==== 参考文献 ====
 +[[https://github.com/lukesampson/scoop/wiki/Theming-Powershell|Theming Powershell · lukesampson/scoop Wiki · GitHub]]\\
 +
 +===== 変数 =====
 +[[.:powershell:variable|環境変数/自動変数/ユーザ定義変数]]\\
 +
 +===== コマンド =====
 +[[.:powershell:commands|PowerShell コマンド]]\\
 +[[.:powershell:remote-commands|PowerShell リモートコマンド実行]]\\
 +[[.:powershell:commands:get-alias|PowerShell エイリアス Get-Alias (alias: gal)]]\\
 +[[.:powershell:commands:get-command|PowerShell コマンド情報取得[where/which] Get-Command (alias: gcm)]]\\
  
 ===== PowerShell のバージョン ===== ===== PowerShell のバージョン =====
行 90: 行 220:
 <code powershell> <code powershell>
 PS > start-process notepad c:\windows\system32\drivers\etc\hosts -verb runas PS > start-process notepad c:\windows\system32\drivers\etc\hosts -verb runas
 +</code>
 +
 +===== カレントディレクトリ変更 =====
 +<code powershell>
 +PS C:\Windows\System32> cd ~
 +PS C:\Users\tomoyan> pwd
 +
 +Path
 +----
 +C:\Users\tomoyan
 </code> </code>
  
行 101: 行 241:
 [[http://www.vwnet.jp/windows/etc.asp#PowerShell|PowerShell - vwnet.jp]]\\ [[http://www.vwnet.jp/windows/etc.asp#PowerShell|PowerShell - vwnet.jp]]\\
 [[https://github.com/PowerShell/Win32-OpenSSH/releases|Releases · PowerShell/Win32-OpenSSH · GitHub]]\\ [[https://github.com/PowerShell/Win32-OpenSSH/releases|Releases · PowerShell/Win32-OpenSSH · GitHub]]\\
 +\\
 +[[https://binary-pulsar.hatenablog.jp/entry/2018/09/01/000000|]]\\
 +\\
 +[[https://stackoverflow.com/questions/2124753/how-can-i-use-powershell-with-the-visual-studio-command-prompt|How can I use PowerShell with the Visual Studio Command Prompt? - Stack Overflow]]\\
 +[[https://archive.codeplex.com/?p=pscx|PowerShell Community Extensions - CodePlex Archive]]\\
 +[[https://rkeithhill.wordpress.com/2014/10/24/pscx-3-2-0-available/|PSCX 3.2.0 Available | Keith Hill's Blog]]\\
 +[[https://rkeithhill.wordpress.com/|Keith Hill's Blog | Just another WordPress.com site]]\\
 +[[https://www.powershellgallery.com/|PowerShell Gallery | Home]]\\
  
  • windows/powershell.txt
  • 最終更新: 2023/10/06 14:49
  • by ともやん