Last active
January 25, 2016 21:37
-
-
Save atsvetkov/a0e0989826f518219c27 to your computer and use it in GitHub Desktop.
boxstarter scripts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cinst wixtoolset -y | |
cinst firefox -y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cuninst wixtoolset -y | |
cuninst firefox -y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Boxstarter options | |
$Boxstarter.RebootOk = $true | |
$Boxstarter.NoPassword = $false | |
$Boxstarter.AutoLogin = $true | |
# Basic setup | |
Update-ExecutionPolicy Unrestricted | |
#Set-ExplorerOptions -showHidenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions | |
#Disable-UAC | |
#Set-TaskbarSmall | |
function Enable-WindowsFeature($featureName) | |
{ | |
Write-Host "Enabling $featureName" | |
$feature = Get-WindowsOptionalFeature -Online -FeatureName $featureName | |
$isDisabled = $feature.State -eq "Disabled" -or $feature.State -eq "DisablePending" | |
if ($isDisabled) | |
{ | |
Enable-WindowsOptionalFeature -All -Online -FeatureName $featureName -NoRestart | |
} | |
$isDisabled | |
} | |
function Configure-WindowsFeatures() | |
{ | |
Write-Host "Turn on windows features" | |
$features = @( | |
"Web-Server" | |
) | |
foreach ($featureName in $features) | |
{ | |
Enable-WindowsFeature $featureName | |
} | |
} | |
function Install-Software | |
{ | |
$applications = @( | |
"notepadplusplus" | |
) | |
# install chocolatey if necessary | |
if (-not (Test-Path "C:\ProgramData\chocolatey")) | |
{ | |
Write-Host 'Installing chocolatey...' | |
iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')) | |
} | |
foreach ($app in $applications) | |
{ | |
Write-Host 'Installing package ' $app | |
& choco install -y $app | |
} | |
} | |
Install-Software | |
Configure-WindowsFeatures |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment