noise

計算機科学や各種設定のメモ

2015-06-20から1日間の記事一覧

PowerShellでオブジェクトを文字列化(Serialize)

スクリプト % { $str = " world!"; echo "hello"+$str } | ConvertTo-Xml -as String -Depth 1 実行結果 <Objects> <Object Type="System.Management.Automation.ScriptBlock"> $str = " world!"; echo "hello"+$str </Object> </Objects>スクリプトブロックも変換できている。ScriptBlockはクロージャではないので呼び出し時のバインディングを用…