Open GaryRogers opened 10 years ago
As far I know UNC path should start from "\". Can you please try:
\\mydfs.example.com\shared\nuget
Sorry, typo. I was using the \ path. I also tried putting it in " quotes.
Fun, git hub takes out the leading backslash.
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
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 += "/"
}
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