-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMcWindowsProvisioningScript.ps1
66 lines (45 loc) · 1.85 KB
/
McWindowsProvisioningScript.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#Instructions - Paste the following into IE:
#http://boxstarter.org/package/nr/url?https://raw.githubusercontent.com/mckayc/McWindows/master/McWindowsProvisioningScript.ps1
Set-WindowsExplorerOptions -EnableShowProtectedOSFiles -EnableShowFileExtensions
Enable-RemoteDesktop
Set-StartScreenOptions -EnableBootToDesktop
# Install Core
cinst chocolatey -y
cinst chocolateygui -y
# User Specified Variables
$repository = "https://raw.githubusercontent.com/mckayc/McWindows/master/McChocolateyList.txt"
# Questions for user setup
$displaySummary = Read-Host "Would you like to display the Summary of each package? (this takes longer to load package names) y / (blank)"
# Pre-set variables - do not change
$tempFolder = $env:TEMP
$txtFile = "$tempFolder\repository.txt"
$acceptedPackages = @()
# Download file and set as hashtable
Invoke-WebRequest -Uri $repository -OutFile $txtFile
$imported = Get-Content -raw $txtFile | ConvertFrom-StringData
$packageList = $imported
# Messaging for basic instructions
Write-Host "If you would like to install the listed package, please enter 'y'; otherwise leave blank."
Write-Output " "
Write-Output " "
# Sort by package then by category
$packageList = $packageList.GetEnumerator() | sort -Property Value, Name
foreach ($package in $packageList) {
$packageName = $package.name
$packageCategory = $package.value
if ($displaySummary -eq "y")
{
Write-Output "`r"
choco info $package.name | Select-String -Pattern 'Title'
choco info $package.name | Select-String -Pattern 'Summary'
}
$confimation = Read-Host "$packageCategory - $packageName"
if ($confimation -eq "y")
{
$acceptedPackages += $package
}
}
foreach ($acceptedPackage in $acceptedPackages) {
Write-Output "Installing the package " $acceptedPackage.name
choco install $acceptedPackage.name -y
}