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 is not universal and 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.
Decompressing a File FAQs
- File to Be Decompressed Does Not Exist
- Backslashes (\) Are Used as Path Separators in the Native Command Compress-Archive
- Application Deployment Interruption
- Insufficient Permissions
- Parameters Contain Backslashes (\)
- No Host Exists in the Environment
- Environment Does Not Exist
- Failed to Deploy an Application on a Windows Host
- Error Occurs During Application Deployment with the sudo Privileges
- Deployment Blocked by Third-Party Antivirus Software
- Invalid Path
- A Network Error Occurs During Software Installation on CentOS
- A Network Error Occurs During Software Installation on Ubuntu OS
- Windows Path Not Allowed on a Linux Host
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.
Chatbotmore