Automation

 View Only
  • 1.  Unable to unzip PowerCLI on linux due to backslashes

    Posted Jan 20, 2023 11:41 AM
    I am downloading and wanting to extract PowerCLI to use on Linux.
     
    It seems like the PowerCLI .zip file contains backslashes rather then forward slashes which causes unzip to error.
     
    # unzip VMware-PowerCLI-13.0.0-20829139.zip 
    warning: VMware-PowerCLI-13.0.0-20829139.zip appears to use backslashes as path separators
     
    the unzip then fails
     
    Apparently this is a previous bug in Microsoft.PowerShell.Archive https://github.com/PowerShell/Microsoft.PowerShell.Archive/pull/62 which should bre resolved
     
    Anyone have any workarounds using linux unzip or even better, can someone on the PowerCLI team amend the archive creation process to resolve trhis.


  • 2.  RE: Unable to unzip PowerCLI on linux due to backslashes

    Posted Jan 20, 2023 12:04 PM

    You could try to use 7zip to fix the issue

    7z rn VMware-PowerCLI-13.0.0-20829139.zip $(7z l VMware-PowerCLI-13.0.0-20829139.zip | grep '\\' | awk '{ print $6, gensub(/\\/, "/", "g", $6); }' | paste -s)