2014-04-01から1ヶ月間の記事一覧

プロファイルでエイリアスの記述された行を表示

PowerShellガンガン学習中。 $lines = gc $profile | ? { $_ -match "^sal|^Set-Alias" } echo $linesこれがSelect-Stringなら・・・ sls "^sal|^Set-Alias" $profileこう書ける。メリットは ・既製のもので短く書ける ・行数表示してくれる ・Contextパラメ…

エイリアスに引数つきのコマンドを登録する

http://technet.microsoft.com/ja-jp/scriptcenter/powershell_owner07.aspx を見ていて躓いたのでメモ。引数つきのコマンドはエイリアスに登録できない。 たとえば、sal ipca ipconfig /allとすると、「Set-Alias : 引数 '/all' を受け入れる位置指定パラメ…

test

そろそろPowerShellを始めたい