[英]powershell extract zip file to a shared folder
我正在嘗試將 PC 上存在的 zip 文件解壓縮到另一台具有共享文件夾的 PC。
我正在運行這個:
powershell Expand-Archive -Path C:\test.zip -DestinationPath \\TEST\TEST1 -Force
但是得到這個錯誤,有什么想法嗎?
New-Item : The path is not of a legal form.
At C:\windows\system32\windowspowershell\v1.0\Modules\Microsoft.PowerShell.Archive\Microsoft.PowerShell.Archive.psm1:315 char:32
+ ... eatedItem = New-Item -Path $DestinationPath -ItemType Directory -Conf ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (\\iltlvvmsimr64\ELAD:String) [New-Item], ArgumentException
+ FullyQualifiedErrorId : CreateDirectoryArgumentError,Microsoft.PowerShell.Commands.NewItemCommand
在做了一些研究之后,看起來這個錯誤是已知的,當檢測到預期目標有問題時,一些文件在 zip 中結構化一些示例(這與已經存在的文件不同,后者具有歸因於的特定錯誤這個):
Expand-Archive
是否支持LongPathsEnabled
注冊表屬性。 要嘗試解決此問題,請導航到regedit.exe
HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\FileSystem
並設置 DWORD LongPathsEnabled = 1
,或從 PowerShell 設置相同值。 您可以嘗試添加-Force
作為參數,如果這是由於嘗試寫入只讀位置引起的,那么某些人報告說可以解決該問題。 但是,這似乎是當路徑格式正確時與文件系統交互的問題的結果。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.