Installing Chocolatey without ‘tab completion’ warning

Chocolatey is a package manager in Windows. It’s pretty neat.

When I was installing Chocolatey, I ran into the following warning—tab completion did not work properly.

WARNING: Not setting tab completion: Profile file does not exist at
'C:\Users\*username*
\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1'.

These are the proper steps I have done to install Chocolatey without the ‘tab completion’ warning.

This is a note for myself. It might not work, or it might. I’m not responsible for anything.

  1. This is to create a PowerShell profile for your Windows user.
    Enter the following in a PowerShell session.

    if (!(Test-Path -Path $PROFILE)) {
     New-Item -ItemType File -Path $PROFILE -Force
    }
  2. Run notepad $profile in the same PowerShell session.
    This will open the Windows user’s profile file in Notepad.
    Append the following code to the profile file and save it:

    # Chocolatey profile
    $ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
    if (Test-Path($ChocolateyProfile)) {
     Import-Module "$ChocolateyProfile"
    }
  3. Run another PowerShell session as administrator
    Run Get-ExecutionPolicy and you will likely get Restricted.
    If so, run Set-ExecutionPolicy RemoteSigned.
  4. Install Chocolatey using the following command:

    Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
  5. You should not have seen the ‘tab completion’ warning while you were installing Chocolately.

Sources

https://superuser.com/questions/1313745/how-can-i-solve-warning-when-i-install-chocolatey
https://docs.chocolatey.org/en-us/troubleshooting#why-does-choco-intab-not-work-for-me
https://chocolatey.org/install

Leave a Reply