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; If you are interested in the development of the PS OneGet, join today the PS OneGet usual Friday online meeting. Starting at 10 AM PST, 7 PM (19:00)... Discussion in 'Windows 10 Tutorials' started by Charlie, Oct 31, 2014.

  1. Kari Win User

    PowerShell PackageManagement (OneGet) - Install Apps from Command Line


    If you are interested in the development of the PS OneGet, join today the PS OneGet usual Friday online meeting. Starting at 10 AM PST, 7 PM (19:00) CET.

    Check @PSOneGet about 10 minutes before the meeting for the link to join.

    Tweet



    — Twitter API (@user) date
     
  2. Kari Win User

    OK, here's the meeting link:

    Tweet



    — Twitter API (@user) date
     
  3. adamf Win User
    Well you did ask and I like copy-paste *Smile Should be a "y" not a ":"
    Section 3.3 extra \
    [/quote] I was wondering if you had tried updates also. I'm not in a position to (as I only started playing with this today so there aren't any) but this looks like a problem How to automatically keep all locally installed Chocolatey Packages up to date? - Stack Overflow

    I tried uninstalling and hit an issue. Uninstall-Package works (says it does) but in the example of Adobe Reader it doesn't actually uninstall the program. According to here https://github.com/chocolatey/chocol...mandsUninstall among other things uninstall
    It might be worth noting in the tutorial (unless I've made an error) that Uninstall-Package might not actually uninstall a package in all cases. Hopefully this will improve in time. At the moment it is a pretty excellent way of installing stuff after a clean install though, thanks. I'm going to use it.

    Attachment 13275
     
    adamf, Feb 24, 2015
    #18
  4. Kari Win User

    PowerShell PackageManagement (OneGet) - Install Apps from Command Line

    Thanks @Adam, typos fixed *Smile.

    The update cmdlet, will it be included or not, it's still open. Garret, the head of OneGet team at MS asked opinions in last OneGet community meeting Friday two weeks ago, screenshot of the meeting recording shows my opinion:

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

    The uninstall function will get fixed, it is under development as we speak. I will ask about it on next community meeting day after tomorrow and update tutorial accordingly.
     
  5. Kari Win User
    My OneGet community meeting this week was cut short and no audio because of the combined forces of Lync 2013 and Win10 Build 9926. Here's the "big catch" from tonight:
    PowerShell PackageManagement (OneGet) - Install Apps from Command Line [​IMG]

    PowerShell PackageManagement (OneGet) - Install Apps from Command Line [​IMG]
    I was prepared to discuss these two IMO important modules (Update & Uninstall) more but participating in an audio - video meeting without audio and video is a bit dull so I gave up.

    Next OneGet community meeting on Friday 13th of March at 10 AM PST / 19:00 (7 PM) CET. Meeting link always about 10 minutes in advance at PowerShell OneGet (@PSOneGet) | Twitter.
     
  6. adamf Win User
    I was thinking of making a PS1 script like this for when the next build comes

    Attachment 13626

    I've made a shortcut to run this Setup.ps1 script as administrator with the target:
    Code: %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File "C:\Users\adam\OneDrive\Documents\Scripts\Setup.ps1"[/quote] but EMET still prompts for UAC (the others are silent).

    Any ideas? Is this the correct method to install lots of programs in an automated fashion or is there a better way? The -verbose flag and the final "Press Enter" prompt are only temporary to see what is happening.
     
    adamf, Mar 2, 2015
    #21
  7. Kari Win User
    You seem already have the -Force switch so that's not it. Might be that the only way to get EMET installed without the UAC is to disable UAC before the script is run, then enable it later again.

    Other than that you are doing it in a correct way. The use of Grave Accent is a visually pleasing way to divide the command structure to multiple lines, in order to make it easier to read.
     
  8. adamf Win User

    PowerShell PackageManagement (OneGet) - Install Apps from Command Line

    I got that from your tutorial actually *Smile I'm going to stick this on the end of the script and I'll be done.
    PHP Code: Enable-WindowsOptionalFeature -FeatureName `
    Microsoft-Hyper-V-All, `
    TelnetClient `
    -Online -All -NoRestart
     
    adamf, Mar 2, 2015
    #23
  9. Kari Win User
    Good addition. I think I might write a PowerShell scripting tut next, it's a powerful tool.

    BTW, one practical way to make it really automatic without UAC is to boot to Audit Mode (install Windows normally, when it arrives to "Sign in to your MS Account" page after last reboot, press CTRL+SHIFT+F3). Do your customizations in Audit Mode, including app install with OneGet, then end with sysprep /generalize /oobe /reboot /unattend:Z:\YourAnswerFile.xml

    The answer file only needs to contain the CopyProfile tags:

    Code: <?xml version="1.0" encoding="utf-8"?><unattend xmlns="urn:schemas-microsoft-com:unattend"> <settings pass="specialize"> <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <CopyProfile>true</CopyProfile> </component> </settings> <cpiPowerShell PackageManagement (OneGet) - Install Apps from Command Line :eek:fflineImage cpi:source="wim:X:\Sources\install.wim#Windows 10 Enterprise" xmlns:cpi="urn:schemas-microsoft-com:cpi" /> </unattend>[/quote] Installation picks now up where you left it with entering Audit Mode and finalizes the install. Doing it this way has two benefits: first, the apps will be installed for all users as they are copied to Default Profile, and second as the Audit Mode uses the built-in admin account there's no UAC, the rights are granted automatically whatever you install.

    Only problem is that sysprep is "broken" in build 9926 (see my warning about this), hopefully MS get it fixed in the next build.
     
  10. Kari Win User
    For those interested, the PowerShell OneGet Community Meeting starting just now:

    Tweet



    — Twitter API (@user) date
     
  11. adamf Win User
    Seems I only get to sit in the virtual lobby *Sad

    Let us know if they say anything interesting.
     
    adamf, Mar 19, 2015
    #26
  12. Kari Win User
    It was today mainly about creating own package providers. About dozen or so participants, not very much. Anyway, from a Windows user's point of view nothing special today.

    I just hope Garret would announce these meetings a bit earlier. Today the notification was "Meeting starts now!", instead of the usual 15 minutes warning *Smile. I have him and PS OneGet in TweetDeck, alarm set every Friday for 5 PM Central European time to start watching TweetDeck for meeting notifications, otherwise I would miss each and everyone.


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

    PowerShell PackageManagement (OneGet) - Install Apps from Command Line

    Can this work for windows 7 home premium?

    I have this on
    Windows Powershell
    Windows Powershell ISE
    Windows Powershell (x86)
    Windows Powershell Modules.
     
    groze, Mar 25, 2015
    #28
  14. adamf Win User
    did you try it?
     
    adamf, Mar 25, 2015
    #29
  15. groze Win User
    Nope

    Which powershell do I use?
    Windows Powershell
    Windows Powershell ISE
    Windows Powershell (x86)
    Windows Powershell Modules.
     
    groze, Mar 25, 2015
    #30
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...