它创建了目录并下载了文件,但是当它去提取它时,它无法获得覆盖权限。它在我的 Windows 11 个人电脑上运行良好,但在我运行 Windows Server 2022 的专用服务器上无法运行。
mkdir ".\oxide\tmp\" 2> NUL
echo Downloading Oxide update...
powershell.exe -command "Invoke-WebRequest https://github.com/OxideMod/Oxide.Rust/releases/latest/download/Oxide.Rust.zip -outfile oxide\tmp\oxide.zip"
echo Extracting Oxide update..
powershell.exe Expand-Archive -Path "C:\servers\testserver\oxide\tmp\oxide.zip" -DestinationPath "C:\servers\testserver" -Force
TIMEOUT /T 5 /NOBREAK
rmdir /S /Q oxide\tmp 2> NUL
我试过其他方法,也没有用。 例如
powershell.exe -nologo -noprofile -command "& { Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory('C:\servers\testserver\oxide\tmp\oxide.zip', 'C:\servers\testserver\'); }"