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
| $api_key = "Your API Key" | |
| function Get-latlng | |
| { | |
| param( | |
| [string]$address | |
| ) | |
| process | |
| { | |
| $encoded_address = [System.Uri]::EscapeDataString( $address ) |
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 excel-conv | |
| { | |
| param( | |
| [parameter(Mandatory=$true,ValueFromPipeline=$true)] | |
| [string]$infile, | |
| [string]$outfile | |
| ) | |
| begin{ | |
| $excel = New-Object -ComObject Excel.Application | |
| $excel.visible = $false |
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
| dir *.txt | %{ cmd /c "find /v /c `"`" $_ >> count.txt" } |
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
| ( dir *.csv ) | %{ Import-Csv $_ -Encoding Default } | Export-Csv out.csv -Encoding default |
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 convcolor-b2w | |
| { | |
| begin { Write-Host "黒→白に置き換え" | |
| [Void][System.Reflection.Assembly]::LoadWithPartialName( "System.Drawing" ) | |
| $activepath = Get-Location | |
| $colormap = New-Object System.Drawing.Imaging.Colormap | |
| $colormap.OldColor = "Black" | |
| $colormap.NewColor = "White" | |
| $ia = New-Object System.Drawing.Imaging.ImageAttributes |
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 Convert2-jpg | |
| { | |
| begin { Write-Host "入力画像をJPGに変換" | |
| [Void][System.Reflection.Assembly]::LoadWithPartialName( "System.Drawing" ) | |
| } | |
| process { | |
| trap { | |
| "対象ファイルをパイプラインで入力してください" | |
| "異常終了!" |
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 Rename-replace ( $bef , $aft ) | |
| { | |
| begin { Write-Host "ファイル名の置換リネーム" } | |
| process { | |
| trap { | |
| "対象ファイルをパイプラインで入力してください" | |
| "例:Get-Childitem *.txt | Rename-replace txt dat" | |
| break |