none
compress-archive bug? RRS feed

  • Question

  • Good day, running PS 5.0 on Windows 8.1 Enterprise.  Trying to create a simple zip file returns the following error.   I'm not sure if this caused by a recent Windows Update or not.   I'm pretty sure I'm doing this right,  as per the examples in the get-help for this.  

    PS C:\temp> compress-archive "c:\temp\test.sql" -DestinationPath "c:\temp\test.zip"

    Cannot find an overload for "CreateEntry" and the argument count: "2".
    At C:\windows\system32\windowspowershell\v1.0\Modules\Microsoft.PowerShell.Archive\Microsoft.PowerShell.Archive.psm1:800 char:25
    + ...             $currentArchiveEntry = $zipArchive.CreateEntry("$relative ...
    +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [], MethodException
        + FullyQualifiedErrorId : MethodCountCouldNotFindBest

    Thursday, July 14, 2016 6:35 PM

Answers

  • Here is the info on 4.6 - check to see that it is correctly installed.

    On Windows 8.1 / Windows Server 2012 R2 you can find this as Update for Microsoft Windows (KB3045563) under Installed Updates in Control Panel. This version of the .NET Framework runs side-by-side with the .NET Framework 3.5 SP1 and earlier versions, but performs an in-place update for the .NET Framework 4, .NET Framework 4.5, .NET Framework 4.5.1 and .NET Framework 4.5.2. For important information about this release, see the .NET  

    If you installed the old, revoked, WMF 5 then you will have to reinstall your OS to fix things.


    \_(ツ)_/

    • Marked as answer by Pinnacle Paul Friday, July 15, 2016 11:13 PM
    Friday, July 15, 2016 6:19 PM

All replies

  • Corrupt or missing Net Framework 4.5 (I think it's 4.5)

    Start with this: https://www.microsoft.com/en-us/download/details.aspx?id=30135&wa=wsignin1.0


    \_(ツ)_/

    Thursday, July 14, 2016 6:55 PM
  • Thank you for your fast response,   I did some grinding on this issue last night for a few hours.  I ran the dotnet repair,   uninstalled and re-installed WMI 5.0 and to no avail this problem still exists.

    The funny thing about this,  It actually works perfectly fine in the Powershell_ISE.  

    Friday, July 15, 2016 12:14 PM
  • Is Net Framework 4.5 installed?


    \_(ツ)_/

    Friday, July 15, 2016 1:45 PM
  • I installed 4.6 in thinking this would help resolve , do I need both? I don't see 4.5 listed in the Programs and Features. I opened up "Turn Windows features on or off" I see .NET framework 4.5 advanced services with a few things turned on wcf services -> TCP Port sharing.
    Friday, July 15, 2016 3:08 PM
  • You are saying that 4.5 is not enabled?


    \_(ツ)_/

    Friday, July 15, 2016 4:17 PM
  • Doesn't appear to be.     Doing a little googling I found the following site that gave me a little tip on how to determine which one is installed  (I'd paste the link but the site doesn't allow me to until they verify my account)

    My registry says Release REG_DWORD 393297 which correlates to NET 4.6. which makes sense as I installed it the other day.   Do I need to roll-back and install 4.5?  I thought it was embedded into the OS?  maybe I'm thinking of server 2012 R2 maybe

    Friday, July 15, 2016 6:12 PM
  • Here is the info on 4.6 - check to see that it is correctly installed.

    On Windows 8.1 / Windows Server 2012 R2 you can find this as Update for Microsoft Windows (KB3045563) under Installed Updates in Control Panel. This version of the .NET Framework runs side-by-side with the .NET Framework 3.5 SP1 and earlier versions, but performs an in-place update for the .NET Framework 4, .NET Framework 4.5, .NET Framework 4.5.1 and .NET Framework 4.5.2. For important information about this release, see the .NET  

    If you installed the old, revoked, WMF 5 then you will have to reinstall your OS to fix things.


    \_(ツ)_/

    • Marked as answer by Pinnacle Paul Friday, July 15, 2016 11:13 PM
    Friday, July 15, 2016 6:19 PM
  • This will more than likely take me a bit longer so I will mark this as answered,  you've been superb!

    PC

    Friday, July 15, 2016 11:14 PM
  • This will more than likely take me a bit longer so I will mark this as answered,  you've been superb!

    PC

    Yes - it is not really a scripting issue.  If you have loaded the revoked version of WMF 5 you will have to reinstall your OS.  That is the only fix available.  Hopefully you installed the latest RTM and not the original.


    \_(ツ)_/

    Friday, July 15, 2016 11:36 PM
  • I am not sure I installed the original, I don't think I did. It was much after Windows 10 was already released but during my troubleshooting I uninstalled it and re-installed the version that is up there now.

    Thanks again for your help.   

    Cheers

    PC

    Saturday, July 16, 2016 12:55 AM
  • I am not sure I installed the original, I don't think I did. It was much after Windows 10 was already released but during my troubleshooting I uninstalled it and re-installed the version that is up there now.

    Thanks again for your help.   

    Cheers

    PC

    Unfortunately that won't work.  RTM came out almost a year after W10.  It was very bad.  If you tried to upgrade it then you have a bad copy.  You will have to reinstall Win 10.

    Read the following carefully: https://blogs.msdn.microsoft.com/powershell/2015/12/23/windows-management-framework-wmf-5-0-currently-removed-from-download-center/


    \_(ツ)_/

    Saturday, July 16, 2016 1:11 AM