我一直在使用powershell函数来解压缩大量文件:
function Expand-ZIPFile($file, $destination)
{
$shell = new-object -com shell.application
$zip = $shell.NameSpace($file)
foreach($item in $zip.items())
{
$shell.Namespace($destination).copyhere($item)
}
}
我称之为使用类似:
Expand-ZIPFile -File "$dir\$zip_file" -Destination $work_dir
我发现在创建临时文件的过程中
C:\ Documents and Settings \ ftpuser \ Local Settings \ Temp
对于我解压缩的每个文件,在过去的一个月中,它已经生成了将近800GB的临时文件。
问题:有没有办法
最佳答案
懒惰的解决方案:
$temp = "C:\Documents and Settings\ftpuser\Local Settings\Temp\"
rm "$temp$($item.Title)"
关于powershell - 在Powershell中解压缩不会清除临时文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26435594/