AWS Toolkit for PowerShellの利用に関するメモ書きです。
- 初期セットアップ
以下、AWS Tools for Windows PowerShellのセットアップ手順について記載します。
下記のURLからAWS Tools for Windowsをダウンロードしてインストールしてください。
http://aws.amazon.com/jp/powershell/
| #Usage: Show-BallonTip "Title" "Message" | |
| function Show-BalloonTip | |
| { | |
| [CmdletBinding()] | |
| param ( | |
| [Parameter(Mandatory, Position = 0)] | |
| [string] $Title, | |
| [Parameter(Mandatory, Position = 1)] |
| Use-NuGetPackage Octokit -Verbose | |
| #Get Issues from GitHub repositories | |
| $client = New-Object Octokit.GitHubClient("PowerShellClient") | |
| $task = $client.Issue.GetForRepository("altrive", "PSCodeAnalyzer") | |
| #Show results | |
| $task.Result | Out-GridView |
| function Main | |
| { | |
| $ipAddresses = 1..254 | foreach { "192.168.0.$_" } | |
| #$ipAddresses | Invoke-ParallelPing | Out-GridView | |
| Invoke-ParallelPing -ComputerName $ipAddresses | Out-GridView | |
| } | |
| function Invoke-ParallelPing | |
| { |
| $ErrorActionPreference = "Stop" | |
| Set-StrictMode -Version Latest | |
| $Script:PackageManager = $null | |
| function Initialize-NuGetPackageManager | |
| { | |
| [CmdletBinding()] | |
| param ( | |
| [hashtable] $Repositories = @{}, |
| Use-NuGetPackage -PackageId ClosedXML -Verbose | |
| #Set .Net current path | |
| [IO.Directory]::SetCurrentDirectory((Get-Location).Path) | |
| #Output Excel file to current directory | |
| $workbook = New-Object ClosedXML.Excel.XLWorkbook | |
| $worksheet = $workbook.Worksheets.Add("Sample Sheet"); | |
| $worksheet.Cell("A1").Value = "Hello World!"; | |
| $workbook.SaveAs("HelloWorld.xlsx"); |
| $ErrorActionPreference = "Stop" | |
| #Need to install Nuget packages before execute | |
| Add-Type -Path (Join-Path (Split-Path $profile -Parent) "packages\Windows7APICodePack-Core.1.1.0.0\lib\Microsoft.WindowsAPICodePack.dll" -Resolve) | |
| Add-Type -Path (Join-Path (Split-Path $profile -Parent) "\packages\Windows7APICodePack-Shell.1.1.0.0\lib\Microsoft.WindowsAPICodePack.Shell.dll" -Resolve) | |
| <# | |
| #TODO: Define Interop code to register shortcut with appid | |
| $referencedAssemblies = @( | |
| [MS.WindowsAPICodePack.Internal.PropVariant].Assembly.FullName, |
| #Requires -Version 3 | |
| #Requires -RunAsAdministrator | |
| function Get-VMConsole | |
| { | |
| [CmdletBinding()] | |
| param ( | |
| [Parameter(Mandatory)] | |
| [string] $VMName | |
| ) |
AWS Toolkit for PowerShellの利用に関するメモ書きです。
以下、AWS Tools for Windows PowerShellのセットアップ手順について記載します。
下記のURLからAWS Tools for Windowsをダウンロードしてインストールしてください。
http://aws.amazon.com/jp/powershell/
これは PowerShell Advent Calendar 2013 21日目の記事です。
本記事では、最近のWindows OSに標準搭載されているIDE、PowerShell ISEの基本操作について紹介します。
Windows 8 に搭載のPowerShell ISEではインテリセンスが使えるようになり、だいぶ実用的になりました。
OSに標準で搭載されていることもあり、ISEを使ってスクリプトを書いてる人も多いかと思います。
本記事ではPowerShell ISEを利用する上で、知っておくと便利な機能について紹介します。
| function Add-TypeDefinition | |
| { | |
| [CmdletBinding()] | |
| param ( | |
| [string] $Path, | |
| [string[]] $ReferencedAssemblies = @("Microsoft.CSharp"), | |
| [string] $OutputAssembly, | |
| [switch] $IgnoreWarnings, | |
| [switch] $UseTypeAlias | |
| ) |