Closed jhochwald closed 7 years ago
@jhochwald are you using WMF 5.0 RTM? Auth won't work on WMF 5.0 RTM. Please try WMF 5.1.
@jianyunt at the moment the system it want to use that is PowerShell 4 box (Windows 7). Because this is what all the clients run right now. But I will test it with a VM and install WMF 5.1.
@jianyunt Did the test: Works with WMF 5.1! But not with the system above (PowerShell 4 with PackageManagement installed from the Download center).
Here is what I have now:
PS C:> $PSVersionTable
Name Value
---- -----
PSVersion 5.1.14394.1000
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14394.1000
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
And here what I did to test it:
PS C:\> $UpdateCredentials = (Get-Credential)
cmdlet Get-Credential at command pipeline position 1
Supply values for the following parameters:
Credential
PS C:\> Find-Package -Source 'enatec.TEST' -Credential $UpdateCredentials
Name Version Source Summary
---- ------- ------ -------
NETX.scadist 1.2.3.158 enatec.TEST NET-Experts PowerShell Toolbox Distribution
PS C:\> Save-Package -Name 'NETX.scadist' -Source 'enatec.TEST' -Credential $UpdateCredentials -Path C:\temp
Name Version Source Summary
---- ------- ------ -------
NETX.scadist 1.2.3.158 enatec.TEST NET-Experts PowerShell Toolbox Distribution
I registered the source like in the Issue description (The only difference is the safed Credential instead of typing it in on every command).
So is this something that will work/not come to the PackageManagement Module running on PowerShell 4?
CC: @bmanikm @quoctruong
@jhochwald Regarding register-packagesource with cred, it was our design choice to not save user's credential any where on the machine. This is mostly for software security consideration.
The PackageManagement from the download center does not contain these cred, proxy, etc features recently added. I will discuss with the team. Sorry for the inconvenience.
@jianyunt no problem. Credentials (-credential) works well with NuGet as source. Even if the source was not registered before.
But if the feature is not available, there should be at least a hint about that somewhere.
CC: @bmanikm @quoctruong
This does not seem to work on Server 2016, PSH 5.1.14393.2097, PowerShellGet version 1.6.0.
Seems like this should be rudimentary functionality for secure DevOps.
Is there a new issue tracking this?
I can register the source as "NuGet", but never as "PowerShellGet" source! The Access shows, that PackageManagement commands never try to authenticate.
I tried that on PowerShell 4 (Windows 7 and 8).
My goal is, a PowerShellGet based feed that needs to authenticate! NuGet is great, but not to distribute PowerShell Modules :-(
When register via
nuget.exe source add
NGINX Proxy Logs for that request:
Here is what I get when I register the same Repository as PowerShellGet Source:
NGINX Proxy Logs for that request:
NGINX Proxy Logs for that request:
When I try to access the Feed from plain NuGet it works, even from Octopus Deploy it works like a charm. Only the PackageManagement seems to have this issue.
P.S.: The NGINX is just a reverse Proxy and all other tests use this to.