Open Ma-XX-oN opened 8 years ago
Hi Maxx, this may be related to https://github.com/OneGet/oneget/issues/112 where you are installing a very old version of PackageManagement.
Any update on this?
I just tried to install module browser, and got the same thing. I tried couple of time to install OneGet, but no luck. I saw PackageManagement under program files and under my appdata local folder. Should OneGet be changed to look for PackageManagement? Thank you.
Hi all, this seems to be a problem related to the Module Browser and not PackageManagement itself. We will report this to the Module Browser team so they can fix it accordingly. In any case, are you guys able to use PackageManagement on the command line (without using Module Browser)?
Hello, I can't find-package using the command line tool. For example:
PS C:\Users\dc> Find-Package -Name Firefox Find-Package : No match was found for the specified search criteria and package name 'Firefox'. At line:1 char:1
- CategoryInfo : ObjectNotFound: (Microsoft.Power...ets.FindPackage:FindPackage) [Find-Package], Exception
- FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.FindPackage
Use willd cards:
PSH [C:\foo]: find-package fire
Name Version Source Summary
xFirefox 1.0.0 PSGallery Firefox Main module cFirewall 1.0.1 PSGallery The cFirewall module contains the cFirew cEPRSEnableFirewallInboundC... 1.0 PSGallery cEPRSEnableFirewallInboundConnections Mo
IN the above post, the fire should have an asterisk before the ford fire and after - the joys of a 'smart' editor
My issue was that I didn't have package provider chocolatey. Once I have the provider, I can find packages. Module Browser is still not working though.
I am running the anniversary update 1607 (build 14393.51) of win 10 and powershell ISE wants to download nuget anycpu and fails. it is rather funny because I use NuGet 3.5.0.x in Visual Studio 2015 on a daily basis chocolatey website says: and links to https://chocolatey.org/docs/features-infrastructure-automation#powershell-packagemanagement
so we just have to wait? is there an ETA/roadmap? Looking forward to oneget in win10!
running Install-PackageProvider -Name NuGet -Force tells me that 2.8.5.206 is installed...
I am experiencing the same issue.
On the Gallery pane you get error messages:
Installing nuget-anycpu.exe
This turns into
Initialization failed. Unable to find package provider 'NuGet'.
Switching to Gallery pane should allow searching PowerShell modules out of the box.
Available module folders
C:\Program Files\WindowsPowerShell\Modules\PackageManagement
C:\Program Files\WindowsPowerShell\Modules\PowerShellGet
C:\Program Files\WindowsPowerShell\Modules\PackageManagement\1.0.0.1
C:\Program Files\WindowsPowerShell\Modules\PackageManagement\1.0.0.1\en
C:\Program Files\WindowsPowerShell\Modules\PackageManagement\1.0.0.1\en-US
C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1
C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\en-US
Is KB3134760 installed?
KB3134760 is not installed
Installed providers according to Microsoft.PackageManagement.CoreProviders.dll
Name Version
---- -------
ISE 1.0.0.0
Microsoft.PackageManagement.CoreProviders 3.0.0.0
Microsoft.PowerShell.Management 3.1.0.0
Microsoft.PowerShell.Security 3.0.0.0
Microsoft.PowerShell.Utility 3.1.0.0
Microsoft.WSMan.Management 3.0.0.0
MMAgent 1.0
PackageManagement 1.0.0.1
PowerShellGet 1.0.0.1
Bootstrap
Installed providers according to Get-PackageProvider
Name Version
---- -------
Chocolatey 2.8.5.130
msi 3.0.0.0
msu 3.0.0.0
NuGet 2.8.5.207
PowerShellGet 1.0.0.1
Programs 3.0.0.0
Current Windows build
14393.187.amd64fre.rs1_release_inmarket.160906-1818
Current PowerShell build*
5.1.14393.187
any resolution to thsi. I am having the exact same issue with the module browser.
Closing on a year later now and still no fix???? I have this same problem on the Anniversary edition of Windows 10 just as some other users have reported. Now that I've discovered this feature it'd sure be nice to actually get to use it!
I managed to get it done with Chocolatey as defined in http://stackoverflow.com/questions/12884282/use-nuget-powershell-commandlets-from-outside-visual-studio so thought to drop this reference here
@obensha could you explain "get it done"? Did you find a work around that lets you browse and install modules, or did you find a way to fix the 'anycup.exe' error? Thanks.
Same problem here. I have a question for commenters. Do all of you have visual studio installed? packages work fine for me there(VS), but I'm wondering if this is a conflict. I've noticed the people who have this working don't have Visual studio.
I found a solution to this, thought I'd share:
(I'm on Windows 10, and not using Visual Studio ... although I may have had it at one point or have some remnants from .net projects in the past.)
Anyways, I was editing the profile "Microsoft.PowerShellISE_profile.ps1 " and noticed this line:
Add-Type -Path 'C:\Program Files (x86)\Microsoft Module Browser\ModuleBrowser.dll'
The module browser was being loaded from "Program Files (x86)" even though I was pretty sure that i ran some chocolatey updates that installed things into "Program Files"
I commented out that line above, and instead specified the newer path:
Add-Type -Path 'C:\Program Files\WindowsPowerShell\Modules\ISEModuleBrowserAddon\1.0.1.0\ISEModuleBrowserAddon.dll'
Reloaded ISE and the Gallery started working. :)
@dbatchelor
Finally you've got it nailed! Thanks a bunch!
To enable Module Browser for the 64-bit version of PowerShell ISE:
%userprofile%\Documents\WindowsPowerShell
If ($env:PSModulePath.Split(';') -contains "C:\Program Files\WindowsPowerShell\Modules" -and ([Environment]::Is64BitProcess)) {
Add-Type -Path 'C:\Program Files\WindowsPowerShell\Modules\ISEModuleBrowserAddon\1.0.1.0\ISEModuleBrowserAddon.dll'
Write-Host 'Loaded 64-bit version'
}
else {
Add-Type -Path 'C:\Program Files (x86)\Microsoft Module Browser\ModuleBrowser.dll'
Write-Host 'Loaded 32-bit version'
}
Whole profile script:
#Module Browser Begin
#Version: 1.0.0
If ($env:PSModulePath.Split(';') -contains "C:\Program Files\WindowsPowerShell\Modules" -and ([Environment]::Is64BitProcess)) {
Add-Type -Path 'C:\Program Files\WindowsPowerShell\Modules\ISEModuleBrowserAddon\1.0.1.0\ISEModuleBrowserAddon.dll'
Write-Host 'Loaded 64-bit version of Module Browser'
}
else {
Add-Type -Path 'C:\Program Files (x86)\Microsoft Module Browser\ModuleBrowser.dll'
Write-Host 'Loaded 32-bit version of Module Browser'
}
$moduleBrowser = $psISE.CurrentPowerShellTab.VerticalAddOnTools.Add('Module Browser', [ModuleBrowser.Views.MainView], $true)
$psISE.CurrentPowerShellTab.VisibleVerticalAddOnTools.SelectedAddOnTool = $moduleBrowser
#Module Browser End
So finally, it works in a 64-bit ISE.
Now there's an issue with the 32-bit version of ISE. For some reason, it loads the 32-bit version of Module Browser for Windows PowerShell ISE (x86), but still it results in the notorious issue with Module Browser being unable to get the NuGet package.
What could be wrong?
@dbatchelor, @gudenuff . "what could go wrong?" well....
So others beware of using the script. May as well hand code it.
Do you have "C:\Program Files\WindowsPowerShell\Modules\ISEModuleBrowserAddon" on your system?
Then edit the "#Module Browser Begin" section of
%userprofile%\Documents\WindowsPowerShell\Microsoft.PowerShellISE_profile.ps1
to be:
#Module Browser Begin
#Version: 1.0.0
Add-Type -Path 'C:\Program Files\WindowsPowerShell\Modules\ISEModuleBrowserAddon\1.0.1.0\ISEModuleBrowserAddon.dll'
Write-Host 'Loaded 64-bit version of Module Browser'
$moduleBrowser = $psISE.CurrentPowerShellTab.VerticalAddOnTools.Add('Module Browser', [ModuleBrowser.Views.MainView], $true)
$psISE.CurrentPowerShellTab.VisibleVerticalAddOnTools.SelectedAddOnTool = $moduleBrowser
#Module Browser End
[Edited: added ending bracket, thanks @Damperen]
@gudenuff So I modified the ...profile.ps1 as suggested. Everything seems to be good with the world...until I open a File > New Powershell Tab (Ctrl+T). Powershell proceeds to tell me that it has loaded the 32-bit version of Module Browser.
After a little detective work I find that as Powershell starts, $env:PSModulePath does not have a trailing backslash on any of the path entries. After it starts, all entries in $env:PSModulePath have trailing backslashes.
I don't know if it's just me but you can test it yourself by adding
Write-Host $env:PSModulePath
just before the If statement. Once Powershell starts, take a look at $env:PSModulePath.
Anyone else seeing this?
@OzBob
This worked for me, however you missed the parenthesis ')' after $true
On the following line
$moduleBrowser = $psISE.CurrentPowerShellTab.VerticalAddOnTools.Add('Module Browser', [ModuleBrowser.Views.MainView], $true
@gudenuff
For my installation, instead of:
Add-Type -Path 'C:\Program Files\WindowsPowerShell\Modules\ISEModuleBrowserAddon\1.0.1.0\ISEModuleBrowserAddon.dll'
I had to use:
Add-Type -Path 'C:\Users\USERNAME\Documents\WindowsPowerShell\Modules\ISEModuleBrowserAddon\1.0.1.0\ISEModuleBrowserAddon.dll''
before it worked for me
@gudenuff I think you may have installed WindowsPowerShell in a un-conventional manner, or may not be Admin on your PC??? but congratulations on solving it, it's annoying isn't it!
I initially did not had the ISEModuleBrowser folder in my Program Files at all, even if I installed if from MS download page: https://www.microsoft.com/en-us/download/details.aspx?id=45885
Therefore launching this command installed it correctly:
Install-Module -Name ISEModuleBrowserAddon
After that the code provided by @OzBob worked perfectly, thanks !!
This still hasn't been fixed? Btw, if you download and install it from MS (one to have to import-module ISEModuleBrowser Every. Damn. Time you open ISE) the setup program will blow away the above customizations putting you back to square one again.
found a simple solution that worked for me
close ISE
go to %userprofile%\Documents\WindowsPowerShell
rename(/remove) Microsoft.PowerShellISE_profile.ps1
reopen ISE.
That suggests that the issue is due to something in that ISE Profile. If you have not actually deleted it, you might care to look at what is in that profile as it is the cause of your issue.
Although the fix by @gudenuff seemed working for me, (I was seeing the prompt Loaded 64-bit version of Module Browser
), ISE window would close right away.
The fix was to comment the last two lines of the Microsoft.PowerShellISE_profile:
$moduleBrowser = $psISE.CurrentPowerShellTab.VerticalAddOnTools.Add('Module Browser', [ModuleBrowser.Views.MainView], $true)
$psISE.CurrentPowerShellTab.VisibleVerticalAddOnTools.SelectedAddOnTool = $moduleBrowser
Module Browser End
found a simple solution that worked for me
close ISE go to %userprofile%\Documents\WindowsPowerShell rename(/remove) Microsoft.PowerShellISE_profile.ps1 reopen ISE.
Thanks @narinderparmar this fixed my issue
I've tried to install the NuGet-anycpu.exe from the ISE:
However, when I click on Accept, I get:
I dunno what's going on, but when I went looking for this, I got this page. Can you please give me a hand?
Thanks,
Maxx