Sitelet https://github.com/fsprojects/Paket/pull/872
Skip to content

Chocolatey support for Paket.PowerShell - #872

Merged
forki merged 5 commits into
fsprojects:masterfrom
ctaggart:powershell
Jun 14, 2015
Merged

forki merged 5 commits into
fsprojects:masterfrom
ctaggart:powershell

Conversation

@ctaggart

Copy link
Copy Markdown
Contributor

Testing locally can be done like so:

choco install Paket.PowerShell -s C:\Projects\Paket\temp --pre -y --force

Installing from NuGet can be done like so:

choco install Paket.PowerShell -s http://www.nuget.org/api/v2 -y

Once it is uploaded to or mirrored on Chocolatey, then just this will work:

choco install Paket.PowerShell -y

@forki

forki commented Jun 14, 2015

Copy link
Copy Markdown
Member

Should we push this to chocolatey during the build?

@ctaggart

Copy link
Copy Markdown
Contributor Author

I think so. That is what I do for SourceLink.exe. You could also do that same for paket.

forki added a commit that referenced this pull request Jun 14, 2015
Chocolatey support for Paket.PowerShell
@forki
forki merged commit c11b7e9 into fsprojects:master Jun 14, 2015
@forki

forki commented Jun 14, 2015

Copy link
Copy Markdown
Member

cool. It's uploaded to https://chocolatey.org/packages/Paket.PowerShell/1.14.0, but await moderator approval.

@forki

forki commented Jun 14, 2015

Copy link
Copy Markdown
Member

I'm pretty sure Paket's release cycle will annoy the hell out of the choco guys.

@alexeyzimarev

Copy link
Copy Markdown

After the installation, it cannot be used in the PS console, like path is not added.

@ctaggart

Copy link
Copy Markdown
Contributor Author

@alexeyzimarev Are you trying to use it from the Package Manager Console in Visual Studio? Are you able to use it from normal PowerShell? It worked for me with this simple test:

image

Did the path get added correctly to the PSModulePath?

(Get-Item Env:\PSModulePath).Value -Split ';'

image

The PSModulePath allows the module to be imported on demand. If that is not working, are you ale to import it manually?

Import-Module C:\ProgramData\chocolatey\lib\Paket.PowerShell\tools\Paket.PowerShell\Paket.PowerShell.dll -DisableNameChecking

image

@ctaggart

Copy link
Copy Markdown
Contributor Author

@alexeyzimarev It looks like some output doesn't show up. Is that what you mean? I logged this bug and will look into it. #874

@alexeyzimarev

Copy link
Copy Markdown

No, for me it was just saying that "Paket" is not a valid command. I tried from the PS shell. Will check the path later.

@alexeyzimarev

Copy link
Copy Markdown

This is what I got after cinst

PS D:\GitHub\Paket.VisualStudio> (Get-Item Env:\PSModulePath).Value -Split ';'
C:\Windows\system32\WindowsPowerShell\v1.0\Modules
C:\Program Files (x86)\Microsoft SQL Server\120\Tools\PowerShell\Modules\

@alexeyzimarev

Copy link
Copy Markdown

Import gives this:

2015-06-15_12-26-21

@ctaggart

Copy link
Copy Markdown
Contributor Author

Hi @alexeyzimarev, I'm not sure why you get that error message. Can you provide the output of these commands?

$PSVersionTable
choco --version
choco list --localonly
Get-FileHash C:\ProgramData\chocolatey\lib\Paket.PowerShell\tools\Paket.PowerShell\Paket.PowerShell.dll -Algorithm SHA1 | fl

image

Unless I coded something wrong, C:\ProgramData\chocolatey\lib\Paket.PowerShell\tools should get added to your $PSModulePath. I've tested it on a couple of computers. Start a new PowerShell session after installing.

@ferventcoder

Copy link
Copy Markdown

@alexeyzimarev did you close and reopen your shell?

@ferventcoder

Copy link
Copy Markdown

So forcing the import worked for me.

image

@ferventcoder

Copy link
Copy Markdown

I did notice that you are adding a bunch of unapproved verbs, which might be why it didn't automatically import?

@ferventcoder

Copy link
Copy Markdown

This might be helpful as well.

image

@ferventcoder

Copy link
Copy Markdown

Dumb question. Does a module automatically load without a psd1/psm1 file?

@ferventcoder

Copy link
Copy Markdown

Actually the dumbest possibility, did you need the trailing back slash at the end of your custom module path? http://stackoverflow.com/a/23942543/18475

@ctaggart

Copy link
Copy Markdown
Contributor Author

@ferventcoder There is not a Paket command. If you open a new PowerShell instance and type Paket- or just pak and hit tab, do you see a list? PowerShell will import it as soon as you try running one of them. If so, the $env:psmodulepath is doing its job. I've now tried successfully on 3 computers.

@ferventcoder

Copy link
Copy Markdown

I didn't, but this may be helpful

WMF 5 by the way. I added the trailing back slash and
image

@ferventcoder

Copy link
Copy Markdown

Seems to work without the trailing backslash as well. With Paket- {tab}

@ferventcoder

Copy link
Copy Markdown

so should be good to approve. :)

@ferventcoder

Copy link
Copy Markdown

Approved.

With the project owners building the package, we move things to a trusted status after a few good approvals @forki.

@ctaggart

Copy link
Copy Markdown
Contributor Author

Awesome! Thank you! Sometime this week, I hope to get a blog about how I used F# + Chocolatey + PowerShell. :-)

@ferventcoder

Copy link
Copy Markdown

:)

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

Successfully merging this pull request may close these issues.

4 participants