2017-03-25から1日間の記事一覧
SynchronizingObject on powetshell Start-ProcessのExitedイベントの終了処理で、wpfのLabel.Contentを変更したい。 それだけ。 $proc = Start-Process "poi.bat" -passThru $ev = Register-ObjectEvent $proc -EventName Exited -Action { AddText("hoge")…
teraterm log auto close logautoclosemode 1 logopen 'D:\teraterm_sample.log' 0 0 ; do something... end ``` # 参考 https://ttssh2.osdn.jp/manual/ja/macro/command/logautoclosemode.html
作業ディレクトリの変更を戻す by git 作業したが変更を戻したい。 git checkout . これでカレント作業ディレクトリの変更を戻してくれるが、新規に作成したファイルは削除してくれず、手作業で削除する。なお、飽くまで作業ディレクトリの内容なので親ディ…
RunSpace 参考 https://msdn.microsoft.com/ja-jp/library/system.management.automation.runspaces.runspace(v=vs.85).aspx https://blogs.technet.microsoft.com/heyscriptingguy/2015/11/26/beginning-use-of-powershell-runspaces-part-1/ https://www.g…
Clipboad on wpf by powershell PowerShellでWPFのクリップボードを使う。 [Windows.Clipboard] のGetText(), SetText()を使う。 $get = [Windows.Clipboard]::GetText() [Windows.Clipboard]::SetText("oha") [Windows.Clipboard]::Clear() 但し、下記が必…
Poweshellコンソール by wpf まさに欲しかったもの。PowerShellコンソールをWPFに組み込む。 肝はPowershll.Create()でPowershell を生成する事。 using (var powershell = PowerShell.Create()) { powershell.AddCommand("Get-ChildItem"); powershell.AddC…
Start-ProcessのExitedEvent Thread Strart-ProcessのExited EventはデフォルトではSystem thread pool から実行される。UI系とは異なるため、UI系を制御すると問題が発生しやすい。 そのため、Formなどで使用するためにSynchronizingObject にUIオブジェク…
リモートデスクトップをHttpsで/ssl飛ばす。 myrtilleで可能な模様。WebSocketを使用している模様。 参考 https://github.com/cedrozor/myrtille/blob/master/README.md