差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン 次のリビジョン両方とも次のリビジョン | ||
windows:powershell [2020/09/29 02:29] – ともやん | windows:powershell [2023/07/21 02:35] – [PowerShell(Windows)] ともやん | ||
---|---|---|---|
行 1: | 行 1: | ||
- | ~~CLOSETOC~~ | ||
====== PowerShell(Windows) ====== | ====== PowerShell(Windows) ====== | ||
[[linux: | [[linux: | ||
行 21: | 行 20: | ||
//$url = ' | //$url = ' | ||
- | $url = ' | + | $url = ' |
//$res = curlGet($url); | //$res = curlGet($url); | ||
//$tags = json_decode($res, | //$tags = json_decode($res, | ||
行 30: | 行 29: | ||
@$dom-> | @$dom-> | ||
$xpath = new DOMXPath($dom); | $xpath = new DOMXPath($dom); | ||
- | $xpath = $xpath-> | + | $xpath = $xpath-> |
var_dump($xpath); | var_dump($xpath); | ||
$html = array_map( | $html = array_map( | ||
function ($node) use ($xpath) { | function ($node) use ($xpath) { | ||
- | return [' | + | return [ |
- | }); | + | |
+ | | ||
+ | }, $xpath-> | ||
var_dump($html); | var_dump($html); | ||
*/ | */ | ||
- | echo ' | + | echo ' |
</ | </ | ||
- | {{windows: | + | {{windows: |
**PowerShell** (パワーシェル)は、マイクロソフトが開発した拡張可能なコマンドラインインターフェース (CLI) シェルおよびスクリプト言語である。オブジェクト指向に基づいて設計されており、.NET Frameworkと.NET Coreを基盤としている。\\ | **PowerShell** (パワーシェル)は、マイクロソフトが開発した拡張可能なコマンドラインインターフェース (CLI) シェルおよびスクリプト言語である。オブジェクト指向に基づいて設計されており、.NET Frameworkと.NET Coreを基盤としている。\\ | ||
行 50: | 行 51: | ||
===== インストール ===== | ===== インストール ===== | ||
[[windows: | [[windows: | ||
- | <code powershell> | + | <WRAP color_term> |
- | PS > scoop bucket add dorado https:// | + | <WRAP color_command>< |
- | </code> | + | PS > <b class=HIY>scoop</ |
- | < | + | </pre></ |
- | <code> | + | <WRAP color_result>< |
Checking repo... ok | Checking repo... ok | ||
- | The dorado bucket was added successfully. | + | <b class=GRN> |
- | </code> | + | </pre></ |
</ | </ | ||
- | **Powershell** のインストール\\ | + | **PowerShell** のインストール\\ |
- | <code powershell> | + | <WRAP color_term> |
- | PS > scoop install powershell | + | <WRAP color_command>< |
- | </code> | + | PS > <b class=HIY>scoop</ |
- | < | + | </pre></ |
- | <code> | + | <WRAP color_result>< |
- | Installing ' | + | Installing ' |
- | PowerShell-6.2.4-win-x64.zip (55.3 MB) [======================================================================] 100% | + | PowerShell-7.3.6-win-x64.zip (102.9 MB) [=====================================================================] 100% |
- | Checking hash of PowerShell-6.2.4-win-x64.zip ... ok. | + | Checking hash of <b class=CYN> |
- | Extracting PowerShell-6.2.4-win-x64.zip ... done. | + | Extracting |
- | Linking ~\scoop\apps\powershell\current => ~\scoop\apps\powershell\6.2.4 | + | Linking ~\scoop\apps\powershell\current => ~\scoop\apps\powershell\7.3.6 |
Creating shim for ' | Creating shim for ' | ||
- | Creating shortcut for PowerShell | + | Creating shortcut for PowerShell (pwsh.exe) |
- | ' | + | <b class=GRN> |
- | </code> | + | </pre></ |
</ | </ | ||
- | **Powershell** のグローバルインストール\\ | + | **PowerShell** のグローバルインストール\\ |
- | <code powershell> | + | <WRAP color_term> |
- | PS > sudo scoop install -g powershell | + | <WRAP color_command>< |
- | </code> | + | PS > <b class=HIY>sudo</ |
- | < | + | </pre></ |
- | <code> | + | <WRAP color_result>< |
Installing ' | Installing ' | ||
PowerShell-7.0.0-win-x64.zip (88.7 MB) [======================================================================] 100% | PowerShell-7.0.0-win-x64.zip (88.7 MB) [======================================================================] 100% | ||
- | Checking hash of PowerShell-7.0.0-win-x64.zip ... ok. | + | Checking hash of <b class=CYN> |
- | Extracting PowerShell-7.0.0-win-x64.zip ... done. | + | Extracting |
Linking C: | Linking C: | ||
Creating shim for ' | Creating shim for ' | ||
Creating shortcut for PowerShell (pwsh.exe) | Creating shortcut for PowerShell (pwsh.exe) | ||
- | ' | + | <b class=GRN> |
- | </code> | + | </pre></ |
</ | </ | ||
- | **Powershell(Preview版)** のインストール\\ | + | **PowerShell(Preview版)** のインストール\\ |
- | <code powershell> | + | <WRAP color_term> |
- | PS > scoop install powershell-preview | + | <WRAP color_command>< |
+ | PS > <b class=HIY>scoop</ | ||
</ | </ | ||
- | < | + | </ |
- | <code> | + | <WRAP color_result>< |
Installing ' | Installing ' | ||
PowerShell-7.0.0-rc.3-win-x64.zip (88.8 MB) [=================================================================] 100% | 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. | + | Checking hash of <b class=CYN> |
- | Extracting PowerShell-7.0.0-rc.3-win-x64.zip ... done. | + | Extracting |
Linking ~\scoop\apps\powershell-preview\current => ~\scoop\apps\powershell-preview\7.0.0-rc.3 | Linking ~\scoop\apps\powershell-preview\current => ~\scoop\apps\powershell-preview\7.0.0-rc.3 | ||
Creating shim for ' | Creating shim for ' | ||
WARN Overwriting shim to pwsh.exe installed from powershell | WARN Overwriting shim to pwsh.exe installed from powershell | ||
Creating shortcut for PowerShell Preview (pwsh.exe) | Creating shortcut for PowerShell Preview (pwsh.exe) | ||
- | ' | + | <b class=GRN> |
- | </code> | + | </pre></ |
</ | </ | ||
行 129: | 行 131: | ||
[[.powershell: | [[.powershell: | ||
[[.powershell: | [[.powershell: | ||
+ | [[.powershell: | ||
+ | |||
+ | ===== コマンド履歴 ===== | ||
+ | <code powershell> | ||
+ | $ less (Get-PSReadlineOption).HistorySavePath | ||
+ | </ | ||
+ | |||
+ | <code powershell> | ||
+ | $ cat (Get-PSReadlineOption).HistorySavePath | grep "scoop search" | ||
+ | </ | ||
===== PowerShellGet ===== | ===== PowerShellGet ===== | ||
行 253: | 行 265: | ||
===== 参考文献 ===== | ===== 参考文献 ===== | ||
[[http:// | [[http:// | ||
- | [[https:// | + | [[git>PowerShell/ |
- | \\ | + | |
[[https:// | [[https:// | ||
- | \\ | + | |
[[https:// | [[https:// | ||
[[https:// | [[https:// | ||
行 262: | 行 274: | ||
[[https:// | [[https:// | ||
[[https:// | [[https:// | ||
+ | |||
+ | [[https:// | ||
+ | [[https:// | ||
+ | [[git> | ||
+ | [[https:// | ||