I have a small problem trying to unzip a file using the 7za
command-line utility in Powershell.
I set the $zip_source
variable to the zip file s path and the
$unzip_destination
to the desired output folder.
但是,<条码>7za<>>>条码>的指挥系统使用需要具体表述如下:
7za x -y <zip_file> -o<output_directory>
因此,我目前的呼吁是:
& 7za x -y "$zip_source" -o$unzip_destination
Due to the fact that there can be no space between -o
and the destination it
seems that PowerShell will not expand the $unzip_destination
variable, whereas $zip_source
is expanded.
Currently the program simply extracts all the files into the root of C:
in
a folder named $unzip_destination
.
Setting different types of quotes around the variable won t work neither:
-o"$unzip_destination" : still extracts to C:$unzip_destination
-o $unzip_destination : still extracts to C:$unzip_destination
-o $unzip_destination : Error: Incorrect command line
是否有办法在指挥之前强行扩大?