OneGet / oneget

PackageManagement (aka OneGet) is a package manager for Windows
MIT License
2.38k stars 189 forks source link

WMF 5.0 on Windows 7 - PackageManagement appears not to be present? #148

Closed pfmoore closed 8 years ago

pfmoore commented 9 years ago

I've just installed WMF 5.0 Production Preview on my Windows 7 laptop. But I can't see any of the package management tools:

PS> get-module PackageManagement
PS> get-command Get-Package
get-command : The term 'Get-Package' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path
was included, verify that the path is correct and try again.
At line:1 char:1
+ get-command Get-Package
+ ~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Get-Package:String) [Get-Command], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException,Microsoft.PowerShell.Commands.GetCommandCommand

PS> get-command Get-PackageProvider
get-command : The term 'Get-PackageProvider' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if
a path was included, verify that the path is correct and try again.
At line:1 char:1
+ get-command Get-PackageProvider
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Get-PackageProvider:String) [Get-Command], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException,Microsoft.PowerShell.Commands.GetCommandCommand

I didn't do anything special when downloading, I just ran the download file from the Microsoft site. I've looked for documentation clarifying whether I need to do anything more to activate the package manager, but can't find anything.

Do I need to manually install OneGet separately? If so, where do I get it from? The links here point to the WMF 5.0 file I installed...

xumins commented 9 years ago

@pfmoore Can you double check you installed from http://www.microsoft.com/en-us/download/details.aspx?id=48729? if the issue persists, please contact @jianyunt and @quoctruong directly.

quoctruong commented 9 years ago

@pfmoore Can you try Import-Module PackageManagement? Also, can you double check that you have a PackageManagement folder in your module folders?

Thanks

pfmoore commented 9 years ago

@quoctruong Will do, but it'll have to wait till after the weekend.

@xumins Sure but how do I do that? I got it via the link at oneget.org (= the readme here) and that link is the same one you quote. If you mean uninstall, re-download and reinstall, then I can give that a go (again, next week) but I'd rather try the other suggestions first...

xumins commented 9 years ago

@pfmoore yes please try Quoc's suggestion first.

pfmoore commented 9 years ago

Hmm, ImportModule PackageManagement fails ("no valid module found") and there is no PackageManagement directory anywhere along $env:PSModulePath

>$env:PSModulePath -split ';' | % { dir $_ } | % { $_.Name }
Pscx
AppLocker
BitsTransfer
CimCmdlets
ISE
Microsoft.PowerShell.Archive
Microsoft.PowerShell.Diagnostics
Microsoft.PowerShell.Host
Microsoft.PowerShell.Management
Microsoft.PowerShell.ODataUtils
Microsoft.PowerShell.Security
Microsoft.PowerShell.Utility
Microsoft.WSMan.Management
NetworkSwitchManager
PSDesiredStateConfiguration
PSDiagnostics
PSScheduledJob
PSWorkflow
PSWorkflowUtility
TroubleshootingPack
go
PowerYaml
PsGet
PSReadLine
PsUrl
pswatch
TabExpansion++
Venv
MSI

>$PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.0.10514.6
WSManStackVersion              3.0
SerializationVersion           1.1.0.1
CLRVersion                     4.0.30319.42000
BuildVersion                   10.0.10514.6
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3

Is there anything else I can try before reinstalling? Also, how do I reinstall? There's no WMF 5.0 entry in "Programs and Features". In "Installed Updates" there is "Windows Management Framework 5.0 Production Preview (KB3066439)" installed on 01/09/2015. Is that what I need to uninstall?

jianyunt commented 9 years ago

It looks PackageManagement and PowerShellGet are not installed because they are not in the list. Please uninstall previous installed WMF 5.0. thanks. By the way, did you install .net 4.5 before installing the WMF 5.0? If not, please do so. Which language of the OS are you using? From the date 01/09/2015, I guess it is not en-US, right?

quoctruong commented 9 years ago

Hi pfmoore, please make sure you had wmf 4.0 installed before installing wmf 5.0

pfmoore commented 9 years ago

@quoctruong I did. I think. I don't now (of course).

@jianyunt "Uninstall previous install". I'm not sure I understand. I currently only have one install, WMF 5.0 Production Preview. You want me to uninstall that, yes? And then what? Reinstall it from the MS website? I believe I installed .net 4.5 first (probably as a result of installing Visual Studio 2015). It's installed now, anyway (I'll double check tomorrow, but I'm pretty sure I already checked). My language is en-GB.

pfmoore commented 9 years ago

I haven't reinstalled yet, but I have re-downloaded the file and confirmed that the copy I installed is the exact same copy as I've just downloaded now. File and MD5 checksum are:

\f74d68d447e928ea01adc29ae71e0b6e *C:\\Users\\...\\Downloads\\Win7AndW2K8R2-KB3066439-x64.msu
gwojan commented 9 years ago

For what it's worth, I just installed WMF 5.0 Production Preview on Windows 7. I had a previous CTP which I removed and rebooted before attempting to install the Production Preview.

After installation and a reboot I do have PackageManagement and PowerShellGet installed in the C:Programs Files\WindowsPowerShell\Modules\ directory.

Just my experience so far...

pfmoore commented 9 years ago

OK. I have now uninstalled WMF 5.0 Production Preview. After doing so I found a WMF 4.0 in my "installed updates". I uninstalled that as well. I then confirmed that I had no working "powershell" command (I had some links left, and powershell.exe appeared to still be present on my PC, but if I ran it from cmd.exe, it simply terminated immediately). I could find no other WMF or powershell entries in either "Add/Remove Programs" or "Installed Updates".

I then reinstalled WMF 5.0 Production Preview, from the file Win7AndW2K8R2-KB3066439-x64.msu downloaded from the link on this site.

Result: still no PackageManagement module. I also don't seem to have a command line "powershell" link in my start menu any more. This is not a big issue to me, as I normally start powershell in ConEmu by directly running powershell.exe. I only mention it because it's a weird consequence that might be relevant.

I'm stuck now. I have a basically working PowerShell 5.0, but components seem to be missing that shouldn't be. I'd like to experiment with the new package management features but without them being present, I can't.

DarwinJS commented 8 years ago

According to the PowerShell team at Microsoft you should layer WMF 4 on the machine before doing WMF 5 (check the release notes in detail as the requirement is buried in there).

Consider uninstalling WMF 5 and reading this article I wrote on how to reliably get WMF 5 installed on Windows 7 or Server 2008 R2: https://www.linkedin.com/pulse/article/poodles-through-burning-hoops-plan-powershell-5-win-7-darwin-sanoy

One small qualifier for Chocolatey. The "Chocolatey" PackageManagement plug-in installed by WMF 5 (even on production windows 10) is broken. The workaround is to install the full chocolatey client along side PackageManagement Chocolatey Provider. This shouldn't be necessary - which also means it may not be reliably fixing everything. At the point I have the full Chocolatey client installed, I might as well use it directly - it has better logging and is updated much more frequently. (Current Chocolatey PackageManagement plug-in is 16 months old and the open source project is not moving fast)

D.

pfmoore commented 8 years ago

Thanks for the information. Just recently, however, I have got a new PC, so the issue is no longer a problem for me. Interestingly, however, the new PC was a straight Windows 7 install (with some corporate packages added, but as far as I know no WMF/Powershell upgrades) and I installed WMF 5 directly onto it, and the package management cmdlets were all present.

pfmoore commented 8 years ago

Hmm, reading your article I see

The bigger ouch is that you can successfully install WMF 5 on top of PowerShell 2 and when you reboot PowerShell shows version 5! So what state does that leave you in?

Maybe I'll do some further checking...

DarwinJS commented 8 years ago

Paul, I know the PowerShell team was targeting eliminating the WMF 4.0 requirement - so frankly I'm not sure if they have their story straight at this point. I advised that if it is a true dependency they should be blocking the MSU from installing if WMF 4 is not present on Win 7 or Server 2008 R2.

In reading that article (and the scripts linked to it) you can see how the lack of blocking for missing requirements (like WMF 4 and 5 not blocking when an insufficient version of dotnet is installed) is causing quite the aggregation of configuration sludge you need to discover and wade through for success.

It's disappointing that a technology targeted at making installations easy and automation ready suffers from being very non-automation ready and difficult to install correctly on a single workstation - let alone an fleet of enterprise machines.

quoctruong commented 8 years ago

Hi Darwin, to install the lastest WMF 5 that was just released, you don't need to have WMF4.

DarwinJS commented 8 years ago

Quoc, Could you please contact Keith Bankston at Microsoft - I have an email from him of Sept 3 saying that it is required - even after I brought the fact WMF 5 seems to install fine on top of PSH 2. Krishna Vutukuri was also copied on the email (but did not comment).

It would be great to find out WMF 4 is not required (and also remove it from the release notes for the final release if it's true).

D.

quoctruong commented 8 years ago

Hi Darwin, he's currently on vacation but I'll bring up this issues with him. We will fix the release notes accordingly. Thanks

rickmoua commented 8 years ago

Have the KB3066439 (WMF 5.0 prod preview). Tried to remove it from control but getting "An error has occurred. Not all of the updates were successfully uninstalled." The KB3066439 is still there. Anyway to remove it.

copdips commented 8 years ago

same issue here when uninstalling KB3066439 (WMF 5.0 prod preview)