Windows 10: PowerShell PackageManagement (OneGet) - Install Apps from Command Line

Discus and support PowerShell PackageManagement (OneGet) - Install Apps from Command Line in Windows 10 Tutorials to solve the problem; Nope Which powershell do I use? Windows Powershell Windows Powershell ISE Windows Powershell (x86) Windows Powershell Modules. Have you tried... Discussion in 'Windows 10 Tutorials' started by Charlie, Oct 31, 2014.

  1. BunnyJ New Member

    PowerShell PackageManagement (OneGet) - Install Apps from Command Line


    Have you tried to use the instructions in the first post??
     
    BunnyJ, Mar 25, 2015
    #31

  2. Either

    • Windows Powershell
    • Windows Powershell (x86)
    • Windows Powershell ISE

    Should work

    However if you are not familiar with Powershell maybe give the tutorial a walk through.
     
    JDobbsy1987, Mar 25, 2015
    #32
  3. adamf Win User
    If you don't want to try it then why don't you.....reconsider if 10 is your thing.
     
    adamf, Mar 25, 2015
    #33
  4. Kari Win User

    PowerShell PackageManagement (OneGet) - Install Apps from Command Line

    OneGet needs the Windows Management Framework version 5 which is native in Windows 10 and can be downloaded and installed on earlier versions of Windows here: Download Windows Management Framework 5.0 Preview February 2015 from Official Microsoft Download Center.

    A quote from the above mentioned site:
    However, Garret Sercak (head of OneGet team at Microsoft) has had a habit to publish OneGet experimental builds as the project evolves. You can check @PSOneGet on Twitter for download links for the latest build. I have only tested these experimental builds in Windows 10 but can't see any reasons why they wouldn't run in Windows 7 PowerShell.

    Latest experimental build was released only three days ago:

    Tweet



    — Twitter API (@user) date
     
  5. groze Win User
    BunnyJ,

    I am actually considering sticking with windows 7 and my current dual boot. I am not really sure I like Zdnet reporting of microsoft windows 10 lifecycle policy. It even changes the future if I even buy a computer that has windows as a service. I also thought the current version of the windows 10 had spartan in it, from what I read it doesn't.

    I even updated to the 3.0 powershell and even an unofficial script to install one-get beta nothing worked.

    However, Choco works though.
     
    groze, Mar 25, 2015
    #35
  6. groze Win User
    A good OneGet alternative for Windows 7 is Chocolatey. This tutorial is for Windows 8 but Chocolatey works exatly the same way in Windows 7: Chocolatey - Install Apps from Command Line

    Kari
     
    groze, Mar 25, 2015
    #36
  7. Kari Win User
    I got interested, installed Seven on a vm, now upgrading it's Management Framework to v.3 in order to be able to upgrade PowerShell to v.3, after that the experimental build should run. I'll post the results of this test.
     
  8. groze Win User

    PowerShell PackageManagement (OneGet) - Install Apps from Command Line

    PS C:\Users\User Name> ipmo oneget-edge
    ipmo : The specified module 'oneget-edge' was not loaded because no valid module file was found in any module
    directory.
    At line:1 char:1
    + ipmo oneget-edge
    + ~~~~~~~~~~~~~~~~
    + CategoryInfo : ResourceUnavailable: (oneget-edge:String) [Import-Module], FileNotFoundExceptio
    n
    + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand


    I read Windows 7 may be missing a netframework file. I am gong to try and install that and repeat this.

    Nevermind, netframework already installed. I read something about a path. I am trying to figure out how to add a path.

    Here is the path and found the module to load.
    C:\Program Files (x86)\Outercurve Foundation\OneGet\1.15.82.35272
     
    groze, Mar 26, 2015
    #38
  9. Kari Win User
    @groze, Oneget experimental build seems to work just fine in Windows 7, although needing a minute or two to set it up.

    Here's what you need to do:

    To ugrade PowerShell v. 2 in Windows 7 to v.3, you need to install Dot NET Framework 4 or later. I installed the latest 4.5 from here: Download Microsoft .NET Framework 4.5 from Official Microsoft Download Center

    Next, the Windows Management Framework v.3 or later must be installed. For Windows 7 get the v.3 here: Download Windows Management Framework 3.0 from Official Microsoft Download Center. Be sure to select the correct Management Framework, in screenshot below the Windows 7 x64 highlighted with yellow, the x86 with green:

    PowerShell PackageManagement (OneGet) - Install Apps from Command Line [​IMG]

    Now install the latest OneGet experimental build. When done run PowerShell, it is now upgraded to v.3 showing Copyright notice from 2012 (v.2, the Windows 7 default PowerShell shows 2009) and you can run OneGet.

    Here's how I tested OneGet in Windows 7, list item numbers refer to corresponding numbers in the screenshot after the list:
    • The Chocolatey package provider where most of the installers come from needs the PS script execution policy to be unrestricted. To change the policy give the following command
      Code: set-executionpolicy unrestricted[/quote] The above command applies if you run PS elevated. If not, you need to add parameter -scope with value currentuser to command:
      Code: set-executionpolicy unrestricted -scope currentuser[/quote]
    • Next you need to import the OneGet experimental module you installed to the PowerShell. Command is:
      Code: ipmo "C:\Program Files (x86)\Outercurve Foundation\OneGet\1.15.82.35272\OneGet-Edge"[/quote] (In x86 systems in C:\Program Files\...) Notice that the installer of the module says the command is ipmo oneget-edge but this is wrong, the import module command ipmo needs the full path.
    • By default the package provider Chocolatey is not installed. Get it simply with this command:
      Code: get-packageprovider Chocolatey[/quote]
    • In my test just now I didn't bother to do anything else, I just went directly to install apps. I gave a OneGet command to install VLC Player, Adobe Reader, Chrome, Screenpresso and WinRAR with command:
      Code: install-package VLC, AdobeReader, GoogleChrome, Screenpresso, WinRAR[/quote]
    • and 6. VLC, Adobe Reader and Chrome installed OK, Screenpresso and WinRAR which both install OK with OneGet in Windows 10 didn't install. I suspect this is because my test vm was just an x86 system and OneGet retrieved x64 installers for these two apps

    PowerShell PackageManagement (OneGet) - Install Apps from Command Line [​IMG]

    Seems to work in Windows 7 *Smile. Notice that as this is an experimental build and not meant to be used in Windows 7, you need to import the OneGet module and get the Chocolatey provider each time you relaunch PS, list items 2 & 3 on the list above.
     
  10. groze Win User
    Nevermind, trying it out now
     
    groze, Mar 26, 2015
    #40
  11. Kari Win User
  12. groze Win User
    groze, Mar 26, 2015
    #42
  13. Kari Win User

    PowerShell PackageManagement (OneGet) - Install Apps from Command Line

    Thanks to you I got interested and tested this in Windows 7 *Smile.
     
  14. rmonroe36 Win User
    # Chocolatey
    iex ((new-object net.webclient).DownloadString('http://bit.ly/psChocInstall'))

    # install applications
    cinst audacity
    cinst ccleaner
    cinst cdburnerxp
    cinst classic-shell
    cinst defraggler
    cinst everything
    cinst firefox
    cinst google-chrome-x64
    cinst lastpass
    cinst malwarebytes
    cinst picasa
    cinst revouninstallerpro
    cinst skype
    cinst speccy
    cinst teamviewer
    cinst thunderbird
    cinst treesizefree
    cinst utorrent
    cinst vlc
    cinst windirstat

    PowerShell PackageManagement (OneGet) - Install Apps from Command Line [​IMG]

    Above script file works but I have to answer each install as indicated in the Powershell attachment. How can I avoid this (hopefully in easy fashion)

    Rich
     
    rmonroe36, Apr 8, 2015
    #44
  15. Kari Win User
    The short answer: use OneGet in elevated PowerShell instead of Chocolatey and put all apps you want in one command in your script.

    See this short video about OneGet installing multiple apps without none whatsoever user interaction, using a few apps from your list as example. (Sorry, I was two hours without Internet connection, had to use a mobile connection so the DL in the video is painfully slow):

    [youtube]LRO9wxjijqc[/youtube]
     
Thema:

PowerShell PackageManagement (OneGet) - Install Apps from Command Line

Loading...
  1. PowerShell PackageManagement (OneGet) - Install Apps from Command Line - Similar Threads - PowerShell PackageManagement OneGet

  2. issues when trying to reinstall windows apps from Powershell command line

    in Microsoft Windows 10 Store
    issues when trying to reinstall windows apps from Powershell command line: Hi, I typed:PS C:\Users\Administrateur> Get-AppxPackage -AllUsers Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$$_.InstallLocation\AppXManifest.xml"}i got this:https://justpaste.it/65huii could not post the whole output on this forum since my message was more...
  3. issues when trying to reinstall windows apps from Powershell command line

    in Windows 10 Gaming
    issues when trying to reinstall windows apps from Powershell command line: Hi, I typed:PS C:\Users\Administrateur> Get-AppxPackage -AllUsers Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$$_.InstallLocation\AppXManifest.xml"}i got this:https://justpaste.it/65huii could not post the whole output on this forum since my message was more...
  4. issues when trying to reinstall windows apps from Powershell command line

    in Windows 10 Software and Apps
    issues when trying to reinstall windows apps from Powershell command line: Hi, I typed:PS C:\Users\Administrateur> Get-AppxPackage -AllUsers Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$$_.InstallLocation\AppXManifest.xml"}i got this:https://justpaste.it/65huii could not post the whole output on this forum since my message was more...
  5. How to turn off a SPECIFIC MONITOR from the command line or powershell?

    in Windows 10 Gaming
    How to turn off a SPECIFIC MONITOR from the command line or powershell?: How to turn off a SPECIFIC MONITOR from the command line or powershell? The following turns off ALL MONITORS... NOT what I need.powershell.exe -Command "Add-Type '[DllImport\"user32.dll\"]public static extern int SendMessageint hWnd,int hMsg,int wParam,int lParam;' -Name a...
  6. How to turn off a SPECIFIC MONITOR from the command line or powershell?

    in Windows 10 Software and Apps
    How to turn off a SPECIFIC MONITOR from the command line or powershell?: How to turn off a SPECIFIC MONITOR from the command line or powershell? The following turns off ALL MONITORS... NOT what I need.powershell.exe -Command "Add-Type '[DllImport\"user32.dll\"]public static extern int SendMessageint hWnd,int hMsg,int wParam,int lParam;' -Name a...
  7. Opening windows store apps from command line

    in Windows 10 Software and Apps
    Opening windows store apps from command line: How do I open windows store apps like Hulu from the command prompt? 44674
  8. "Reset Hub" - any command line or powershell equivalent?

    in Windows 10 Drivers and Hardware
    "Reset Hub" - any command line or powershell equivalent?: Hi experts, I have a USB device that will malfunction from time to time and I've found by pressing the 'Reset Hub' button to disable/enable the Root Hub to which this device is connected, things will go back to normal once again. [img] The thing is, I'd like to see...
  9. setting default apps from command line?

    in Windows 10 Software and Apps
    setting default apps from command line?: in win7, after installation and setting the correct file associations, the correct program would start upon double clicking in win10 however, it popups wanting you to set a ?default app?. ive seen this happen for klite codec pack, firefox, utorrent i do unattended...
  10. Capture network usage from command line or powershell?

    in Windows 10 Network and Sharing
    Capture network usage from command line or powershell?: I know you can see what applications are using how much data in a given period of time by going to Start -> Settings -> Network & Internet -> Data Usage, then clicking the Usage Details option to bring up a list. Does anyone know if there's a way to output this list at...