linux:powershell

差分

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

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
次のリビジョン両方とも次のリビジョン
linux:powershell [2020/02/15 11:37] – [インストール] ともやんlinux:powershell [2020/06/08 16:39] ともやん
行 1: 行 1:
-====== PowerShell ======+<html> 
 +  <style> 
 +    #result pre, #mincode pre { 
 +      overflow: hidden; 
 +      font-size: 10px; 
 +    } 
 +    #result_long pre { 
 +      height: 250px; 
 +      overflow: scroll; 
 +      overflow-x: hidden; 
 +      font-size: 10px; 
 +    } 
 +    #mintbl table { 
 +      font-size: 12px; 
 +    } 
 +    .dokuwiki .plugin_wrap table { 
 +      width: auto; 
 +    } 
 +    #logo { 
 +      background-color: white; 
 +      padding: 10px; 
 +      width: fit-content; 
 +    } 
 +    #logo p { 
 +      margin: 0; 
 +    } 
 +  </style> 
 +</html> 
 +====== PowerShell(Linux) ======
 [[windows:powershell|PowerShell - Windows]]\\ [[windows:powershell|PowerShell - Windows]]\\
 \\ \\
 本家: [[https://docs.microsoft.com/ja-jp/powershell/|PowerShell Documentation | Microsoft Docs]]\\ 本家: [[https://docs.microsoft.com/ja-jp/powershell/|PowerShell Documentation | Microsoft Docs]]\\
 ソースコード: [[https://github.com/PowerShell/PowerShell|GitHub - PowerShell/PowerShell: PowerShell for every system!]]\\ ソースコード: [[https://github.com/PowerShell/PowerShell|GitHub - PowerShell/PowerShell: PowerShell for every system!]]\\
 +\\
 +{{linux:powershell_v7.0.0-rc.2_on_fedora_31.png?470|PowerShell 7 on Fedora 31}}\\
  
 ===== インストール ===== ===== インストール =====
行 13: 行 43:
 \\ \\
 ==== Fedora 31 ==== ==== Fedora 31 ====
 +<WRAP prewrap 100%>
 <code> <code>
 $ sudo dnf install https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.2/powershell-preview-7.0.0_rc.2-1.centos.8.x86_64.rpm $ sudo dnf install https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.2/powershell-preview-7.0.0_rc.2-1.centos.8.x86_64.rpm
 </code> </code>
 +</WRAP>
 +
 +==== Fedora - dnf ====
 +[[https://docs.microsoft.com/ja-jp/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7#fedora|Fedora への PowerShell のインストール - PowerShell | Microsoft Docs]]\\
 +<WRAP prewrap 100%>
 +<code>
 +# Register the Microsoft signature key
 +sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
 +
 +# Register the Microsoft RedHat repository
 +curl https://packages.microsoft.com/config/rhel/7/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo
 +
 +# Update the list of products
 +sudo dnf check-update
 +
 +# Install a system component
 +sudo dnf install compat-openssl10
 +
 +# Install PowerShell
 +sudo dnf install -y powershell
 +
 +# Start PowerShell
 +pwsh
 +</code>
 +</WRAP>
 +
 +<WRAP prewrap 100%>
 +<code>
 +$ sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
 +</code>
 +</WRAP>
 +<WRAP prewrap 100%>
 +<code>
 +$ curl https://packages.microsoft.com/config/rhel/7/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo
 +</code>
 +</WRAP>
 +<WRAP prewrap 100% #result>
 +<code powershell>
 +  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
 +                                 Dload  Upload   Total   Spent    Left  Speed
 +100   193  100   193    0        507      0 --:--:-- --:--:-- --:--:--   507
 +[packages-microsoft-com-prod]
 +name=packages-microsoft-com-prod
 +baseurl=https://packages.microsoft.com/rhel/7/prod/
 +enabled=1
 +gpgcheck=1
 +gpgkey=https://packages.microsoft.com/keys/microsoft.asc
 +</code>
 +</WRAP>
  
 ===== PowerShell の実行 ===== ===== PowerShell の実行 =====
 +<WRAP prewrap 100%>
 <code> <code>
 $ pwsh $ pwsh
 </code> </code>
 +</WRAP>
 +
 **Release Candidate** 版の場合\\ **Release Candidate** 版の場合\\
 +<WRAP prewrap 100%>
 <code> <code>
 $ pwsh-preview $ pwsh-preview
 </code> </code>
 +</WRAP>
  
 ===== PowerShell のバージョン ===== ===== PowerShell のバージョン =====
 +<WRAP prewrap 100%>
 +<code powershell>
 +$ Get-Host
 +</code>
 +</WRAP>
 +<WRAP prewrap 100% #result>
 <code powershell> <code powershell>
-PS > Get-Host 
- 
 Name             : ConsoleHost Name             : ConsoleHost
 Version          : 7.0.0-rc.2 Version          : 7.0.0-rc.2
行 40: 行 129:
 IsRunspacePushed : False IsRunspacePushed : False
 Runspace         : System.Management.Automation.Runspaces.LocalRunspace Runspace         : System.Management.Automation.Runspaces.LocalRunspace
 +</code>
 +</WRAP>
  
- +<WRAP prewrap 100%> 
-PS > Get-Host | Select-Object Version +<code powershell> 
 +Get-Host | Select-Object Version 
 +</code> 
 +</WRAP> 
 +<WRAP prewrap 100% #result> 
 +<code powershell>
 Version Version
 ------- -------
 7.0.0-rc.2 7.0.0-rc.2
 +</code>
 +</WRAP>
  
-PS > $PSVersiontable +<WRAP prewrap 100%> 
 +<code powershell> 
 +$PSVersiontable 
 +</code> 
 +</WRAP> 
 +<WRAP prewrap 100% #result> 
 +<code powershell>
 Name                           Value Name                           Value
 ----                           ----- ----                           -----
行 62: 行 164:
 WSManStackVersion              3.0 WSManStackVersion              3.0
 </code> </code>
 +</WRAP>
  
  • linux/powershell.txt
  • 最終更新: 2023/03/30 21:17
  • by ともやん