PSGet.psm1 doesnt work

Anthony Shaw's Avatar

Anthony Shaw

04 Nov, 2015 12:25 AM

I'm trying to use appveyor to publish a powershell module to powershellgallery (the new WMF5 package library)..

I've used the 'unstable' build so I get what i deserve here, but Publish-Module simply doesn't work..

It keeps complaining that it can't find nuget-anycpu.exe

So I even FORCED a copy-item of nuget-anycpu.exe to the folder it's looking in and it still doesn't work.

Exception calling "ShouldContinue" with "2" argument(s): "The method or operation is not implemented."
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\PSGet.psm1:2352 char:12
+ if($PSCmdlet.ShouldContinue($ShouldContinueQueryMessage, $Loc ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : NotImplementedException
 
Install-NuGetClientBinaries : NuGet-anycpu.exe is required to interact with NuGet based galleries. Please ensure that NuGet-anycpu.exe is available under 'C:\Program Files\PackageManagement\ProviderAssemblies' or
'C:\Users\appveyor\AppData\Local\PackageManagement\ProviderAssemblies'.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\PSGet.psm1:364 char:9
+ Install-NuGetClientBinaries
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [Install-NuGetClientBinaries], InvalidOperationException
    + FullyQualifiedErrorId : CouldNotInstallNuGetBinaries,Install-NuGetClientBinaries
 
Install-NuGetClientBinaries : Exception calling "ShouldContinue" with "2" argument(s): "The method or operation is not implemented."
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\PSGet.psm1:589 char:9
+ Install-NuGetClientBinaries
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [Install-NuGetClientBinaries], MethodInvocationException
    + FullyQualifiedErrorId : NotImplementedException,Install-NuGetClientBinaries
 
 
 
Discovering tests...OK
.\nuget\pack.ps1

Has anyone actually got this working and can share an appveyor.yml?

  1. Support Staff 1 Posted by Feodor Fitsner on 04 Nov, 2015 12:37 AM

    Feodor Fitsner's Avatar

    What is ShouldContinue? Looks like "The method or operation is not implemented." is coming from AppVeyor's custom PowerShell host - most probably some cmdlet is asking for additional input (like missing mandatory parameter?) which is not supported.

  2. 2 Posted by Anthony Shaw (I... on 04 Nov, 2015 01:16 AM

    Anthony Shaw (ITaaS)'s Avatar

    I’m not doing anything special, just calling this script which calls Publish-Module

    https://github.com/tonybaloney/St2Client/blob/master/DocumentPowerShell.ps1#L31
    I `think` PSGet prompts the user whether they want to download and install nuget-anycpu.exe but because there is no user prompt it fails,
    But this isn’t a terminating error.
    NuGet-anycpu.exe is required to interact with NuGet based galleries. Please ensure that NuGet-anycpu.exe is available under 'C:\Program Files\PackageManagement\ProviderAssemblies' or
    'C:\Users\appveyor\AppData\Local\PackageManagement\ProviderAssemblies'
    That is the error I want to resolve first.

  3. Support Staff 3 Posted by Feodor Fitsner on 04 Nov, 2015 01:18 AM

    Feodor Fitsner's Avatar

    Have you tried troubleshooting via RDP: http://www.appveyor.com/docs/how-to/rdp-to-build-worker ?

  4. 4 Posted by migreene on 09 Nov, 2015 11:02 AM

    migreene's Avatar

    I have indepently run in to exactly this same issue at the same time. Same environment, same goal, same error.

    The unstable build environment is using an old version of WMF5 which doesn't help our case but I don't think that is the issue.

    It could be related to NuGet already being present to support Chocolatey. They might be different versions?

  5. Support Staff 5 Posted by Feodor Fitsner on 09 Nov, 2015 02:57 PM

    Feodor Fitsner's Avatar

    What's the latest version of WMF5? Could you drop a link please?

    - Feodor

  6. 6 Posted by migreene on 09 Nov, 2015 03:50 PM

    migreene's Avatar

    Production Preview. Latest builds are always at http://aka.ms/wmf5latest.

    I was just thinking I am on a Win10 client with Insider updates enabled but set to Slow. There's a chance my PS build version could be later than PP.

  7. Support Staff 7 Posted by Feodor Fitsner on 10 Nov, 2015 05:17 AM

    Feodor Fitsner's Avatar

    OK, we'll create a new image with the latest release of WMF 5.0. Will let you know when it's ready.

  8. 8 Posted by Michael on 10 Nov, 2015 05:24 PM

    Michael's Avatar

    I've been debugging and it does look like WMF version could be related. There are a different set of commands in the PackageManagement module than I see on my machine. Just let me know when the image goes live and I can validate right away.

  9. 9 Posted by Michael on 10 Nov, 2015 07:01 PM

    Michael's Avatar

    Actually, I added a script to make sure the latest version is loaded, and it did not resolve the issue. I will continue debugging, just wanted to pass on the insight.

  10. Support Staff 10 Posted by Feodor Fitsner on 12 Nov, 2015 05:18 AM

    Feodor Fitsner's Avatar

    Hi guys,

    We've just added a new WMF 5 image which is basically Visual Studio 2015 image + the latest WMF 5 from here: http://aka.ms/wmf5latest

    $PSVersionTable.PSVersion
     
    Major  Minor  Build  Revision
    -----  -----  -----  --------
    5      0      10514  6
    

    Let me know how it worked for you.

  11. 11 Posted by migreene on 19 Nov, 2015 07:36 PM

    migreene's Avatar

    I have found the resolution. You need to pre-load NuGet in to the machine. A repo demonstrating this is located here (this repo is hooked to the Gallery, live).

    https://github.com/mgreenegit/wsmantrust

    The "magic" is:

    https://github.com/mgreenegit/WSManTrust/blob/master/appveyor.yml#L8

  12. Support Staff 12 Posted by Feodor Fitsner on 19 Nov, 2015 08:06 PM

    Feodor Fitsner's Avatar

    Nice, thanks for sharing that!

  13. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:02 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac