-
Notifications
You must be signed in to change notification settings - Fork 905
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Profile command - add tab completion/refreshenv to PowerShell #894
Comments
I'm trying to understand if refreshenv for powershell has been removed as a feature. If not, what is the correct way to load it? A few weeks ago you had to reload your profile, but it seems the profile is no longer updated. |
@masaeedu it's still there as a feature, you just may need to manually add it. We introduced #833 to address the issues of creating a profile in many automation scenarios. To add it manually for now when you install and there isn't a profile found or the profile file is missing. $profileInstall = @'
# Chocolatey profile
$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
if (Test-Path($ChocolateyProfile)) {
Import-Module "$ChocolateyProfile"
}
'@
$profileFile = "$profile"
$chocoProfileSearch = '$ChocolateyProfile'
if(Select-String -Path $profileFile -Pattern $chocoProfileSearch -Quiet -SimpleMatch) {
Write-Debug "Chocolatey profile is already installed."
return
}
$profileInstall | Out-File $profileFile -Append -Encoding (Get-FileEncoding $profileFile) |
So just clarifying - this issue is about adding a new command to |
@flcdrg yes, that's the idea. |
|
Hey Chocolatey Team, I was fussing around with Powershell 7 Preview and added a function to my $PROFILE, actually related to Chocolatey. I tried running it this morning and found my function didn't work. In troubleshooting I found that my $profile was modified with a Chocolatey Profile script. First off I think I have done a disservice to Choco as I didn't realize there was tab completion until today. When researching this I have been missing this since 2016, Yikes! Anyhow it is awesome to have this feature. |
here's tweaked Get-FileEncoding that works for pwsh 7.1.4
|
This is a split off of #833.
The text was updated successfully, but these errors were encountered: