linux:powershell

差分

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

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
linux:powershell [2020/09/11 19:15] ともやんlinux:powershell [2023/03/30 21:17] (現在) – [参考文献] ともやん
行 6: 行 6:
 ソースコード: [[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}}\\+{{linux:powershell_v7.3.3_on_fedora_37.png?470|PowerShell 7 on Fedora 37}}\\
  
 ===== インストール ===== ===== インストール =====
行 16: 行 16:
 ==== Fedora - dnf ==== ==== 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]]\\ [[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% #mincode> +[[https://learn.microsoft.com/ja-jp/powershell/scripting/install/install-rhel?view=powershell-7.3|Red Hat Enterprise Linux (RHEL) への PowerShell のインストール - PowerShell]]\\ 
-<code> +<WRAP color_term> 
-# Register the Microsoft signature key +<WRAP color_mincode><code autoconf>
-sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc +
 # Register the Microsoft RedHat repository # Register the Microsoft RedHat repository
-curl https://packages.microsoft.com/config/rhel/7/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo +curl https://packages.microsoft.com/config/rhel/8/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 # Install PowerShell
-sudo dnf install -powershell+sudo dnf install --assumeyes powershell
  
 # Start PowerShell # Start PowerShell
 pwsh pwsh
-</code>+</code></WRAP>
 </WRAP> </WRAP>
  
-<WRAP prewrap 100%+<WRAP color_term
-<code> +<WRAP color_command><html><pre
-$ sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc +<b class=GRN>$</b> <b class=HIY>curl</b> https://packages.microsoft.com/config/rhel/8/prod.repo | <b class=HIY>sudo</b> tee /etc/yum.repos.d/microsoft.repo 
-</code> +</pre></html></WRAP> 
-</WRAP> +<WRAP color_result><html><pre>
- +
-<WRAP prewrap 100%> +
-<code> +
-cat /etc/redhat-release +
-</code> +
-</WRAP> +
-<WRAP prewrap 100% #result> +
-<code powershell> +
-Fedora release 31 (Thirty One) +
-</code> +
-</WRAP> +
- +
-2020/08/30 現在 [[https://packages.microsoft.com/fedora/31/prod/|]] に PowerShell が存在していないので Fedora 30 の packages-microsoft-com-prod ([[https://packages.microsoft.com/fedora/30/prod/|]]) からインストールを行う。\\ +
-<WRAP prewrap 100%> +
-<code> +
-$ curl https://packages.microsoft.com/config/fedora/30/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   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                  Dload  Upload   Total   Spent    Left  Speed                                  Dload  Upload   Total   Spent    Left  Speed
-100   195  100   195           454      0 --:--:-- --:--:-- --:--:--   453+100   192  100   192           303      0 --:--:-- --:--:-- --:--:--   303
 [packages-microsoft-com-prod] [packages-microsoft-com-prod]
 name=packages-microsoft-com-prod name=packages-microsoft-com-prod
-baseurl=https://packages.microsoft.com/fedora/30/prod/+baseurl=https://packages.microsoft.com/rhel/8/prod/
 enabled=1 enabled=1
 gpgcheck=1 gpgcheck=1
 gpgkey=https://packages.microsoft.com/keys/microsoft.asc gpgkey=https://packages.microsoft.com/keys/microsoft.asc
-</code>+</pre></html></WRAP>
 </WRAP> </WRAP>
  
-<WRAP prewrap 100%+<WRAP color_term
-<code+<WRAP color_command><html><pre
-$ sudo dnf install powershell +<b class=GRN>$</b> <b class=HIY>sudo</b> dnf install <b class=HIK>--assumeyes</b> powershell 
-</code> +</pre></html></WRAP> 
-</WRAP> +<WRAP color_result_long><html><pre
-<WRAP prewrap 100% #result> +packages-microsoft-com-prod                                                   1.2 MB/s | 6.0 MB     00:05     
-<code powershell+メタデータの期限切れの最終確認: 0:00:07 時間前の 20230312日 150344秒 に実施しました。
-packages-microsoft-com-prod                                                             608 kB/s | 760 kB     00:01 +
-メタデータの期限切れの最終確認: 0:00:01 時間前の 20200830日 175153秒 に実施しました。+
 依存関係が解決しました。 依存関係が解決しました。
-============================================================================================================ +============================================================================================================== 
- Package             Architecture      Version               Repository                                Size + パッケージ            アーキテクチャー  バージョン              リポジトリー                           サイズ 
-============================================================================================================+==============================================================================================================
 インストール: インストール:
- powershell          x86_64            7.0.3-1.rhel.7        packages-microsoft-com-prod               55 M+ <b class=GRN>powershell</b>            x86_64            7.3.3-1.rh              packages-microsoft-com-prod             68 M
  
 トランザクションの概要 トランザクションの概要
-============================================================================================================+==============================================================================================================
 インストール  1 パッケージ インストール  1 パッケージ
  
-ダウンロードサイズの合計: 55 +ダウンロードサイズの合計: 68 
-インストール済みのサイズ: 151 M +インストールのサイズ: 192 M
-これでよろしいですか? [y/N]: y+
 パッケージのダウンロード: パッケージのダウンロード:
-powershell-7.0.3-1.rhel.7.x86_64.rpm                                            9.MB/s |  55 MB     00:05 +powershell-7.3.3-1.rh.x86_64.rpm                                              1.MB/s |  68 MB     00:35     
------------------------------------------------------------------------------------------------------------- +-------------------------------------------------------------------------------------------------------------- 
-合計                                                                             9.MB/s |  55 MB     00:05+合計                                                                          1.MB/s |  68 MB     00:35     
 トランザクションの確認を実行中 トランザクションの確認を実行中
 トランザクションの確認に成功しました。 トランザクションの確認に成功しました。
行 107: 行 76:
 トランザクションのテストに成功しました。 トランザクションのテストに成功しました。
 トランザクションを実行中 トランザクションを実行中
-  準備             :                                                                                      1/1 +  準備             :                                                                                      1/1  
-  インストール中   : powershell-7.0.3-1.rhel.7.x86_64                                                      1/1 +  インストール中   : powershell-7.3.3-1.rh.x86_64                                                         1/1  
-  scriptletの実行中: powershell-7.0.3-1.rhel.7.x86_64                                                     1/1 +  scriptletの実行中: powershell-7.3.3-1.rh.x86_64                                                         1/1  
-  検証             : powershell-7.0.3-1.rhel.7.x86_64                                                     1/1+  検証             : powershell-7.3.3-1.rh.x86_64                                                         1/1 
  
 インストール済み: インストール済み:
-  powershell-7.0.3-1.rhel.7.x86_64+  powershell-7.3.3-1.rh.x86_64                                                                                
  
 完了しました! 完了しました!
-</code>+</pre></html></WRAP>
 </WRAP> </WRAP>
  
 ===== PowerShell の実行 ===== ===== PowerShell の実行 =====
-<WRAP prewrap 100%+<WRAP color_term
-<code+<WRAP color_command><html><pre
-$ pwsh +<b class=GRN>$</b> <b class=HIY>pwsh</b> 
-</code>+</pre></html></WRAP>
 </WRAP> </WRAP>
  
 **Release Candidate** 版の場合\\ **Release Candidate** 版の場合\\
-<WRAP prewrap 100%+<WRAP color_term
-<code+<WRAP color_command><html><pre
-$ pwsh-preview +<b class=GRN>$</b> <b class=HIY>pwsh-preview</b> 
-</code>+</pre></html></WRAP>
 </WRAP> </WRAP>
  
 ===== PowerShell のバージョン ===== ===== PowerShell のバージョン =====
-<WRAP prewrap 100%+<WRAP color_term
-<code powershell+<WRAP color_command><html><pre
-$ Get-Host +<b class=GRN>$</b> <b class=YEL>Get-Host</b
-</code+</pre></html></WRAP> 
-</WRAP> +<WRAP color_result><html><pre>
-<WRAP prewrap 100% #result+
-<code powershell> +
-Name             : ConsoleHost +
-Version          : 7.0.0-rc.2 +
-InstanceId       : 546f330c-e929-4775-8001-43778f6ce1c7 +
-UI               : System.Management.Automation.Internal.Host.InternalHostUserInterface +
-CurrentCulture   : ja-JP +
-CurrentUICulture : ja-JP +
-PrivateData      : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy +
-DebuggerEnabled  : True +
-IsRunspacePushed : False +
-Runspace         : System.Management.Automation.Runspaces.LocalRunspace +
-</code> +
-</WRAP>+
  
-<WRAP prewrap 100%+<b class=HIG>Name             : </b>ConsoleHost 
-<code powershell+<b class=HIG>Version          : </b>7.3.3 
-$ Get-Host | Select-Object Version +<b class=HIG>InstanceId       : </b>a9548033-3e56-4aec-8c28-1d33694cdde3 
-</code+<b class=HIG>UI               : </b>System.Management.Automation.Internal.Host.InternalHostUserInterface 
-</WRAP+<b class=HIG>CurrentCulture   : </b>ja-JP 
-<WRAP prewrap 100% #result> +<b class=HIG>CurrentUICulture : </b>ja-JP 
-<code powershell> +<b class=HIG>PrivateData      : </b>Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy 
-Version +<b class=HIG>DebuggerEnabled </b>True 
-------+<b class=HIG>IsRunspacePushed : </b>False 
-7.0.0-rc.2 +<b class=HIG>Runspace         : </b>System.Management.Automation.Runspaces.LocalRunspace
-</code+
-</WRAP>+
  
-<WRAP prewrap 100%+ 
-<code powershell+</pre></html></WRAP> 
-$PSVersiontable + 
-</code+<WRAP color_command><html><pre
-</WRAP> +<b class=GRN>$</b> <b class=YEL>Get-Host</b> | <b class=YEL>Select-Object</b> Version 
-<WRAP prewrap 100% #result+</pre></html></WRAP
-<code powershell+<WRAP color_result><html><pre> 
-Name                           Value + 
-----                           ----- +<b class=HIG>Version 
-PSVersion                      7.0.0-rc.2+-------</b> 
 +7.3.3 
 + 
 + 
 +</pre></html></WRAP> 
 + 
 +<WRAP color_command><html><pre
 +<b class=GRN>$</b> <b class=YEL>$PSVersiontable</b
 +</pre></html></WRAP> 
 +<WRAP color_result><html><pre> 
 + 
 +<b class=HIG>Name                           Value 
 +----                           -----</b> 
 +PSVersion                      7.3.3
 PSEdition                      Core PSEdition                      Core
-GitCommitId                    7.0.0-rc.2 +GitCommitId                    7.3.3 
-OS                             Linux 5.4.17-200.fc31.x86_64 #1 SMP Sat Feb 1 19:00:13 UTC 2020+OS                             Linux 6.1.15-200.fc37.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Mar  3 17:29:44 UTC 2…
 Platform                       Unix Platform                       Unix
 PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…} PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
行 185: 行 151:
 SerializationVersion           1.1.0.1 SerializationVersion           1.1.0.1
 WSManStackVersion              3.0 WSManStackVersion              3.0
-</code>+ 
 + 
 +</pre></html></WRAP>
 </WRAP> </WRAP>
 +
 +===== Linux PowerShell で利用可能なコマンドレット =====
 +Windows で使えるコマンドレットが Linux でも使えるとは限らない😱😭\\
 +<WRAP color_term>
 +<WRAP color_command><html><pre>
 +<b class=GRN>$</b> <b class=YEL>Get-NetIPAddress</b>
 +</pre></html></WRAP>
 +<WRAP color_result><html><pre>
 +<b class=RED>Get-NetIPAddress: The term 'Get-NetIPAddress' is not recognized as a name of a cmdlet, function, script file, or executable program.
 +Check the spelling of the name, or if a path was included, verify that the path is correct and try again.</b>
 +</pre></html></WRAP>
 +</WRAP>
 +
 +Windows 用の [[windows:scoop|Scoop]] はインストールすら出来ない😱😅\\
 +<WRAP color_term>
 +<WRAP color_command><html><pre>
 +<b class=GRN>$</b> <b class=YEL>iwr</b> <b class=HIK>-useb</b> get.scoop.sh | <b class=YEL>iex</b>
 +</pre></html></WRAP>
 +<WRAP color_result><html><pre>
 +Initializing...
 +<b class=RED>Scoop requires 'C:\Windows\System32\Robocopy.exe' to work. Please make sure 'C:\Windows\System32' is in your PATH.</b>
 +Abort.
 +</pre></html></WRAP>
 +</WRAP>
 +
 +Linux の PowerShell で利用可能なコマンドレットは <html><code>Get-Command</code></html> コマンドレットで調べることが出来る🤔\\
 +[[windows:powershell:commands:get-command|Get-Command (alias: gcm)]] (Windows)\\
 +<WRAP color_term>
 +<WRAP color_command><html><pre>
 +<b class=GRN>$</b> <b class=YEL>Get-Command</b>
 +</pre></html></WRAP>
 +<WRAP color_result_long><html><pre>
 +
 +CommandType     Name                                               Version    Source
 +-----------     ----                                               -------    ------
 +Function        Add-Config                                                    
 +Function        Add-DefaultConfig                                             
 +Function        Add-ShimsDirToPath                                            
 +Function        cd..                                                          
 +Function        cd\                                                           
 +Function        Clear-Host                                                    
 +Function        Compress-Archive                                   1.2.5      Microsoft.PowerShell.Archive
 +Function        Deny-Install                                                  
 +Function        exec                                                          
 +Function        Expand-Archive                                     1.2.5      Microsoft.PowerShell.Archive
 +Function        Expand-ZipArchive                                             
 +Function        Find-Command                                       2.2.5      PowerShellGet
 +Function        Find-DSCResource                                   2.2.5      PowerShellGet
 +Function        Find-Module                                        2.2.5      PowerShellGet
 +Function        Find-RoleCapability                                2.2.5      PowerShellGet
 +Function        Find-Script                                        2.2.5      PowerShellGet
 +Function        Get-CredsFromCredentialProvider                    2.2.5      PowerShellGet
 +Function        Get-Downloader                                                
 +Function        Get-Env                                                       
 +Function        Get-InstalledModule                                2.2.5      PowerShellGet
 +Function        Get-InstalledScript                                2.2.5      PowerShellGet
 +Function        Get-PSRepository                                   2.2.5      PowerShellGet
 +Function        help                                                          
 +Function        Import-ScoopShim                                              
 +Function        Install-Module                                     2.2.5      PowerShellGet
 +Function        Install-Scoop                                                 
 +Function        Install-Script                                     2.2.5      PowerShellGet
 +Function        New-ScriptFileInfo                                 2.2.5      PowerShellGet
 +Function        Optimize-SecurityProtocol                                     
 +Function        oss                                                           
 +Function        Out-UTF8File                                                  
 +Function        Pause                                                         
 +Function        prompt                                                        
 +Function        PSConsoleHostReadLine                              2.2.6      PSReadLine
 +Function        Publish-Module                                     2.2.5      PowerShellGet
 +Function        Publish-Script                                     2.2.5      PowerShellGet
 +Function        Register-PSRepository                              2.2.5      PowerShellGet
 +Function        Save-Module                                        2.2.5      PowerShellGet
 +Function        Save-Script                                        2.2.5      PowerShellGet
 +Function        Set-PSRepository                                   2.2.5      PowerShellGet
 +Function        TabExpansion2                                                 
 +Function        Test-IsAdministrator                                          
 +Function        Test-isFileLocked                                             
 +Function        Test-Prerequisite                                             
 +Function        Test-ScriptFileInfo                                2.2.5      PowerShellGet
 +Function        Test-ValidateParameter                                        
 +Function        Uninstall-Module                                   2.2.5      PowerShellGet
 +Function        Uninstall-Script                                   2.2.5      PowerShellGet
 +Function        Unregister-PSRepository                            2.2.5      PowerShellGet
 +Function        Update-Module                                      2.2.5      PowerShellGet
 +Function        Update-ModuleManifest                              2.2.5      PowerShellGet
 +Function        Update-Script                                      2.2.5      PowerShellGet
 +Function        Update-ScriptFileInfo                              2.2.5      PowerShellGet
 +Function        Use-Config                                                    
 +Function        Write-DebugInfo                                               
 +Function        Write-Env                                                     
 +Function        Write-InstallInfo                                             
 +Cmdlet          Add-Content                                        7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          Add-History                                        7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          Add-Member                                         7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Add-Type                                           7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Clear-Content                                      7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          Clear-History                                      7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          Clear-Item                                         7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          Clear-ItemProperty                                 7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          Clear-Variable                                     7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Compare-Object                                     7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Convert-Path                                       7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          ConvertFrom-Csv                                    7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          ConvertFrom-Json                                   7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          ConvertFrom-Markdown                               7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          ConvertFrom-SecureString                           7.0.0.0    Microsoft.PowerShell.Security
 +Cmdlet          ConvertFrom-StringData                             7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          ConvertTo-Csv                                      7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          ConvertTo-Html                                     7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          ConvertTo-Json                                     7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          ConvertTo-SecureString                             7.0.0.0    Microsoft.PowerShell.Security
 +Cmdlet          ConvertTo-Xml                                      7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Copy-Item                                          7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          Copy-ItemProperty                                  7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          Debug-Job                                          7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          Debug-Process                                      7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          Debug-Runspace                                     7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Disable-ExperimentalFeature                        7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          Disable-PSBreakpoint                               7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Disable-RunspaceDebug                              7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Enable-ExperimentalFeature                         7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          Enable-PSBreakpoint                                7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Enable-RunspaceDebug                               7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Enter-PSHostProcess                                7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          Enter-PSSession                                    7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          Exit-PSHostProcess                                 7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          Exit-PSSession                                     7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          Export-Alias                                       7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Export-Clixml                                      7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Export-Csv                                         7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Export-FormatData                                  7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Export-ModuleMember                                7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          Export-PSSession                                   7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Find-Package                                       1.4.8.1    PackageManagement
 +Cmdlet          Find-PackageProvider                               1.4.8.1    PackageManagement
 +Cmdlet          ForEach-Object                                     7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          Format-Custom                                      7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Format-Hex                                         7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Format-List                                        7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Format-Table                                       7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Format-Wide                                        7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Get-Alias                                          7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Get-ChildItem                                      7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          Get-Clipboard                                      7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          Get-CmsMessage                                     7.0.0.0    Microsoft.PowerShell.Security
 +Cmdlet          Get-Command                                        7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          Get-Content                                        7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          Get-Credential                                     7.0.0.0    Microsoft.PowerShell.Security
 +Cmdlet          Get-Culture                                        7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Get-Date                                           7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Get-Error                                          7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Get-Event                                          7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Get-EventSubscriber                                7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Get-ExecutionPolicy                                7.0.0.0    Microsoft.PowerShell.Security
 +Cmdlet          Get-ExperimentalFeature                            7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          Get-FileHash                                       7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Get-FormatData                                     7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Get-Help                                           7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          Get-History                                        7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          Get-Host                                           7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Get-Item                                           7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          Get-ItemProperty                                   7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          Get-ItemPropertyValue                              7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          Get-Job                                            7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          Get-Location                                       7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          Get-MarkdownOption                                 7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Get-Member                                         7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Get-Module                                         7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          Get-Package                                        1.4.8.1    PackageManagement
 +Cmdlet          Get-PackageProvider                                1.4.8.1    PackageManagement
 +Cmdlet          Get-PackageSource                                  1.4.8.1    PackageManagement
 +Cmdlet          Get-PfxCertificate                                 7.0.0.0    Microsoft.PowerShell.Security
 +Cmdlet          Get-Process                                        7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          Get-PSBreakpoint                                   7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Get-PSCallStack                                    7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Get-PSDrive                                        7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          Get-PSHostProcessInfo                              7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          Get-PSProvider                                     7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          Get-PSReadLineKeyHandler                           2.2.6      PSReadLine
 +Cmdlet          Get-PSReadLineOption                               2.2.6      PSReadLine
 +Cmdlet          Get-PSSession                                      7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          Get-Random                                         7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Get-Runspace                                       7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Get-RunspaceDebug                                  7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Get-TimeZone                                       7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          Get-TraceSource                                    7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Get-TypeData                                       7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Get-UICulture                                      7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Get-Unique                                         7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Get-Uptime                                         7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Get-Variable                                       7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Get-Verb                                           7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Group-Object                                       7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Import-Alias                                       7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Import-Clixml                                      7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Import-Csv                                         7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Import-LocalizedData                               7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Import-Module                                      7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          Import-PackageProvider                             1.4.8.1    PackageManagement
 +Cmdlet          Import-PowerShellDataFile                          7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Import-PSSession                                   7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Install-Package                                    1.4.8.1    PackageManagement
 +Cmdlet          Install-PackageProvider                            1.4.8.1    PackageManagement
 +Cmdlet          Invoke-Command                                     7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          Invoke-Expression                                  7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Invoke-History                                     7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          Invoke-Item                                        7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          Invoke-RestMethod                                  7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Invoke-WebRequest                                  7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Join-Path                                          7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          Join-String                                        7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Measure-Command                                    7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Measure-Object                                     7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Move-Item                                          7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          Move-ItemProperty                                  7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          New-Alias                                          7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          New-Event                                          7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          New-Guid                                           7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          New-Item                                           7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          New-ItemProperty                                   7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          New-Module                                         7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          New-ModuleManifest                                 7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          New-Object                                         7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          New-PSDrive                                        7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          New-PSRoleCapabilityFile                           7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          New-PSSession                                      7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          New-PSSessionConfigurationFile                     7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          New-PSSessionOption                                7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          New-PSTransportOption                              7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          New-TemporaryFile                                  7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          New-TimeSpan                                       7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          New-Variable                                       7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Out-Default                                        7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          Out-File                                           7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Out-Host                                           7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          Out-Null                                           7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          Out-String                                         7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Pop-Location                                       7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          Protect-CmsMessage                                 7.0.0.0    Microsoft.PowerShell.Security
 +Cmdlet          Push-Location                                      7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          Read-Host                                          7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Receive-Job                                        7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          Register-ArgumentCompleter                         7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          Register-EngineEvent                               7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Register-ObjectEvent                               7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Register-PackageSource                             1.4.8.1    PackageManagement
 +Cmdlet          Remove-Alias                                       7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Remove-Event                                       7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Remove-Item                                        7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          Remove-ItemProperty                                7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          Remove-Job                                         7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          Remove-Module                                      7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          Remove-PSBreakpoint                                7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Remove-PSDrive                                     7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          Remove-PSReadLineKeyHandler                        2.2.6      PSReadLine
 +Cmdlet          Remove-PSSession                                   7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          Remove-TypeData                                    7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Remove-Variable                                    7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Rename-Item                                        7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          Rename-ItemProperty                                7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          Resolve-Path                                       7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          Restart-Computer                                   7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          Save-Help                                          7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          Save-Package                                       1.4.8.1    PackageManagement
 +Cmdlet          Select-Object                                      7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Select-String                                      7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Select-Xml                                         7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Send-MailMessage                                   7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Set-Alias                                          7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Set-Clipboard                                      7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          Set-Content                                        7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          Set-Date                                           7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Set-ExecutionPolicy                                7.0.0.0    Microsoft.PowerShell.Security
 +Cmdlet          Set-Item                                           7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          Set-ItemProperty                                   7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          Set-Location                                       7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          Set-MarkdownOption                                 7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Set-PackageSource                                  1.4.8.1    PackageManagement
 +Cmdlet          Set-PSBreakpoint                                   7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Set-PSDebug                                        7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          Set-PSReadLineKeyHandler                           2.2.6      PSReadLine
 +Cmdlet          Set-PSReadLineOption                               2.2.6      PSReadLine
 +Cmdlet          Set-StrictMode                                     7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          Set-TraceSource                                    7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Set-Variable                                       7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Show-Markdown                                      7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Sort-Object                                        7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Split-Path                                         7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          Start-Job                                          7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          Start-Process                                      7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          Start-Sleep                                        7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Start-ThreadJob                                    2.0.3      ThreadJob
 +Cmdlet          Start-Transcript                                   7.0.0.0    Microsoft.PowerShell.Host
 +Cmdlet          Stop-Computer                                      7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          Stop-Job                                           7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          Stop-Process                                       7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          Stop-Transcript                                    7.0.0.0    Microsoft.PowerShell.Host
 +Cmdlet          Switch-Process                                     7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          Tee-Object                                         7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Test-Connection                                    7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          Test-Json                                          7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Test-ModuleManifest                                7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          Test-Path                                          7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          Trace-Command                                      7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Unblock-File                                       7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Uninstall-Package                                  1.4.8.1    PackageManagement
 +Cmdlet          Unprotect-CmsMessage                               7.0.0.0    Microsoft.PowerShell.Security
 +Cmdlet          Unregister-Event                                   7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Unregister-PackageSource                           1.4.8.1    PackageManagement
 +Cmdlet          Update-FormatData                                  7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Update-Help                                        7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          Update-List                                        7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Update-TypeData                                    7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Wait-Debugger                                      7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Wait-Event                                         7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Wait-Job                                           7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          Wait-Process                                       7.0.0.0    Microsoft.PowerShell.Management
 +Cmdlet          Where-Object                                       7.3.3.500  Microsoft.PowerShell.Core
 +Cmdlet          Write-Debug                                        7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Write-Error                                        7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Write-Host                                         7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Write-Information                                  7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Write-Output                                       7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Write-Progress                                     7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Write-Verbose                                      7.0.0.0    Microsoft.PowerShell.Utility
 +Cmdlet          Write-Warning                                      7.0.0.0    Microsoft.PowerShell.Utility
 +</pre></html></WRAP>
 +</WRAP>
 +
 +===== トラブルシューティング =====
 +<WRAP color_term>
 +<WRAP color_command><html><pre>
 +<b class=GRN>$</b> <b class=HIY>sudo</b> dnf update <b class=HIK>-y</b>
 +</pre></html></WRAP>
 +<WRAP color_result><html><pre>
 +メタデータの期限切れの最終確認: 0:22:41 時間前の 2023年03月30日 20時00分44秒 に実施しました。
 +依存関係が解決しました。
 +
 + 問題: unixODBC-2.3.11-1.fc37.i686 は下位アーキテクチャがあります
 +  - unixODBC-2.3.11-1.rh.x86_64 と unixODBC-2.3.11-1.fc37.x86_64 どちらもインストールできません
 +  - パッケージの最良アップデート候補をインストールできません unixODBC-2.3.11-1.fc37.i686
 +  - パッケージの最良アップデート候補をインストールできません unixODBC-2.3.11-1.fc37.x86_64
 +==============================================================================================================
 + パッケージ          アーキテクチャー  バージョン                リポジトリー                           サイズ
 +==============================================================================================================
 +競合するパッケージをスキップします:
 +(アップグレードを強制するにはコマンドラインに '--best --allowerasing' を追加します):
 + unixODBC            x86_64            2.3.11-1.rh               packages-microsoft-com-prod            274 k
 +
 +トランザクションの概要
 +==============================================================================================================
 +スキップ  1 パッケージ
 +
 +行うべきことはありません。
 +完了しました!
 +</pre></html></WRAP>
 +</WRAP>
 +
 +使いものにならないしトラブルの原因だから叩き消すしか無い😅\\
 +<WRAP color_term>
 +<WRAP color_command><html><pre>
 +<b class=GRN>$</b> <b class=HIY>sudo</b> dnf remove powershell && <b class=HIY>sudo</b> rm /etc/yum.repos.d/microsoft.repo
 +</pre></html></WRAP>
 +<WRAP color_result><html><pre>
 +依存関係が解決しました。
 +==============================================================================================================
 + パッケージ            アーキテクチャー  バージョン             リポジトリー                            サイズ
 +==============================================================================================================
 +削除中:
 + powershell            x86_64            7.3.3-1.rh             @packages-microsoft-com-prod            192 M
 +
 +トランザクションの概要
 +==============================================================================================================
 +削除  1 パッケージ
 +
 +解放された容量: 192 M
 +これでよろしいですか? [y/N]: y
 +トランザクションの確認を実行中
 +トランザクションの確認に成功しました。
 +トランザクションのテストを実行中
 +トランザクションのテストに成功しました。
 +トランザクションを実行中
 +  準備             :                                                                                      1/1 
 +  削除             : powershell-7.3.3-1.rh.x86_64                                                         1/
 +  scriptletの実行中: powershell-7.3.3-1.rh.x86_64                                                         1/
 +  検証             : powershell-7.3.3-1.rh.x86_64                                                         1/
 +
 +削除しました:
 +  powershell-7.3.3-1.rh.x86_64                                                                                
 +
 +完了しました!
 +</pre></html></WRAP>
 +</WRAP>
 +
 +===== 参考文献 =====
 +[[https://redmondmag.com/articles/2016/11/14/work-with-powershell-in-linux.aspx|How To Work with PowerShell in Linux -- Redmondmag.com]]\\
 +
 +==== 付録 ====
 +[[tw>tomoyan596sp/status/1635048579818721282|Linux版のPowerShellはdotnetがクロスプラットフォームなってはいるけど、海外のMVPもブログに書いてるけど、WindowsではたくさんあるコマンドレットがLinuxでは実装されて無い😅ScoopもWindows用で動かないし、何に使えるのかいまだによく分からない🫠]]\\
 +[[tw>tomoyan596sp/status/1641403175226986497|MSはどうしてこう問題ばかり起こすんだ!💢😡LinuxのPowerShellを試した私がバカでした🤣公式パッケージと競合しているので強制更新するとWineが削除されます🤔ド素人みたいに影響を分かっていない😅]]\\
  
  • linux/powershell.1599819350.txt.gz
  • 最終更新: 2020/09/11 19:15
  • by ともやん