How can I solve warning when I install chocolatey?
6,357
Solution 1
Here's the solution for the tab completion warning:
-
Open a PowerShell session and run:
notepad $profile
This opens the profile file in Notepad. -
Copy and paste the following code into Notepad and save the file:
# Chocolatey profile
$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
if (Test-Path($ChocolateyProfile)) {
Import-Module "$ChocolateyProfile"
}
- Restart PowerShell
Source: https://github.com/chocolatey/choco/wiki/Troubleshooting#why-does-choco-intab-not-work-for-me
Solution 2
Just ran into this warning myself. It occurs because there is not an existing PowerShell profile for your Windows user.
To create a profile, open a PowerShell session and enter:
if (!(Test-Path -Path $PROFILE)) {
New-Item -ItemType File -Path $PROFILE -Force
}
I pulled the above code from Microsoft's documentation. The page covers a lot more about profiles if you are interested.
![Success Man](https://i.stack.imgur.com/uKDoq.jpg?s=256&g=1)
Author by
Success Man
Updated on September 18, 2022Comments
-
Success Man almost 2 years
When I install chocolatey, I get error like this :
... WARNING: It's very likely you will need to close and reopen your shell before you can use choco. ... WARNING: You can safely ignore errors related to missing log files when upgrading from a version of Chocolatey less than 0.9.9. 'Batch file could not be found' is also safe to ignore. 'The system cannot find the file specified' - also safe. WARNING: Not setting tab completion: Profile file does not exist at 'C:\Users\Chelsea \Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1'. ...
How can I solve the error?
-
bertieb about 6 yearsAdding the error text as text (if possible) would be helpful to have in addition to the image
-
Success Man about 6 years@dsstorefile Yes. I mean warning
-
Success Man about 6 years@bertieb I update my question
-
Ramhound about 6 yearsYou have three warnings, only one, is important. So which warning are you worried about. Have you closed and reopened your PowerShell prompt?
-
-
mbomb007 over 3 yearsI think you mean
chocolateyProfile.ps1
-
Tereza Tomcova over 3 yearsOn what chocolatey version are you seeing
chocolateyProfile.ps1
? On 0.10.15 it’s.psm1
. -
mbomb007 over 3 yearsNever mind. I wasn't familiar with PowerShell modules
-
RufusVS over 2 yearsThis is not a helpful answer. The warning tells the user a chocolatey feature will not be installed. So there are two approaches to this question: How do I get this feature after install? or "What do I need to do to not get this warning?": as I found out, it still installs, so either one has to uninstall and reinstall, after creating a profile, or follow the other answer in this thread.
-
ro͢binmckenzie over 2 yearsAfter doing the above points (thanks!), I then got "execution of scripts is disabled on this system." Fixed by following steps in stackoverflow.com/questions/4037939/…:
Set-ExecutionPolicy -ExecutionPolicy Unrestricted