Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

Authentication and Publish Powershell Modules to Powershell Feed



  • Hello,

    I'd like to know how to proceed in order to publish a simple powershell module to my Proget server that has a Powershell feed named "BpPoshGallery" configured. I'm using version 4.11 of Proget.

    The server is setup to use the integrated user directory, so I have an user "foo" that has permissions to publish packages. Feed scoping is not being used.

    When I run the following command inside my local module folder (containing the psm1 and psd1 files):

    Publish-Module -Repository BpPoshGallery -Path . -NuGetApiKey "foo:bar"

    And I get the following error:

    Publish-PSArtifactUtility : Failed to publish module 'BraspagDev': 'Cannot prompt for input in non-interactive mode.
    '.
    At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:853 char:17

    •             Publish-PSArtifactUtility -PSModuleInfo $moduleInfo `
      
    •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      • CategoryInfo : InvalidOperation: (:) [Write-Error], WriteErrorException
      • FullyQualifiedErrorId : FailedToPublishTheModule,Publish-PSArtifactUtility

    Product: ProGet
    Version: 4.1.3



  • Publish-Module uses nuget.exe behind the scenes, so basically you need to configure nuget to allow for this. There are several ways to do this.

    If you search for the error cannot prompt for input in non-interactive mode you should see a lot of suggestions, depending on the version used, but here is a good starting resource:

    http://robinosborne.co.uk/2014/09/15/nuget-cannot-prompt-for-input-in-non-interactive-mode/



  • Alana,

    Actually I have found that the issue is related to more than one cause. First, OneGet (PackageManagement - Powershell on windows) is not very mature yet.

    It doesn't support corporate proxy authentication, one must configure the powershell session and/or profile to use the default proxy credentials:

    $browser = New-Object System.Net.WebClient
    $browser.Proxy.Credentials =[System.Net.CredentialCache]::DefaultNetworkCredentials
    

    And then, OneGet doesn't go well with private/authenticated feeds. It is hard to add package sources and/or manipulate packages that belong to a private feed. I have just dropped it for now and I'll distribute modules manually instead, and wait for OneGet to be more mature and support private feeds.

    Thanks,



  • i updated to PowerShellGet 1.1.1.0 and it solved my issues.

    Release Notes

    • PowerShellCore support
    • Security enhancements including the enforcement of catalog-signed modules during installation
      - Authenticated Repository support
    • Proxy Authentication support
    • Responses to a number of user requests and issues


Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation