Skip to content

Instantly share code, notes, and snippets.

@atsvetkov
Last active January 25, 2016 21:37
Show Gist options
  • Save atsvetkov/a0e0989826f518219c27 to your computer and use it in GitHub Desktop.
Save atsvetkov/a0e0989826f518219c27 to your computer and use it in GitHub Desktop.
boxstarter scripts
cinst wixtoolset -y
cinst firefox -y
cuninst wixtoolset -y
cuninst firefox -y
# 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