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; 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... Discussion in 'Windows 10 Tutorials' started by Charlie, Oct 31, 2014.

  1. rmonroe36 Win User

    PowerShell PackageManagement (OneGet) - Install Apps from Command Line


    Kari,
    Thanks so much for your quick reply - no apology necessary. I appreciate your many informative posts, especially your tutorials. Guess I was trying to be too "fancy" when just a (powerful) one-liner was all that was needed.

    Rich
     
    rmonroe36, Apr 9, 2015
    #46
  2. badrobot Win User

    Got the time to do this last night but earlier in the process, I bumped into a road block. Same result for both 10049 and leaked 10056. I was logged in on MS account on 10049 but that didn't help.


    PowerShell PackageManagement (OneGet) - Install Apps from Command Line [​IMG]
     
    badrobot, Apr 10, 2015
    #47
  3. Kari Win User
    You have not installed Chocolatey repositories?

    Do this, list numbers referring to screenshot below:
    • Check that you have Unrestricted script execution policy, cmdlet is Get-Executionpolicy. If not use Set-Executionpolicy Unrestricted to change it if working on an elevated PS, or Set-Executionpolicy Unrestricted -Scope CurrentUser if working with non-elevated PS
    • Add Chocolatey provider with Get-PackageProvider Chocolatey, accept it by clicking Yes in dialog which will be shown
    • Check that Chocolatey and NuGet providers were added (adding Chocolatey automatically adds NuGet)
    • Now you should be able to see all package sources

    PowerShell PackageManagement (OneGet) - Install Apps from Command Line [​IMG]
     
  4. adamf Win User

    PowerShell PackageManagement (OneGet) - Install Apps from Command Line

    Or just this and run as Admin..

    Code: # Install Programs Get-Packageprovider Chocolatey Install-Package ` emet, ` skype, ` 7zip, ` AdobeReader, ` notepadplusplus, ` virtualbox, ` treesizefree, ` ccleaner, ` speccy, ` google-chrome-x64 ` -force[/quote]
     
    adamf, Apr 10, 2015
    #49
  5. badrobot Win User
    I was following the tut and chocolatey is suppose to come later in the process. I will give it another go tonight. Will let you know. Thanks!
     
    badrobot, Apr 10, 2015
    #50
  6. Kari Win User
    That must mean that I have explained things in tutorial in wrong order, will fix it tonight when finished with what I am doing now. Thanks for pointing that out.

    On a lighter note, I know you have been thinking that I am perfect but as you can see, although as perfect as possible for a human being, even I make mistakes *Wink. This now is the fifth mistake I have made, the four first ones being my ex-wives.
     
  7. badrobot Win User
    Hahaha... good one Kari....
    I never made that mistake with my wife. It took us 8 years before we decided to get married despite her parents' disapproval. I had plenty of time to decide. *Smile

    Anyway, I got stuck in Part 2. Chocolatey is Part 3. *Smile
     
    badrobot, Apr 10, 2015
    #52
  8. Kari Win User

    PowerShell PackageManagement (OneGet) - Install Apps from Command Line

    It was not a joke...

    I was 22 when I divorced first time, our kids being then 2 years the older son and 6 months the younger son. You have to start early to learn how to do it!

    I'm from Finland, we count as 1, 3, 2, 4, 5, and so on.
     
  9. Kari Win User
    @badrobot, once more thanks for pointing out an error in the tutorial. I have now edited the step 2.3 by adding a note:

    Anyway, did you get OneGet working?
     
  10. badrobot Win User
    You're welcome Kari. I didn't get the chance to do it again yet. But I will definitely get back to it. Will let you know.

    EDIT
    @Kari ,

    Yeah, I got OneGet to work but some packages were not found like putty, handbrake, etc. But basically I got it to work. I just need to find the right packages that work.


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


    Thanks for your assistance. Much appreciated.
    Thanks for the rep, too! *Smile
     
    badrobot, Apr 11, 2015
    #55
  11. rmonroe36 Win User
    PowerShell PackageManagement (OneGet) - Install Apps from Command Line [​IMG]
    If I try Find-Package with 10-12 packages I get the following as indicated in attachment. If I reduce the number of package items to 7-8, no errors and then I can install those items. Any work arounds or am I stuck with just installing fewer packages at a time?

    Rich
     
    rmonroe36, Apr 14, 2015
    #56
  12. Kari Win User
    That is a very rare error message, I have ever only seen it before when trying to use PowerShell to run a set of commands on several virtual machines running on a VMWare vSphere ESXi host. I will set up a test machine later tonight and test this further.

    Only help I can find from the Internet involves some coding. I will take this up in the next OneGet community meeting, in the mean time please do not install more than 8 apps at the time, if this amount can be installed without an error as you mentioned.
     
  13. Kari Win User

    PowerShell PackageManagement (OneGet) - Install Apps from Command Line

    @Rich, I tested it on a test rig. I get the Find-Package and Install-Package commands to work with 10 apps, the 11th causes the WaitHandler error.


    PowerShell PackageManagement (OneGet) - Install Apps from Command Line [​IMG]
     
  14. rmonroe36 Win User
    Thanks very much for your testing and help. I'll keep watch for further developments.

    Rich
     
    rmonroe36, Apr 15, 2015
    #59
  15. rmonroe36 Win User
    Kari,
    Tried my hand with a short script and different approach and was successful. This is what I did:
    <#
    # $MyPackages is array of packages to be installed
    #>


    $MyPackages = "audacity", "ccleaner", "cdburnerxp", "classic-shell", "defraggler", "everything", "firefox -RequiredVersion 37.0.1", "googleearth", "opera-beta", "lastpass", "malwarebytes", "picasa", "revouninstallerpro", "skype", "speccy", "teamviewer","thunderbird", "treesizefree", "utorrent", "vlc", "windirstat"


    foreach ($item in $MyPackages)
    {$item
    Install-Package $item -WhatIf
    }
     
    rmonroe36, Apr 20, 2015
    #60
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...