在压缩这样的存档时,我可以以某种方式排除文件夹吗?
$compress = Compress-Archive $DestinationPath $DestinationPath\ARCHIVE\archiv-$DateTime.zip -CompressionLevel Fastest
Run Code Online (Sandbox Code Playgroud)
现在它始终将整个文件夹结构保存$destinationpath到存档中,但由于存档位于同一文件夹中,因此它总是被压缩到新存档中,每次运行命令时存档都会变大.
我正在尝试加载.dllitext7 的 a,但如果我使用这个
Add-Type -Path "D:\Eigene\Packages\itext7.7.1.5\lib\net40\itext.kernel.dll"
Run Code Online (Sandbox Code Playgroud)
我收到以下异常(翻译自德语):
Add-Type : Add-Type : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
In Zeile:2 Zeichen:1
+ Add-Type -Path "D:\Eigene\Packages\itext7.7.1.5\lib\net40\itext.kerne ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Add-Type], ReflectionTypeLoadException
+ FullyQualifiedErrorId : System.Reflection.ReflectionTypeLoadException,Microsoft.PowerShell.Commands.AddTypeCommand
Run Code Online (Sandbox Code Playgroud)
当我使用时:
try { Add-Type -Path "D:\Eigene\Packages\itext7.7.1.5\lib\net40\itext.kernel.dll" }
catch { $_.Exception.LoaderExceptions }
Run Code Online (Sandbox Code Playgroud)
它说(也是从德语翻译的):
未找到文件或程序集“BouncyCastle.Crypto,Version=1.8.1.0,Culture=neutral,PublicKeyToken=0e99375e54769942”或其依赖项。系统找不到指定的文件。
我怎样才能解决这个问题?
编辑:我在我的系统上发现了一个 BouncyCastle dll,当我安装 itext7 软件包时它也会下载,但如果我"D:\Eigene\Packages\Portable.BouncyCastle.1.8.5\lib\net40\BouncyCastle.Crypto.dll"在加载itext.kernel.dll.