Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distribute next release onto PSGallery #61

Open
jayvdb opened this issue Jun 22, 2019 · 0 comments
Open

Distribute next release onto PSGallery #61

jayvdb opened this issue Jun 22, 2019 · 0 comments

Comments

@jayvdb
Copy link
Contributor

jayvdb commented Jun 22, 2019

It would be nice if this worked

PS> Install-Module Fudge

Otherwise it is a bit difficult on Linux. e.g.

> Get-PSRepository

Name                      InstallationPolicy   SourceLocation
----                      ------------------   --------------
PSGallery                 Untrusted            https://www.powershellgallery.com/api/v2

PS> nuget
nuget : The term 'nuget' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ nuget
+ ~~~~~
+ CategoryInfo          : ObjectNotFound: (nuget:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

PS> Install-PackageProvider Nuget
Install-PackageProvider : No match was found for the specified search criteria for the provider 'Nuget'. The package provider requires 'PackageManagement' and 'Provider' tags. Please check if the specified package has the tags.
At line:1 char:1
+ Install-PackageProvider Nuget
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidArgument: (Microsoft.PowerShel\u2026tallPackageProvider:InstallPackageProvider) [Install-PackageProvider], Exception
+ FullyQualifiedErrorId : NoMatchFoundForProvider,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackageProvider

^D
$  sudo zypper install mono-nuget
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following 2 NEW packages are going to be installed:
  mono-devel mono-nuget

2 new packages to install.
Overall download size: 12.5 MiB. Already cached: 0 B. After the operation, additional 77.7 MiB will be used.
Continue? [y/n/v/...? shows all options] (y): y
Retrieving package mono-devel-5.20.1-2.3.x86_64                                                                                      (1/2),  12.2 MiB ( 76.3 MiB unpacked)
Retrieving: mono-devel-5.20.1-2.3.x86_64.rpm .........................................................................................................[done (613.3 KiB/s)]
Retrieving package mono-nuget-2.8.7-1.9.noarch                                                                                       (2/2), 347.0 KiB (  1.5 MiB unpacked)
Retrieving: mono-nuget-2.8.7-1.9.noarch.rpm ...........................................................................................................[done (31.0 KiB/s)]
Checking for file conflicts: .......................................................................................................................................[done]
(1/2) Installing: mono-devel-5.20.1-2.3.x86_64 .....................................................................................................................[done]
(2/2) Installing: mono-nuget-2.8.7-1.9.noarch ......................................................................................................................[done]
$ pwsh
PS> Install-PackageProvider  Nuget
Install-PackageProvider : No match was found for the specified search criteria for the provider 'Nuget'. The package provider requires 'PackageManagement' and 'Provider' tags. Please check if the specified package has the tags.
At line:1 char:1
+ Install-PackageProvider  Nuget
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidArgument: (Microsoft.PowerShel\u2026tallPackageProvider:InstallPackageProvider) [Install-PackageProvider], Exception
+ FullyQualifiedErrorId : NoMatchFoundForProvider,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackageProvider

^D
$ nuget install Fudge
If 'nuget' is not a typo you can use command-not-found to lookup the package that contains it, like this:
    cnf nuget
$  rpm -ql mono-nuget
/usr/lib/mono/nuget
/usr/lib/mono/nuget/Microsoft.Web.XmlTransform.dll
/usr/lib/mono/nuget/NuGet.Core.dll
/usr/lib/mono/nuget/NuGet.exe
$ NuGet install Fudge
If 'NuGet' is not a typo you can use command-not-found to lookup the package that contains it, like this:
    cnf NuGet
$ NuGet.exe install Fudge
If 'NuGet.exe' is not a typo you can use command-not-found to lookup the package that contains it, like this:
    cnf NuGet.exe
$  /usr/lib/mono/nuget/NuGet.exe  install Fudge
bash: /usr/lib/mono/nuget/NuGet.exe: cannot execute binary file: Exec format error
$  mono /usr/lib/mono/nuget/NuGet.exe  install Fudge
Installing 'fudge 1.3.0'.
Successfully installed 'fudge 1.3.0'.
jayvdb@linux-lwww:~/projects/coala/coala-bears> pwsh
$ pwsh
PS> fudge
fudge : The term 'fudge' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ fudge
+ ~~~~~
+ CategoryInfo          : ObjectNotFound: (fudge:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
PS> . ./fudge.1.3.0/tools/Fudge.ps1 search choco
Fudge v1.3.0
Error checking user administrator priviledges
Windows Principal functionality is not supported on this platform.
Must be running with administrator priviledges for Fudge to fully function

Duration: 00:00:00.2168319

i.e. I dont know why Install-PackageProvider Nuget doesnt 'just work' - it does on Windows. The openSUSE mono-dotnet doesnt install the provider into OneGet , and it doesnt do the voodoo needed to make .exe an executable format.

Sure I can work all of this out, and do it manually, and I will, but all of this can be bypassed because PSGallery is the only provider pre-installed with pwsh.

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

No branches or pull requests

1 participant