PowerShell PackageManagement (OneGet) - Install Apps from Command Line
-
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: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 https://twitter.com/PSOneGet.
Kari
-
-
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"
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.
-
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.
-
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.
I got that from your tutorial actually :) 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
-
-
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>
<cpi:offlineImage cpi:source="wim:X:\Sources\install.wim#Windows 10 Enterprise" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>
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.
Kari
-
For those interested, the PowerShell OneGet Community Meeting starting just now:
-
For those interested, the PowerShell OneGet Community Meeting starting just now:
Seems I only get to sit in the virtual lobby 
Let us know if they say anything interesting.
-
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 :). 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.
-
Can this work for windows 7 home premium?
I have this on
Windows Powershell
Windows Powershell ISE
Windows Powershell (x86)
Windows Powershell Modules.
-
-
Can this work for windows 7 home premium?
I have this on
Windows Powershell
Windows Powershell ISE
Windows Powershell (x86)
Windows Powershell Modules.
did you try it?
Tutorial Categories