Open E3V3A opened 5 years ago
@E3V3A You'll get mixed results using PowerShell Core and installing Chocolatey. Use Windows PowerShell to do so as Core is not supported at present.
Note the errors in the logs above (as you will need to act on then) and also note that they indicate that Chocolatey has not installed completely.
Aha. Can I just repeat the install on top, or do I need to remove something? (I already installed a bunch of stuff, that seem to work. Will they disappear?)
BTW. What is the correct permissions for ProgramData/chocolatey
?
PS. I also have the latest .NET...
Ok, re-installed using PS 5.1. Now it works as expected, although some of my previous profile items no longer work. (I suspect they interfere with Chocolatey?) Either way, this should be made more clear from the instructions page. I guess PWSH (Core) is the future and will be part of W10, if not already.
That said, does the bugs shown above give you any ideas? Since most of choco worked already, my guess is that the bugs shown are of the simple kind, that may be easily fixed?
Now it works also in pwsh :+1:
Install bug still need to be fixed.
I am pretty sure we mention it at least somewhere that PowerShell core doesn't work. I don't see it on the Install page though under requirements, so let's fix that. Done at https://github.com/chocolatey/choco-wiki/commit/d5126fce9d7abd5d08aefe7d69fe6dd394941ad8.
BTW. What is the correct permissions for ProgramData/chocolatey?
C:\ > cacls.exe C:\ProgramData\chocolatey
C:\ProgramData\chocolatey NT AUTHORITY\SYSTEM:(OI)(CI)F
BUILTIN\Administrators:(OI)(CI)F
BUILTIN\Users:(OI)(CI)R
Aha. Can I just repeat the install on top, or do I need to remove something? (I already installed a bunch of stuff, that seem to work. Will they disappear?)
Maybe?
I have the same cacls as you, so all good there.
Will they disappear?
No, so far I see nothing missing.
For profile, you will want refreshenv
(no .cmd afterwards, that only works with cmd.exe) to work. You just need to add the powershell profile, which it sounds like you might have already started on.
https://chocolatey.org/docs/troubleshooting#why-does-choco-intab-not-work-for-me
I'm not using cmd.exe, and it works in both PS5 and pwsh (Core), after you have added the choco script loading lines in both your profile directories.
If Chocolatey itself appears to be somewhat working in powershell core, it's likely because under the covers you still have PowerShell 5.1 installed on the system and Chocolatey runs its own PowerShell host (using PowerShell 5.1). pwsh.exe is simply calling choco to run like any command shell would.
So to get to PowerShell 6+ (Core) support, we need to start looking at adjustments to what is not available in that area and account for them in some ways. The proxy bypass not being available is kind of interesting, but I'm guessing that is based on what's in .NET Core and PowerShell Core by proxy (ha, that was not intentional).
Sound great. Thanks for the support. :1st_place_medal:
Commenting here as I too had this issue installing with PS Core 6.2.3. Was Chocolately updated recently to support Core versions? I do not see the change you made here https://github.com/chocolatey/choco-wiki/commit/d5126fce9d7abd5d08aefe7d69fe6dd394941ad8 reflected on your live site (https://chocolatey.org/install) / (https://github.com/chocolatey/chocolatey.org/blob/master/chocolatey/Website/Views/Pages/Install.cshtml)
@argumemnon no, support for PS Core has not been added to chocolatey yet (AFAIK).
The documentation the commit you link to is not the install
page though, but rather from the full docs page here: https://chocolatey.org/docs.
I just installed choco using PWSH 6.1.1 on W8.1.
After suspicious install messages (shown below) I was looking to use some of the helper functions, such as the alias
refreshenv
andUpdate-SessionEnvironment
. As suggested I also included the suggested lines in$profile
.What You Are Seeing?
Powershell doesn't recognize
Update-SessionEnvironment
, onlyRefreshEnv.cmd
, but normal choco.exe works, since it's in the path.What is Expected?
To be able to use:
refreshenv
andUpdate-SessionEnvironment
etc, from PS.Output Log
My install log: