PS C:\> $PSVersionTable | sort Name
Name Value
---- -----
PSVersion 5.1.19041.1
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
This file contains hidden or 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
$params = @{ | |
Uri = 'https://github.com/koron/vim-kaoriya/releases/download/v8.1.1048-20190325/vim81-kaoriya-win64-8.1.1048-20190325.zip'; | |
OutFile = Join-Path $env:TEMP 'vim.zip' | |
} | |
Invoke-WebRequest @params | |
Expand-Archive -LiteralPath (Join-Path $env:TEMP 'vim.zip') -DestinationPath $env:ProgramFiles |
This file contains hidden or 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
$null | % {$i=0} {"$i : $_";$i++} | |
[System.Management.Automation.Internal.AutomationNull]::Value | % {$i=0} {"$i : $_";$i++} | |
@("a", $null, "c") | % {$i=0} {"$i : $_";$i++} | |
@("a", [System.Management.Automation.Internal.AutomationNull]::Value, "c") | % {$i=0} {"$i : $_";$i++} |
This file contains hidden or 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
# | |
# 最新バージョンの.NET Core SDKをインストーラーからインストールするスクリプト | |
# ※1 インストーラーのインストールは要管理者権限です | |
# ※2 Zipファイルからの展開は公式の dotnet-install.ps1 を使いましょう | |
# https://docs.microsoft.com/ja-jp/dotnet/core/tools/dotnet-install-script | |
# | |
# 現在最新の.NET Core SDKのバージョンを取得 | |
$commitHash, $version = -split (Invoke-RestMethod -Uri https://dotnetcli.azureedge.net/dotnet/Sdk/Current/latest.version) | |
# MSIインストーラーをダウンロードしてサイレントインストール |
This file contains hidden or 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
function Get-NETCoreRuntimeVersion () { | |
# pwsh.deps.jsonを検索 | |
$depsJsonPath = Join-Path $PSHOME 'pwsh.deps.json' | |
if (Test-Path $depsJsonPath) { | |
$depsContent = Get-Content -LiteralPath $depsJsonPath | ConvertFrom-Json -AsHashtable | |
$targetName = $depsContent.runtimeTarget.name | |
$pwshTargetName = $depsContent.targets.$targetName.Keys | ? { $_ -like "pwsh*" } | |
return $depsContent.targets.$targetName.$pwshTargetName.dependencies."Microsoft.NETCore.App" | |
} | |
This file contains hidden or 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
Import-Module AWSPowerShell.NetCore | |
Get-ChildItem C:\temp\awscli\*.txt | ForEach-Object { | |
Write-Host "$($_.BaseName)..." -ForegroundColor Green | |
# | |
$serviceName = $_.BaseName | |
$commands = $_ | Get-Content | ForEach-Object { | |
try { | |
# 1つの AwsCliCommand から複数の Cmdlet を返す場合がある | |
$awsCLI = $_ |
This file contains hidden or 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
#!/bin/bash | |
for c in $(aws list-commands 2>&1 | tail -n +9 | awk -F'|' '{printf "%s\n%s\n",$1,$2}' | tr -d ' ') | |
do | |
# wait, help,空白 は除外 | |
eval "aws $c list-commands" 2>&1 | tail -n +9 | awk -F'|' '{printf "%s\n%s\n",$1,$2}' | tr -d ' ' | sed -e /wait/d -e /help/d -e /^$/d | awk -v "v1=$c" '{printf "aws %s %s\n",v1,$0}' | |
done |
This file contains hidden or 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
# | |
# 最新バージョンの EC2Launch をインストールするスクリプト | |
# Ref : https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ec2launch-download.html | |
# | |
# ※ EC2Launch 設定ファイルのバックアップには対応していません。 | |
# | |
<# | |
.SYNOPSIS | |
EC2Launchの最新バージョンを取得します |