Coder Social home page Coder Social logo

Comments (14)

ChaseFlorell avatar ChaseFlorell commented on June 11, 2024

I'm seeing the error also.
So are you saying that after the failure, we just run the install.ps1 command again?

from chocolatey-packages.

dahlbyk avatar dahlbyk commented on June 11, 2024

So are you saying that after the failure, we just run the install.ps1 command again?

Yeah, that should get posh-git installed for you once Chocolately is available on your system.

from chocolatey-packages.

wolf99 avatar wolf99 commented on June 11, 2024

I get an error when attempting this: "The term 'install.ps1' is not recognised..." The only thing in the specified directory is dahlbyk-posh-git-869d4c5

from chocolatey-packages.

dahlbyk avatar dahlbyk commented on June 11, 2024

I get an error when attempting this: "The term 'install.ps1' is not recognised..." The only thing in the specified directory is dahlbyk-posh-git-869d4c5

Not sure how I missed this - it should work if you cd into that directory.

from chocolatey-packages.

OswaldGlinkmeyer avatar OswaldGlinkmeyer commented on June 11, 2024

Got same issue as OP. Followed various threads to end up here. Tried to use install.ps1 but get message "It seems posh-git is already installed..." Huh? Ok, I figure I need to start over, so I attempt "cuninst poshgit" but it says "poshgit is not installed. Cannot uninstall an non-existent package."

from chocolatey-packages.

OswaldGlinkmeyer avatar OswaldGlinkmeyer commented on June 11, 2024

I should also report that despite Chocolately not knowing if poshgit is installed or not, poshgit does appear to be working now.

from chocolatey-packages.

jbgps avatar jbgps commented on June 11, 2024

I just went through this problem, in which poshgit install failed using "cinst poshgit" and failed again trying to directly run ".\install.ps1" from the "c:\tools\poshgit\dahlby##### folder." The error generated by running ".\install.ps1" indicated running scripts was disabled on my system, and I should see "get-help about_signing". I typed that command at the PS prompt and got a page on "about-signing." From that help, the next step was guided by the "TO PERMIT SIGNED SCRIPTS TO RUN:" I ran: "get-executionpolicy" to find that my shell was RESTRICTED, so I ran "set-executionpolicy remotesigned", but that failed because I wasn't running the Powershell elevated. To get the Powershell to run Elevated (as Admin) you type "start-process powershell -Verb runAs" from your existing non-elevate PS prompt, which launched another Powershell window as Elevated. From there, you run the "set-executionpolicy remotesigned" command again (should work), and then, with the policy set to RemoteSigned I was able to go back to "tools\poshgit\dahlby###" and run ".\install.ps1" successfully (or at least that what it indicated).

The key was that my Powershell policy wasn't enabled for Remotely Signed scripts. Once that was done I didn't even need the elevated PS to run .\install.ps1.

I'm an old Unix guy but haven't played with Powershell, so this was new to me. Maybe it'll expedite someone else.

from chocolatey-packages.

dahlbyk avatar dahlbyk commented on June 11, 2024

I suppose Chocolatey internally runs install scripts with an elevated execution policy?

For others' reference while this is finally resolved, here's the full guide to a manual install (exec policy is step 2): https://github.com/dahlbyk/posh-git/blob/master/readme.md#installing-manual.

from chocolatey-packages.

jbgps avatar jbgps commented on June 11, 2024

No, I think the issue for me was that I was running a PS install script in an environment that needed RemoteSigned execution policy but, since I hadn't been doing any PS work, my policy was set to Restricted. I had to jump through a couple hoops to get the execution policy enabled for RemoteSigned scripts (which I assume your script was) before I could go back and run it using cinst, or in this case by directly running install.ps1. My note probably only deals with people that haven't set the proper execution policy for PowerShell. My guess is running chocolately elevated doesn't override the PS policy restrictions, though maybe there's a command line option to do that.

The PS policy problem was not specified by the error message generated when trying to run "cinst" - it generates the System.IO.DirectoryInfo error. Running your script seemed to provide the better indication of my problem: lack of proper PS script execution policy (RemoteSigned).

from chocolatey-packages.

dahlbyk avatar dahlbyk commented on June 11, 2024

I guess my thought is that since the typical Chocolatey install uses @powershell -ExecutionPolicy Bypass ... it's possible to get posh-git all the way installed without needing to Set-ExecutionPolicy such that the generated $PROFILE will actually run. That seems like something we might be able to at least warn about in our Chocolatey installer.

from chocolatey-packages.

jbgps avatar jbgps commented on June 11, 2024

Seems like bypassing the policy restriction silently would save the user
a lot of trouble. Hope it works.

On 2015-05-24 20:24, Keith Dahlby wrote:

I guess my thought is that since the typical Chocolatey install uses @PowerShell -ExecutionPolicy Bypass ... it's possible to get posh-git all the way installed without needing to Set-ExecutionPolicy such that the generated $PROFILE will actually run. That seems like something we might be able to at least warn about in our Chocolatey installer.

Reply to this email directly or view it on GitHub [1].

Links:

[1]
#41 (comment)

from chocolatey-packages.

dahlbyk avatar dahlbyk commented on June 11, 2024

Seems like bypassing the policy restriction silently would save the user a lot of trouble.

Created dahlbyk/posh-git#196 to see if we can improve that experience.

from chocolatey-packages.

ferventcoder avatar ferventcoder commented on June 11, 2024

So Posh-Git package has moved to the official posh-git repo. I'm going to close this issue over here. If you are still experiencing issues with it once the new version of the package is released, please followup at https://github.com/dahlbyk/posh-git :)

from chocolatey-packages.

dahlbyk avatar dahlbyk commented on June 11, 2024

In dahlbyk/posh-git#166, more specifically.

from chocolatey-packages.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.