out-ie.ps1 PowerShellからHTMLをIEに流し込む。
PowerShellには、ConvertTo-Htmlコマンドレットがあって、HTMLが生成できますが、それをIEに流し込んで表示するコマンドレットは標準にはありません。
代わりに、out-ie.ps1が紹介されてますが、環境によって動いたり、動かなかったりします。
そこで、汎用に動くようにします。
out-ie.ps1
$ie=new-object -com InternetExplorer.Application
$ie.toolbar=$false
$ie.visible=$true
$ie.navigate("about:blank")
while($ie.busy -or ($ie.readystate -ne 4)){sleep 1}
$html=$input|out-string
try{
$ie.document.write($html)
}catch{
$ie.document.IHTMLDocument2_write($html)
}
« view-csv.ps1 CSVファイルを表示する。 | トップページ | バッチファイルやスクリプトから簡単に出せる処理中メッセージ »