Last active
April 11, 2018 03:28
-
-
Save stknohg/9f82ddbc2e3e4c43a1b12f99d5b53f50 to your computer and use it in GitHub Desktop.
YumとAptでインストール可能なPowerShell Coreのバージョン一覧
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yum list available --showduplicates -q powershell ` | |
| Select-Object -Skip 1 ` | |
| ForEach-Object { | |
$packageName = (-split $_)[1] | |
if ($packageName -match "^(?<Major>\d+)\.(?<Minor>\d+)\.(?<Patch>\d+)(-.+$|\~(?<Label>.+)-.+$)") { | |
$version = [SemVer]::new($Matches.Major, $Matches.Minor, $Matches.Patch, $Matches.Label) | |
} | |
[PSCustomObject]@{ Version = $version; PackageName = "powershell-{0}" -f $packageName} | |
} ` | |
| Format-Table -AutoSize | |
# apt | |
apt-cache madison powershell ` | |
| ForEach-Object { | |
$packageName = ($_ -split '\|')[1].Trim() | |
if ($packageName -match "^(?<Major>\d+)\.(?<Minor>\d+)\.(?<Patch>\d+)(-.+$|\~(?<Label>.+)-.+$)") { | |
$version = [SemVer]::new($Matches.Major, $Matches.Minor, $Matches.Patch, $Matches.Label) | |
} | |
[PSCustomObject]@{ Version = $version; PackageName = "powershell-{0}" -f $packageName} | |
} ` | |
| Format-Table -AutoSize |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment