[英]Powershell copy some folders from a zip file
I have a zip folder it contains 10-12 folders (in folders i have some file) with different names and i need to get folders and copy into destination whose name contains 'abc' or 'xyz' like that using Power Shell Scripting. 我有一个zip文件夹,其中包含10-12个具有不同名称的文件夹(在文件夹中我有一些文件),我需要获取文件夹并复制到目标名称中,该名称包含“ abc”或“ xyz”,如使用Power Shell脚本编写的那样。
Thanks in advance, Chinna V 在此先感谢Chinna V
Try this, 尝试这个,
function Extract-Zip{
param([string]$zipfilename, [string] $destination)
if(test-path($zipfilename))
{
$shellApplication = new-object -com shell.application
$zipPackage = $shellApplication.NameSpace($zipfilename)
$destinationFolder = $shellApplication.NameSpace($destination)
$destinationFolder.CopyHere($zipPackage.Items())
}
} }
This should unzip your compressed file to the destination of your choice. 这应该将压缩文件解压缩到您选择的目标位置。 Alternatively, you can explore PS Community Extensions - http://pscx.codeplex.com 或者,您可以浏览PS社区扩展-http: //pscx.codeplex.com
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.