Skip to content
This repository has been archived by the owner on Jul 20, 2022. It is now read-only.

NugetSource doesn't allow UNC Paths #114

Open
GaryRogers opened this issue Dec 26, 2013 · 5 comments
Open

NugetSource doesn't allow UNC Paths #114

GaryRogers opened this issue Dec 26, 2013 · 5 comments

Comments

@GaryRogers
Copy link

Trying to install a NugetPackaged script from a UNC path as the nuget source ex: Install-Module -NugetPackageID MyPackage -NugetSource \mydfs.example.com\shared\nuget -Destination e:\local\my\path\to\powershell\modules

Results in:
Install-Module : Unable to download from NuGet feed: Illegal characters in path.
At line:1 char:1

@chaliy
Copy link
Member

chaliy commented Dec 26, 2013

As far I know UNC path should start from "". Can you please try:

\\mydfs.example.com\shared\nuget

@GaryRogers
Copy link
Author

Sorry, typo. I was using the \ path. I also tried putting it in " quotes.

@GaryRogers
Copy link
Author

Fun, git hub takes out the leading backslash.

@GaryRogers
Copy link
Author

Here's a more verbose error.

PS E:\> Install-Module -NuGetPackageId My-Utils -NugetSource \\mydfs.edu\shared\nuget\ -Destination E:\
local\powershell\modules -Verbose -Update
VERBOSE: Querying '\\mydfs.edu\shared\nuget\/' repository for package with Id 'My-Utils'
Install-Module : Unable to download from NuGet feed: Illegal characters in path.
At line:1 char:1
+ Install-Module -NuGetPackageId My-Utils -NugetSource \\mydfs.edu\shared\nu ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Install-Module

@GaryRogers
Copy link
Author

It looks like DownloadNuGetPackage Doesn't allow for UNC paths. It doesn't look like it accepts alternate credentials either... but that's a different issue.

function DownloadNuGetPackage {
    param (
        $NuGetPackageId,
        $PackageVersion,
        $Source,
        $PreRelease,
        $PreReleaseTag
    )

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

    if (-not $Source.EndsWith("/"))
    {
        $Source += "/"
    }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants