UJP - 技術情報1

Life is fun and easy!

不正IP報告数

Okan Sensor
 
メイン
ログイン
ブログ カテゴリ一覧

HomeBrewでMicrosoft PowerShell 6.2.4をインストールする

HomeBrewでMicrosoft PowerShell 6.2.4をインストールする


更新履歴

  • 初版 2020/02/01

はじめに

  • PowerShellは2006年に発表されたWindows用の言語環境で,バッチファイルなどの旧式のシェルの置き換えとして発展したけれど,マルチプラットフォーム戦略故にmacOSやLinuxでも利用できるように準備されている.
  • という事で,macOS Higi Sierra 10.13.6の環境にインストールしてみた.
  • 前提として,HomeBrewはセットアップ済み,XcodeやOpenSSLも必要.

バージョンの確認

  • Brewでもリポジトリはcaskになる模様.
       $ brew cask info powershell🆑
       powershell: 6.2.4
       https://github.com/PowerShell/PowerShell
       Not installed
       From: https://github.com/Homebrew/homebrew-cask/blob/master/Casks/powershell.rb
       ==> Name
       PowerShell
       ==> Artifacts
       powershell-6.2.4-osx-x64.pkg (Pkg)
       $

インストール

  • インストールは,インストール先の管理者権限のあるユーザで行う.
       $ brew cask install powershell🆑
       ==> Downloading https://github.com/PowerShell/PowerShell/releases/download/v6.2.4/powersh
       ==> Downloading from https://github-production-release-asset-2e65be.s3.amazonaws.com/4960
       ######################################################################## 100.0%
       ==> Verifying SHA-256 checksum for Cask 'powershell'.
       All Formula dependencies satisfied.
       ==> Installing Cask powershell
       ==> Running installer for powershell; your password may be necessary.
       ==> Package installers may write to any location; options such as --appdir are ignored.
       Password:🈁
  • インストールしているユーザのパスワードを入力.
       installer: Package name is PowerShell - 6.2.4
       installer: Installing at base path /
       installer: The install was successful.
       🍺  powershell was successfully installed!
       $
  • インストール完了.

PowerShellを起動して使って見る

  • PowerShellは,macOS用ではpwshコマンドになっている.
       $ pwsh🆑
       PowerShell 6.2.4
       Copyright (c) Microsoft Corporation. All rights reserved.
       
       https://aka.ms/pscore6-docs
       Type 'help' to get help.
       
       PS /Users/ujpadmin>
  • 簡単なコマンドを実行して見る.
       
       PS /Users/ujpadmin> Get-ChildItem🆑
           Directory: /Users/ujpadmin
       
       Mode                LastWriteTime         Length Name
       ----                -------------         ------ ----
       d-----        2018/04/08     1:04                Applications
       d-----        2019/11/26    19:51                Desktop
       d-----        2020/01/18    20:37                Documents
       d-----        2020/01/30    23:16                Downloads
       d-----        2018/07/16     8:11                lib
       d-----        2019/09/24    23:43                Library
       d-----        2019/10/26     0:21                Movies
       d-----        2019/02/19    19:14                Music
       d-----        2019/06/23     0:48                Pictures
       d-----        2018/01/23    23:56                Public
       d-----        2018/04/26    23:48                PycharmProjects
       d-----        2019/01/22    23:32                VirtualBox VMs
       ------        2019/08/12    16:10              4 aaa.txt
       ------        2018/11/07     1:03              0 Formulae
       
       PS /Users/ujpadmin>
  • カレントディレクトリ配下のファイルリストが表示された.

用意されているコマンドレットを確認

  • PowerShellで用意されているコマンドは,コマンドレットと呼ばれるが,その一覧を取得する.
       PS /Users/ujpadmin> Get-Command🆑
       
       CommandType Name                                      Version Source
       ----------- ----                                      ------- ------
       Function    Add-NodeKeys                              0.0     PSDesiredStateConfiguration
       Function    AddDscResourceProperty                    0.0     PSDesiredStateConfiguration
       Function    AddDscResourcePropertyFromMetadata        0.0     PSDesiredStateConfiguration
       Function    cd..
       Function    cd\
       Function    CheckResourceFound                        0.0     PSDesiredStateConfiguration
       Function    Clear-Host
       Function    Compress-Archive                          1.2.3.0 Microsoft.PowerShell.Archive
       Function    Configuration                             0.0     PSDesiredStateConfiguration
       Function    ConvertTo-MOFInstance                     0.0     PSDesiredStateConfiguration
       Function    Expand-Archive                            1.2.3.0 Microsoft.PowerShell.Archive
       Function    Find-Command                              2.1.3   PowerShellGet
       Function    Find-DSCResource                          2.1.3   PowerShellGet
       Function    Find-Module                               2.1.3   PowerShellGet
       Function    Find-RoleCapability                       2.1.3   PowerShellGet
       Function    Find-Script                               2.1.3   PowerShellGet
       Function    Generate-VersionInfo                      0.0     PSDesiredStateConfiguration
       Function    Get-CompatibleVersionAddtionaPropertiesStr0.0     PSDesiredStateConfiguration
       Function    Get-ComplexResourceQualifier              0.0     PSDesiredStateConfiguration
       Function    Get-ConfigurationErrorCount               0.0     PSDesiredStateConfiguration
       Function    Get-DscResource                           0.0     PSDesiredStateConfiguration
       Function    Get-DSCResourceModules                    0.0     PSDesiredStateConfiguration
       Function    Get-EncryptedPassword                     0.0     PSDesiredStateConfiguration
       Function    Get-InnerMostErrorRecord                  0.0     PSDesiredStateConfiguration
       Function    Get-InstalledModule                       2.1.3   PowerShellGet
       Function    Get-InstalledScript                       2.1.3   PowerShellGet
       Function    Get-MofInstanceName                       0.0     PSDesiredStateConfiguration
       Function    Get-MofInstanceText                       0.0     PSDesiredStateConfiguration
       Function    Get-PositionInfo                          0.0     PSDesiredStateConfiguration
       Function    Get-PSCurrentConfigurationNode            0.0     PSDesiredStateConfiguration
       Function    Get-PSDefaultConfigurationDocument        0.0     PSDesiredStateConfiguration
       Function    Get-PSMetaConfigDocumentInstVersionInfo   0.0     PSDesiredStateConfiguration
       Function    Get-PSMetaConfigurationProcessed          0.0     PSDesiredStateConfiguration
       Function    Get-PSRepository                          2.1.3   PowerShellGet
       Function    Get-PSTopConfigurationName                0.0     PSDesiredStateConfiguration
       Function    Get-PublicKeyFromFile                     0.0     PSDesiredStateConfiguration
       Function    Get-PublicKeyFromStore                    0.0     PSDesiredStateConfiguration
       Function    GetCompositeResource                      0.0     PSDesiredStateConfiguration
       Function    GetImplementingModulePath                 0.0     PSDesiredStateConfiguration
       Function    GetModule                                 0.0     PSDesiredStateConfiguration
       Function    GetPatterns                               0.0     PSDesiredStateConfiguration
       Function    GetResourceFromKeyword                    0.0     PSDesiredStateConfiguration
       Function    GetSyntax                                 0.0     PSDesiredStateConfiguration
       Function    help
       Function    ImportCimAndScriptKeywordsFromModule      0.0     PSDesiredStateConfiguration
       Function    ImportClassResourcesFromModule            0.0     PSDesiredStateConfiguration
       Function    Initialize-ConfigurationRuntimeState      0.0     PSDesiredStateConfiguration
       Function    Install-Module                            2.1.3   PowerShellGet
       Function    Install-Script                            2.1.3   PowerShellGet
       Function    IsHiddenResource                          0.0     PSDesiredStateConfiguration
       Function    IsPatternMatched                          0.0     PSDesiredStateConfiguration
       Function    New-DscChecksum                           0.0     PSDesiredStateConfiguration
       Function    New-ScriptFileInfo                        2.1.3   PowerShellGet
       Function    Node                                      0.0     PSDesiredStateConfiguration
       Function    oss
       Function    Pause
       Function    prompt
       Function    PSConsoleHostReadLine                     2.0.0   PSReadLine
       Function    Publish-Module                            2.1.3   PowerShellGet
       Function    Publish-Script                            2.1.3   PowerShellGet
       Function    ReadEnvironmentFile                       0.0     PSDesiredStateConfiguration
       Function    Register-PSRepository                     2.1.3   PowerShellGet
       Function    Save-Module                               2.1.3   PowerShellGet
       Function    Save-Script                               2.1.3   PowerShellGet
       Function    Set-NodeExclusiveResources                0.0     PSDesiredStateConfiguration
       Function    Set-NodeManager                           0.0     PSDesiredStateConfiguration
       Function    Set-NodeResources                         0.0     PSDesiredStateConfiguration
       Function    Set-NodeResourceSource                    0.0     PSDesiredStateConfiguration
       Function    Set-PSCurrentConfigurationNode            0.0     PSDesiredStateConfiguration
       Function    Set-PSDefaultConfigurationDocument        0.0     PSDesiredStateConfiguration
       Function    Set-PSMetaConfigDocInsProcessedBeforeMeta 0.0     PSDesiredStateConfiguration
       Function    Set-PSMetaConfigVersionInfoV2             0.0     PSDesiredStateConfiguration
       Function    Set-PSRepository                          2.1.3   PowerShellGet
       Function    Set-PSTopConfigurationName                0.0     PSDesiredStateConfiguration
       Function    StrongConnect                             0.0     PSDesiredStateConfiguration
       Function    TabExpansion2
       Function    Test-ConflictingResources                 0.0     PSDesiredStateConfiguration
       Function    Test-ModuleReloadRequired                 0.0     PSDesiredStateConfiguration
       Function    Test-MofInstanceText                      0.0     PSDesiredStateConfiguration
       Function    Test-NodeManager                          0.0     PSDesiredStateConfiguration
       Function    Test-NodeResources                        0.0     PSDesiredStateConfiguration
       Function    Test-NodeResourceSource                   0.0     PSDesiredStateConfiguration
       Function    Test-ScriptFileInfo                       2.1.3   PowerShellGet
       Function    ThrowError                                0.0     PSDesiredStateConfiguration
       Function    Uninstall-Module                          2.1.3   PowerShellGet
       Function    Uninstall-Script                          2.1.3   PowerShellGet
       Function    Unregister-PSRepository                   2.1.3   PowerShellGet
       Function    Update-ConfigurationDocumentRef           0.0     PSDesiredStateConfiguration
       Function    Update-ConfigurationErrorCount            0.0     PSDesiredStateConfiguration
       Function    Update-DependsOn                          0.0     PSDesiredStateConfiguration
       Function    Update-LocalConfigManager                 0.0     PSDesiredStateConfiguration
       Function    Update-Module                             2.1.3   PowerShellGet
       Function    Update-ModuleManifest                     2.1.3   PowerShellGet
       Function    Update-ModuleVersion                      0.0     PSDesiredStateConfiguration
       Function    Update-Script                             2.1.3   PowerShellGet
       Function    Update-ScriptFileInfo                     2.1.3   PowerShellGet
       Function    ValidateNoCircleInNodeResources           0.0     PSDesiredStateConfiguration
       Function    ValidateNodeExclusiveResources            0.0     PSDesiredStateConfiguration
       Function    ValidateNodeManager                       0.0     PSDesiredStateConfiguration
       Function    ValidateNodeResources                     0.0     PSDesiredStateConfiguration
       Function    ValidateNodeResourceSource                0.0     PSDesiredStateConfiguration
       Function    ValidateNoNameNodeResources               0.0     PSDesiredStateConfiguration
       Function    ValidateUpdate-ConfigurationData          0.0     PSDesiredStateConfiguration
       Function    Write-Log                                 0.0     PSDesiredStateConfiguration
       Function    Write-MetaConfigFile                      0.0     PSDesiredStateConfiguration
       Function    Write-NodeMOFFile                         0.0     PSDesiredStateConfiguration
       Function    WriteFile                                 0.0     PSDesiredStateConfiguration
       Cmdlet      Add-Content                               6.1.0.0 Microsoft.PowerShell.Management
       Cmdlet      Add-History                               6.2.4.0 Microsoft.PowerShell.Core
       Cmdlet      Add-Member                                6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Add-Type                                  6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Clear-Content                             6.1.0.0 Microsoft.PowerShell.Management
       Cmdlet      Clear-History                             6.2.4.0 Microsoft.PowerShell.Core
       Cmdlet      Clear-Item                                6.1.0.0 Microsoft.PowerShell.Management
       Cmdlet      Clear-ItemProperty                        6.1.0.0 Microsoft.PowerShell.Management
       Cmdlet      Clear-Variable                            6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Compare-Object                            6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Convert-Path                              6.1.0.0 Microsoft.PowerShell.Management
       Cmdlet      ConvertFrom-Csv                           6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      ConvertFrom-Json                          6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      ConvertFrom-Markdown                      6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      ConvertFrom-SecureString                  6.1.0.0 Microsoft.PowerShell.Security
       Cmdlet      ConvertFrom-StringData                    6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      ConvertTo-Csv                             6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      ConvertTo-Html                            6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      ConvertTo-Json                            6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      ConvertTo-SecureString                    6.1.0.0 Microsoft.PowerShell.Security
       Cmdlet      ConvertTo-Xml                             6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Copy-Item                                 6.1.0.0 Microsoft.PowerShell.Management
       Cmdlet      Copy-ItemProperty                         6.1.0.0 Microsoft.PowerShell.Management
       Cmdlet      Debug-Job                                 6.2.4.0 Microsoft.PowerShell.Core
       Cmdlet      Debug-Process                             6.1.0.0 Microsoft.PowerShell.Management
       Cmdlet      Debug-Runspace                            6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Disable-ExperimentalFeature               6.2.4.0 Microsoft.PowerShell.Core
       Cmdlet      Disable-PSBreakpoint                      6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Disable-RunspaceDebug                     6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Enable-ExperimentalFeature                6.2.4.0 Microsoft.PowerShell.Core
       Cmdlet      Enable-PSBreakpoint                       6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Enable-RunspaceDebug                      6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Enter-PSHostProcess                       6.2.4.0 Microsoft.PowerShell.Core
       Cmdlet      Enter-PSSession                           6.2.4.0 Microsoft.PowerShell.Core
       Cmdlet      Exit-PSHostProcess                        6.2.4.0 Microsoft.PowerShell.Core
       Cmdlet      Exit-PSSession                            6.2.4.0 Microsoft.PowerShell.Core
       Cmdlet      Export-Alias                              6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Export-Clixml                             6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Export-Csv                                6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Export-FormatData                         6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Export-ModuleMember                       6.2.4.0 Microsoft.PowerShell.Core
       Cmdlet      Export-PSSession                          6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Find-Package                              1.3.2   PackageManagement
       Cmdlet      Find-PackageProvider                      1.3.2   PackageManagement
       Cmdlet      ForEach-Object                            6.2.4.0 Microsoft.PowerShell.Core
       Cmdlet      Format-Custom                             6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Format-Hex                                6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Format-List                               6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Format-Table                              6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Format-Wide                               6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Get-Alias                                 6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Get-ChildItem                             6.1.0.0 Microsoft.PowerShell.Management
       Cmdlet      Get-Command                               6.2.4.0 Microsoft.PowerShell.Core
       Cmdlet      Get-Content                               6.1.0.0 Microsoft.PowerShell.Management
       Cmdlet      Get-Credential                            6.1.0.0 Microsoft.PowerShell.Security
       Cmdlet      Get-Culture                               6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Get-Date                                  6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Get-Event                                 6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Get-EventSubscriber                       6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Get-ExecutionPolicy                       6.1.0.0 Microsoft.PowerShell.Security
       Cmdlet      Get-ExperimentalFeature                   6.2.4.0 Microsoft.PowerShell.Core
       Cmdlet      Get-FileHash                              6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Get-FormatData                            6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Get-Help                                  6.2.4.0 Microsoft.PowerShell.Core
       Cmdlet      Get-History                               6.2.4.0 Microsoft.PowerShell.Core
       Cmdlet      Get-Host                                  6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Get-Item                                  6.1.0.0 Microsoft.PowerShell.Management
       Cmdlet      Get-ItemProperty                          6.1.0.0 Microsoft.PowerShell.Management
       Cmdlet      Get-ItemPropertyValue                     6.1.0.0 Microsoft.PowerShell.Management
       Cmdlet      Get-Job                                   6.2.4.0 Microsoft.PowerShell.Core
       Cmdlet      Get-Location                              6.1.0.0 Microsoft.PowerShell.Management
       Cmdlet      Get-MarkdownOption                        6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Get-Member                                6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Get-Module                                6.2.4.0 Microsoft.PowerShell.Core
       Cmdlet      Get-Package                               1.3.2   PackageManagement
       Cmdlet      Get-PackageProvider                       1.3.2   PackageManagement
       Cmdlet      Get-PackageSource                         1.3.2   PackageManagement
       Cmdlet      Get-PfxCertificate                        6.1.0.0 Microsoft.PowerShell.Security
       Cmdlet      Get-Process                               6.1.0.0 Microsoft.PowerShell.Management
       Cmdlet      Get-PSBreakpoint                          6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Get-PSCallStack                           6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Get-PSDrive                               6.1.0.0 Microsoft.PowerShell.Management
       Cmdlet      Get-PSHostProcessInfo                     6.2.4.0 Microsoft.PowerShell.Core
       Cmdlet      Get-PSProvider                            6.1.0.0 Microsoft.PowerShell.Management
       Cmdlet      Get-PSReadLineKeyHandler                  2.0.0   PSReadLine
       Cmdlet      Get-PSReadLineOption                      2.0.0   PSReadLine
       Cmdlet      Get-PSSession                             6.2.4.0 Microsoft.PowerShell.Core
       Cmdlet      Get-Random                                6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Get-Runspace                              6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Get-RunspaceDebug                         6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Get-TimeZone                              6.1.0.0 Microsoft.PowerShell.Management
       Cmdlet      Get-TraceSource                           6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Get-TypeData                              6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Get-UICulture                             6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Get-Unique                                6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Get-Uptime                                6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Get-Variable                              6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Get-Verb                                  6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Group-Object                              6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Import-Alias                              6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Import-Clixml                             6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Import-Csv                                6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Import-LocalizedData                      6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Import-Module                             6.2.4.0 Microsoft.PowerShell.Core
       Cmdlet      Import-PackageProvider                    1.3.2   PackageManagement
       Cmdlet      Import-PowerShellDataFile                 6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Import-PSSession                          6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Install-Package                           1.3.2   PackageManagement
       Cmdlet      Install-PackageProvider                   1.3.2   PackageManagement
       Cmdlet      Invoke-Command                            6.2.4.0 Microsoft.PowerShell.Core
       Cmdlet      Invoke-Expression                         6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Invoke-History                            6.2.4.0 Microsoft.PowerShell.Core
       Cmdlet      Invoke-Item                               6.1.0.0 Microsoft.PowerShell.Management
       Cmdlet      Invoke-RestMethod                         6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Invoke-WebRequest                         6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Join-Path                                 6.1.0.0 Microsoft.PowerShell.Management
       Cmdlet      Join-String                               6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Measure-Command                           6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Measure-Object                            6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Move-Item                                 6.1.0.0 Microsoft.PowerShell.Management
       Cmdlet      Move-ItemProperty                         6.1.0.0 Microsoft.PowerShell.Management
       Cmdlet      New-Alias                                 6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      New-Event                                 6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      New-Guid                                  6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      New-Item                                  6.1.0.0 Microsoft.PowerShell.Management
       Cmdlet      New-ItemProperty                          6.1.0.0 Microsoft.PowerShell.Management
       Cmdlet      New-Module                                6.2.4.0 Microsoft.PowerShell.Core
       Cmdlet      New-ModuleManifest                        6.2.4.0 Microsoft.PowerShell.Core
       Cmdlet      New-Object                                6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      New-PSDrive                               6.1.0.0 Microsoft.PowerShell.Management
       Cmdlet      New-PSRoleCapabilityFile                  6.2.4.0 Microsoft.PowerShell.Core
       Cmdlet      New-PSSession                             6.2.4.0 Microsoft.PowerShell.Core
       Cmdlet      New-PSSessionOption                       6.2.4.0 Microsoft.PowerShell.Core
       Cmdlet      New-PSTransportOption                     6.2.4.0 Microsoft.PowerShell.Core
       Cmdlet      New-TemporaryFile                         6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      New-TimeSpan                              6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      New-Variable                              6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Out-Default                               6.2.4.0 Microsoft.PowerShell.Core
       Cmdlet      Out-File                                  6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Out-Host                                  6.2.4.0 Microsoft.PowerShell.Core
       Cmdlet      Out-Null                                  6.2.4.0 Microsoft.PowerShell.Core
       Cmdlet      Out-String                                6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Pop-Location                              6.1.0.0 Microsoft.PowerShell.Management
       Cmdlet      Push-Location                             6.1.0.0 Microsoft.PowerShell.Management
       Cmdlet      Read-Host                                 6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Receive-Job                               6.2.4.0 Microsoft.PowerShell.Core
       Cmdlet      Register-ArgumentCompleter                6.2.4.0 Microsoft.PowerShell.Core
       Cmdlet      Register-EngineEvent                      6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Register-ObjectEvent                      6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Register-PackageSource                    1.3.2   PackageManagement
       Cmdlet      Remove-Alias                              6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Remove-Event                              6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Remove-Item                               6.1.0.0 Microsoft.PowerShell.Management
       Cmdlet      Remove-ItemProperty                       6.1.0.0 Microsoft.PowerShell.Management
       Cmdlet      Remove-Job                                6.2.4.0 Microsoft.PowerShell.Core
       Cmdlet      Remove-Module                             6.2.4.0 Microsoft.PowerShell.Core
       Cmdlet      Remove-PSBreakpoint                       6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Remove-PSDrive                            6.1.0.0 Microsoft.PowerShell.Management
       Cmdlet      Remove-PSReadLineKeyHandler               2.0.0   PSReadLine
       Cmdlet      Remove-PSSession                          6.2.4.0 Microsoft.PowerShell.Core
       Cmdlet      Remove-TypeData                           6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Remove-Variable                           6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Rename-Item                               6.1.0.0 Microsoft.PowerShell.Management
       Cmdlet      Rename-ItemProperty                       6.1.0.0 Microsoft.PowerShell.Management
       Cmdlet      Resolve-Path                              6.1.0.0 Microsoft.PowerShell.Management
       Cmdlet      Save-Help                                 6.2.4.0 Microsoft.PowerShell.Core
       Cmdlet      Save-Package                              1.3.2   PackageManagement
       Cmdlet      Select-Object                             6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Select-String                             6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Select-Xml                                6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Send-MailMessage                          6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Set-Alias                                 6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Set-Content                               6.1.0.0 Microsoft.PowerShell.Management
       Cmdlet      Set-Date                                  6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Set-ExecutionPolicy                       6.1.0.0 Microsoft.PowerShell.Security
       Cmdlet      Set-Item                                  6.1.0.0 Microsoft.PowerShell.Management
       Cmdlet      Set-ItemProperty                          6.1.0.0 Microsoft.PowerShell.Management
       Cmdlet      Set-Location                              6.1.0.0 Microsoft.PowerShell.Management
       Cmdlet      Set-MarkdownOption                        6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Set-PackageSource                         1.3.2   PackageManagement
       Cmdlet      Set-PSBreakpoint                          6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Set-PSDebug                               6.2.4.0 Microsoft.PowerShell.Core
       Cmdlet      Set-PSReadLineKeyHandler                  2.0.0   PSReadLine
       Cmdlet      Set-PSReadLineOption                      2.0.0   PSReadLine
       Cmdlet      Set-StrictMode                            6.2.4.0 Microsoft.PowerShell.Core
       Cmdlet      Set-TraceSource                           6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Set-Variable                              6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Show-Markdown                             6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Sort-Object                               6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Split-Path                                6.1.0.0 Microsoft.PowerShell.Management
       Cmdlet      Start-Job                                 6.2.4.0 Microsoft.PowerShell.Core
       Cmdlet      Start-Process                             6.1.0.0 Microsoft.PowerShell.Management
       Cmdlet      Start-Sleep                               6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Start-ThreadJob                           1.1.2   ThreadJob
       Cmdlet      Start-Transcript                          6.1.0.0 Microsoft.PowerShell.Host
       Cmdlet      Stop-Job                                  6.2.4.0 Microsoft.PowerShell.Core
       Cmdlet      Stop-Process                              6.1.0.0 Microsoft.PowerShell.Management
       Cmdlet      Stop-Transcript                           6.1.0.0 Microsoft.PowerShell.Host
       Cmdlet      Tee-Object                                6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Test-Connection                           6.1.0.0 Microsoft.PowerShell.Management
       Cmdlet      Test-Json                                 6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Test-ModuleManifest                       6.2.4.0 Microsoft.PowerShell.Core
       Cmdlet      Test-Path                                 6.1.0.0 Microsoft.PowerShell.Management
       Cmdlet      Trace-Command                             6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Uninstall-Package                         1.3.2   PackageManagement
       Cmdlet      Unregister-Event                          6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Unregister-PackageSource                  1.3.2   PackageManagement
       Cmdlet      Update-FormatData                         6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Update-Help                               6.2.4.0 Microsoft.PowerShell.Core
       Cmdlet      Update-TypeData                           6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Wait-Debugger                             6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Wait-Event                                6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Wait-Job                                  6.2.4.0 Microsoft.PowerShell.Core
       Cmdlet      Wait-Process                              6.1.0.0 Microsoft.PowerShell.Management
       Cmdlet      Where-Object                              6.2.4.0 Microsoft.PowerShell.Core
       Cmdlet      Write-Debug                               6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Write-Error                               6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Write-Host                                6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Write-Information                         6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Write-Output                              6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Write-Progress                            6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Write-Verbose                             6.1.0.0 Microsoft.PowerShell.Utility
       Cmdlet      Write-Warning                             6.1.0.0 Microsoft.PowerShell.Utility
       
       PS /Users/ujpadmin>
  • たくさんあるけれど,コマンドレットの命名規則は,動詞-名刺らしい.Copy-Itemのような感じ.

コマンドレットの詳細を表示

  • Get-Helpコマンドレットを利用すると,コマンドの詳細が表示される.
       PS /Users/ujpadmin> Get-Help Get-Process🆑
       
       NAME
           Get-Process
       
       SYNTAX
           Get-Process [[-Name] <string[]>] [-Module] [-FileVersionInfo] [<CommonParameters>]
       
           Get-Process [[-Name] <string[]>] -IncludeUserName [<CommonParameters>]
       
           Get-Process -Id <int[]> -IncludeUserName [<CommonParameters>]
       
           Get-Process -Id <int[]> [-Module] [-FileVersionInfo] [<CommonParameters>]
       
           Get-Process -InputObject <Process[]> [-Module] [-FileVersionInfo] [<CommonParameters>]
       
           Get-Process -InputObject <Process[]> -IncludeUserName [<CommonParameters>]
       
       
       ALIASES
           gps
       
       
       REMARKS
           Get-Help cannot find the Help files for this cmdlet on this computer. It is displaying only partia
           l help.
               -- To download and install Help files for the module that includes this cmdlet, use Update-Hel
           p.
               -- To view the Help topic for this cmdlet online, type: "Get-Help Get-Process -Online" or
                  go to https://go.microsoft.com/fwlink/?LinkID=113324.
       
       
       PS /Users/ujpadmin>

参考情報

  • マイクロソフトのサイトには,安定版だけでなくプレビュー版のインストールの案内もある.

macOS への PowerShell Core のインストール

https://docs.microsoft.com/ja-jp/powershell/scripting/install/installing-powershell-core-on-macos?view=powershell-7


広告スペース
Google