我有一个.zip文件,需要使用Powershell解压缩整个内容.我这样做但它似乎不起作用:
$shell = New-Object -ComObject shell.application
$zip = $shell.NameSpace("C:\a.zip")
MkDir("C:\a")
foreach ($item in $zip.items()) {
$shell.Namespace("C:\a").CopyHere($item)
}
Run Code Online (Sandbox Code Playgroud)
怎么了?该目录C:\a仍为空.
这就是我想要做的:
#!/bin/bash
set -e # I can't remove this line!
if [ docker inspect foo ]; then
echo container is present
else
echo container is absent
fi
Run Code Online (Sandbox Code Playgroud)
可能吗?当容器不存在以及何时存在时,docker inspect foo返回退出代码.10
现在我明白了:
-bash: [: too many arguments
Run Code Online (Sandbox Code Playgroud)