Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Powershell[System.IO.Compression.ZipFile]可以';“不要忽视”;系统卷信息';文件夹_Powershell - Fatal编程技术网

Powershell[System.IO.Compression.ZipFile]可以';“不要忽视”;系统卷信息';文件夹

Powershell[System.IO.Compression.ZipFile]可以';“不要忽视”;系统卷信息';文件夹,powershell,Powershell,我正在进行一项自动化工作,将整个驱动器压缩到一个压缩文件中 我想出了以下代码: $toZipDirectory = 'F:\' $zipFilePath = 'E:\Backup.zip' [System.IO.Compression.ZipFile]::CreateFromDirectory($toZipDirectory, $zipFilePath) 当我针对F:驱动器下的一个特定文件夹进行测试时,该代码运行良好,但当我将源添加为F:的根目录时,出现以下错误: Exception c

我正在进行一项自动化工作,将整个驱动器压缩到一个压缩文件中

我想出了以下代码:

$toZipDirectory = 'F:\'

$zipFilePath = 'E:\Backup.zip'

[System.IO.Compression.ZipFile]::CreateFromDirectory($toZipDirectory, $zipFilePath) 
当我针对F:驱动器下的一个特定文件夹进行测试时,该代码运行良好,但当我将源添加为F:的根目录时,出现以下错误:

Exception calling "CreateFromDirectory" with "2" argument(s): "Access to the path 'F:\System Volume Information' is denied."

有办法解决这个问题吗?我不需要这个文件夹,因为它是“Windows的东西”。

正如函数名所示,
CreateFromDirectory
可以将目录作为源,而不是驱动器。还有,为什么要先压缩整个驱动器?有很多免费的磁盘成像软件。嗯。。。把一些脑细胞放在一起你所悲伤的完全有道理
CreateFromDirectory
不要使用驱动器。由于这是在公司环境中发生的,我需要使用现有的工具,不幸的是,磁盘映像软件不是其中之一……为什么不使用Windows server备份工具?正如函数名所示,
CreateFromDirectory
可以将目录作为源,而不是驱动器。还有,为什么要先压缩整个驱动器?有很多免费的磁盘成像软件。嗯。。。把一些脑细胞放在一起你所悲伤的完全有道理
CreateFromDirectory
不要使用驱动器。由于这是在公司环境中发生的,我需要使用现有的工具,不幸的是,磁盘映像软件不是其中之一……为什么不使用Windows server备份工具呢?