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

Page 7 of 14 FirstFirst ... 56789 ... LastLast

  1. Posts : 256
    Windows 10 & Windows 10 Insider Program, Linux Mint 18, Zorin, elementary OS
       20 Apr 2015 #60

    rmonroe36 said: View Post
    Thanks very much for your testing and help. I'll keep watch for further developments.

    Rich
    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
    }
      My System SpecsSystem Spec

  2. Kari's Avatar
    Posts : 10,605
    Windows 10 Pro
       20 Apr 2015 #61

    That's interesting to know!
      My System SpecsSystem Spec

  3. Kari's Avatar
    Posts : 10,605
    Windows 10 Pro
       30 Apr 2015 #62

    @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.
      My System SpecsSystem Spec

  4. Kari's Avatar
    Posts : 10,605
    Windows 10 Pro
       02 Jul 2015 #63

    Note   Note
    There were a bug in PowerShell in last builds making changing the script execution policy impossible, therefore the OneGet did not work properly.

    The bug was fixed in Build 10158 and OneGet works again exactly as told in this tutorial.

    Kari
      My System SpecsSystem Spec


  5. Posts : 256
    Windows 10 & Windows 10 Insider Program, Linux Mint 18, Zorin, elementary OS
       02 Jul 2015 #64

    Kari said: View Post
    Note   Note
    There were a bug in PowerShell in last builds making changing the script execution policy impossible, therefore the OneGet did not work properly.

    The bug was fixed in Build 10158 and OneGet works again exactly as told in this tutorial.
    Kari
    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
      My System SpecsSystem Spec

  6. Wynona's Avatar
    Posts : 12,416
    Windows 10 Insider Preview
       21 Apr 2016 #65

    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?
      My System SpecsSystem Spec

  7. Kari's Avatar
    Posts : 10,605
    Windows 10 Pro
       21 Apr 2016 #66

    Wynona said: View Post
    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?
    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
    • Execution rights when using non-elevated PowerShell:
      Code:
      Set-ExecutionPolicy Unrestricted -Scope CurrentUser
      My System SpecsSystem Spec

  8. Wynona's Avatar
    Posts : 12,416
    Windows 10 Insider Preview
       21 Apr 2016 #67

    When I type Get-Command -Module OneGet, I don't get the list of cmdlets you show.

    Should I?
      My System SpecsSystem Spec

  9. Wynona's Avatar
    Posts : 12,416
    Windows 10 Insider Preview
       21 Apr 2016 #68

    Kari said: View Post
    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
    • Execution rights when using non-elevated PowerShell:
      Code:
      Set-ExecutionPolicy Unrestricted -Scope CurrentUser
    Should I set the Execution Policy before I enter Get-Command -Module OneGet or afterwards?
      My System SpecsSystem Spec

  10. Kari's Avatar
    Posts : 10,605
    Windows 10 Pro
       21 Apr 2016 #69

    Wynona said: View Post
    Should I set the Execution Policy before I enter Get-Command -Module OneGet or afterwards?
    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.
      My System SpecsSystem Spec


 
Page 7 of 14 FirstFirst ... 56789 ... LastLast

Related Threads
Hi all I have several network connections configured. There is one wifi connection which automatically connects to my WLAN, another cable based LAN connection to a NAS which is used for backups and some L2TP connection connections (used...
:really:I have a few PCs connected via a bridge on an ethernet LAN. They communicate with each other, not "the internet". I'd like to rename "Unidentified network" to something more reasonable like "DoNotTreadOnMe" (allegorical.) 76590
How do I open windows store apps like Hulu from the command prompt?
For some unknown reason I cannot any more navigate to Update panel from "Einstellungen" - it is blocked. I have to cancel the "Einstellungen" window by the task manager ! So in this moment I cant go forward nor backward any more: cant...
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,...
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 04:44.
Find Us
Twitter Facebook Google+ Ten Forums iOS App Ten Forums Android App



Windows 10 Forums