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; That's interesting to know! Discussion in 'Windows 10 Tutorials' started by Charlie, Oct 31, 2014.

  1. Kari Win User

    PowerShell PackageManagement (OneGet) - Install Apps from Command Line


    That's interesting to know!
     
  2. Kari Win User

    @rmonroe36, this WaitHandles bug seems to be fixed in Build 10074, at least I am no longer getting the error when installing 12 to 15 apps with one command.

    If you test it, please let me know if it works for you.
     
  3. rmonroe36 Win User
    Yes, I had experienced that bug and had me crazy for a while. Some research led me to Gpedit. I forgot the details but a policy change fixed that bug. But no need for that now - all is well with my script that you previously helped with.

    Rich
     
    rmonroe36, Jul 1, 2015
    #63
  4. Wynona Win User

    PowerShell PackageManagement (OneGet) - Install Apps from Command Line

    Well, first thing I seem to get wrong is that when I run PowerShell ISE as Admin, instead of saying PS C:\Users\myid> it gives me PS C:\WINDOWS\System 32.

    Does this make a difference?
     
    Wynona, Apr 20, 2016
    #64
  5. Kari Win User
    No, that is normal. Whenever you run an admin (elevated) Command Prompt, PowerShell or PowerShell ISE, the default working folder is C:\Windows\System32. The CD command works in PowerShell exactly as in Command promt; assuming that your user profile folder would be C:\Users\Wynona you can "jump" to it with CD C:\Users\Wynona.

    The default working folder in normal (not elevated) Command Prompt, PowerShell or PowerShell ISE is the user profile folder.

    The instructions in tutorial are valid both when using an admin or normal PowerShell, with one difference: To get the full script execution rights in admin PowerShell the cmdlet Set-ExecutionPolicy Unrestricted is enough. When doing this in normal non-elevated PowerShell, you need to tell PowerShell that the rights should be granted to current user by adding the -Scope switch with CurrentUser parameter.

    Like this:

    • Execution rights when using elevated PowerShell:
      Code: Set-ExecutionPolicy Unrestricted[/quote]
    • Execution rights when using non-elevated PowerShell:
      Code: Set-ExecutionPolicy Unrestricted -Scope CurrentUser[/quote]
     
  6. Wynona Win User
    When I type Get-Command -Module OneGet, I don't get the list of cmdlets you show. *Sad

    Should I?
     
    Wynona, Apr 20, 2016
    #66
  7. Wynona Win User
    • Execution rights when using non-elevated PowerShell:
      Code: Set-ExecutionPolicy Unrestricted -Scope CurrentUser[/quote]
    [/quote] Should I set the Execution Policy before I enter Get-Command -Module OneGet or afterwards?
     
    Wynona, Apr 20, 2016
    #67
  8. Kari Win User

    PowerShell PackageManagement (OneGet) - Install Apps from Command Line

    The tutorial was written almost a year before Windows 10 was released, in October 2014. Quite a lot have been changed, I realize I have to edit the tutorial and bring it up-to-date.

    Everything still works as told in tutorial, but there are some minor changes. One of these changes is the change of the module name: OneGet commands are now listed in module PackageManagement.

    Use Get-Command -Module PackageManagement to get list of OneGet commands.
     
  9. Wynona Win User
    Thanks! That will help a whole lot. *Smile
     
    Wynona, Apr 21, 2016
    #69
  10. Wynona Win User
    Do I need to install Chocolatey first?
     
    Wynona, Apr 21, 2016
    #70
  11. Wynona Win User
    Well, I've made a mell of a hess of things, so, what do I do now?

    Can I close everything out and start over, or do I need to delete what I've started?
     
    Wynona, Apr 21, 2016
    #71
  12. Kari Win User
    You don't have to delete anything. Yes, Chocolatey must be added with Get-PackageProvider Chocolatey before you can start installing softwware.
     
  13. Wynona Win User

    PowerShell PackageManagement (OneGet) - Install Apps from Command Line

    Thanks Kari.

    One more question . . . I've installed Chocolatey. Will that have stayed installed?

    Also, I'm pretty sure I've left unrestricted on. So I don't have to do that again?
     
    Wynona, Apr 21, 2016
    #73
  14. Wynona Win User
    Oh, and BTW, I was hoping you were asleep and I'd have to wait until tomorrow. *Smile Not that I want to wait; everyone needs to sleep every so often.
     
    Wynona, Apr 21, 2016
    #74
  15. Kari Win User
    Chocolatey only needs to be installed once.

    Your C: drive should now have a very small folder Chocolatey on root of it. The folder will always remain very small taking almost no space, containing one subfolder Lib in which you find again a subfolder for each installed package. These folders only contain about 5 KB information (library files) OneGet needed when the package was installed. You can delete everything in Lib folder but leave Lib itself and its parent folder Chocolatey intact for future need, Chocolatey needs them.

    You can always when you want to check your executionpolicy with cmdlet Get-ExecutionPolicy, and if preferred change it back to Restricted with Set-Executionpolicy Restricted.
     
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...