当像在Java中一样使用通常的powershell_script 'test' do
code <<-EOH [System.Reflection.Assembly]::LoadWithPartialName("System.IO.Compression.FileSystem") | Out-Null
[System.IO.Compression.ZipFile]::ExtractToDirectory('c:\tmp\hp401n.zip', 'c:\tmp')
EOH
end
时,没有任何反应。但是,如果改为使用Runtime.getRuntime().exec("clear")
,则确实会创建一个文本文件。这是否有原因,如果有,有没有其他选择?
两者都在同一环境中使用Java。
编辑:错过括号
答案 0 :(得分:0)
您需要使用转义序列调用print("\u001b[H\u001b[2J")
,至少在Linux上。