Backslashes (\) Are Used as Path Separators in the Native Command Compress-Archive
Symptoms
The error message appears to use backslashes as path separators… is displayed.
Cause Analysis
When the native PowerShell command Compress-Archive or the action Build with MSBuild is used for packaging, the file path in the PowerShell command uses backslashes (\) as separators. This packaging mode has poor platform compatibility. As a result, the preceding problem occurs.
Solution
- Run the following script to build a package:
1 2 3 4 5
nuget restore msbuild /p:OutputPath=../buildResult/Release/bin powershell Invoke-WebRequest -UseBasicParsing https://www.7-zip.org/a/7z1900-x64.exe -OutFile ./7zip.exe 7zip.exe /S "C:/Program Files/7-Zip/7z.exe" a ./archive.zip ./buildResult/Release/bin/*
- Use the 7-Zip packaging tool to create a customized package.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot