General Troubleshooting

Jianyun edited this page Jan 27, 2016 · 5 revisions

Why continuous prompts for installing NuGet provider?

Problem: I am running Win10 client, November update. Every time I run any of the PSGet cmdlets, I get prompted to install the latest Nuget provider. Why?

Yes known issue. Will be fixed in TP5.

Cause: the old version of the nuget exists under the providerassemblies root folder. It gets imported to your current PowerShell session

Current workaround: Delete the old version from $env:ProgramFiles\PackageManagement\ProviderAssemblies $env:LOCALAPPDATA\PackageManagement\ProviderAssemblies

Or Import-packageprovider –name nuget –requiredVersion –force to your current session

Why is my PowerShell provider not listed from Get-PackageProvider?

Try the following:

  1. Get-PackageProvider -ListAvailable

This will show you the list of available providers on your machine. If your provider is in this list, run Import-PackageProvider -Name <MyProviderName> -Verbose

  1. If your provider does not show up in Get-PackageProvider -ListAvailable, it may be because the provider is not signed. In that case, try relaxing your execution policy with Set-ExecutionPolicy. After that, repeat step 1.

Why do my PowerShell functions return incorrect values sometimes?

If you are using a version of PackageManagement that is released before WMF5.0 RTM, then this may be caused by the use of Write-Verbose, Write-Debug, Write-Warning and Write-Error cmdlets in your functions. To fix this issue, use $null = Write-Verbose <your string> instead of Write-Verbose <your string>.

Can I pipe the return value of Find-Package to Install-Module and vice versa?

No, this will not work. Install-Module is a cmdlet specific to PowerShellGet provider whereas Find-Package is a general PackageManagement cmdlet (which means it may use a provider that is not PowerShellGet). You can pipe the result of Find-Package to Install-Package or pipe the result of Find-Module to Install-Module. Some examples of valid usage:

Find-Module -Name xjea | Install-Module -Verbose
Find-Package -Name jquery -ProviderName NuGet -Source | Install-Package -Destination C:\test -Verbose

Why am I getting a warning saying the module 'sysinternals' cannot be installed or updated because it is not a properly-formed module?

This is likely because you have registered source with the PowerShellGet provider. PowerShellGet provider only works with so you will need to register source with Chocolatey provider via the command:

Register-PackageSource -Name chocolateysource -Location "" –ProviderName Chocolatey
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.