qshinoの日記

Powershell関係と徒然なこと

2017-03-16から1日間の記事一覧

Powershell 例外処理

PowerShell 例外処理 例外処理には二種類。 Trap [例外] {} Try{}Catch[例外]{}Finally{} Trap 書式: Trap [例外] {例外処理} Trap例外処理中の break,continue break: 処理を終了する。 continue: 処理を継続する。 Try Catch 書式: Try{}Catch[例外]{}Fina…

Powershell 圧縮とshellオブジェクト

Powershell 圧縮 Comでshell にzipファイルを渡してCopyHere($filename) 注意点は、非同期処理対応。 重複試験はhashかなぁ。 なお、圧縮パスワードは設定できない。 解凍パスワードは、引数指定不可、ダイアログが表示される。 下記では、全ファイルをCopyH…

Ether IP

Ether IP on linux 参考 http://trema.hatenablog.jp/entry/20120415/1334487392 Github etherip https://github.com/kjmkznr/etherip/tree/master http://www.ihanet.info/Home/samples/etherip

Create Shortcut

ショートカットファイル作成 Powershell でショートカットファイル作成。 com のwshで作成する。 $wsh = New-Object -comObject WScript.Shell $link = $wsh.CreateShortcut("D:\desktop\notepad.lnk") $link.TargetPath = "notepad.exe" $link.Description …

object廃棄

Object廃棄 on Powershell Remove-Variable x 参考 http://stackoverflow.com/questions/13782788/powershell-clear-item-variable-vs-remove-variable http://m.chiebukuro.yahoo.co.jp/detail/q1342962568 http://stackoverflow.com/questions/1999858/how…