<commit_before>cls

#Set-ExecutionPolicy Unrestricted

Push-Location "$PSScriptRoot\src"
. ".\bootstrap-functions.ps1"
. ".\helpers.ps1"
. ".\programs.ps1"
Pop-Location

Push-Location "$PSScriptRoot\src\modules"
Get-ChildItem | ForEach-Object { . ".\$_" }
Pop-Location

Push-Location "$PSScriptRoot\src\lib"
Get-ChildItem | ForEach-Object { . ".\$_" }
Pop-Location

Write-Title "Configure You Windows" $false
Write-Host "Because registry editing is so much fun"
Write-Host "Boxstarter Url: https://gist.github.com/Laoujin/12f5d2f76d51ee6c0a49"

$config = Combine-Configs ".\bootstrap.json" ".\bootstrap-domain.json"
$windowsConfig = ConvertFrom-JsonFile ".\src\windows.json"

Push-Location "$PSScriptRoot\config"

Write-Title "BOOTSTRAP"
Process-Modules $config.modules

if ($config.shells) {
	Write-Title "SHELLS"
	$shellConfig = Combine-Configs "shells.json" "shells-domain.json"
	Process-Modules $shellConfig.modules
	Process-Program $shellConfig.bash
	Process-Program $shellConfig.powershell
}

Write-Title "PROGRAMS"
Process-Programs $config.cinst


Write-Title "WINDOWS EXPLORER"
$explorerOptions = Get-JsonObjectKeys $config.windows.explorer.registry
foreach ($explorerOption in $explorerOptions) {
	$explorerConfig = $windowsConfig.explorer.registry.$explorerOption
	$explorerValue = $config.windows.explorer.registry.$explorerOption

	if (-not $explorerConfig) {
		Write-Error "No configuration found for $explorerOption"
	} else {

		$explorerConfig | Add-Member "value" $explorerValue
		Update-RegistryKey $explorerConfig | Write-Background
	}
}

# Desired State configuration
# https://gallery.technet.microsoft.com/scriptcenter/DSC-Resource-Kit-All-c449312d

# Interesting:
# https://gallery.technet.microsoft.com/scriptcenter/Get-RemoteProgram-Get-list-de9fd2b4

# File System Security PowerShell Module
# https://gallery.technet.microsoft.com/scriptcenter/1abd77a5-9c0b-4a2b-acef-90dbb2b84e85

# git alias: clone and enter dir
# ps: cd..... -> also in bash
# autohotkey: open and set most often used folder / open in explorer / in cmder new tab?
#(http://www.techunboxed.com/2013/09/how-to-disable-aero-shake-in-windows-8.html)
#~/.bash_aliases

# Library
# Install-Package WindowsAPICodePack-Core
# Install-Package WindowsAPICodePack-Shell
# Microsoft.WindowsAPICodePack.Shell.KnownFolders.Libraries
# http://blogs.technet.com/b/heyscriptingguy/archive/2012/11/11/weekend-scripter-working-with-windows-libraries.aspx

Stop-Process -processname explorer

# SETTINGS TO ADD<commit_msg>todo: how to include LiveWriter settings<commit_after>cls

#Set-ExecutionPolicy Unrestricted

Push-Location "$PSScriptRoot\src"
. ".\bootstrap-functions.ps1"
. ".\helpers.ps1"
. ".\programs.ps1"
Pop-Location

Push-Location "$PSScriptRoot\src\modules"
Get-ChildItem | ForEach-Object { . ".\$_" }
Pop-Location

Push-Location "$PSScriptRoot\src\lib"
Get-ChildItem | ForEach-Object { . ".\$_" }
Pop-Location

Write-Title "Configure You Windows" $false
Write-Host "Because registry editing is so much fun"
Write-Host "Boxstarter Url: https://gist.github.com/Laoujin/12f5d2f76d51ee6c0a49"

$config = Combine-Configs ".\bootstrap.json" ".\bootstrap-domain.json"
$windowsConfig = ConvertFrom-JsonFile ".\src\windows.json"

Push-Location "$PSScriptRoot\config"

Write-Title "BOOTSTRAP"
Process-Modules $config.modules

if ($config.shells) {
	Write-Title "SHELLS"
	$shellConfig = Combine-Configs "shells.json" "shells-domain.json"
	Process-Modules $shellConfig.modules
	Process-Program $shellConfig.bash
	Process-Program $shellConfig.powershell
}

Write-Title "PROGRAMS"
Process-Programs $config.cinst


Write-Title "WINDOWS EXPLORER"
$explorerOptions = Get-JsonObjectKeys $config.windows.explorer.registry
foreach ($explorerOption in $explorerOptions) {
	$explorerConfig = $windowsConfig.explorer.registry.$explorerOption
	$explorerValue = $config.windows.explorer.registry.$explorerOption

	if (-not $explorerConfig) {
		Write-Error "No configuration found for $explorerOption"
	} else {

		$explorerConfig | Add-Member "value" $explorerValue
		Update-RegistryKey $explorerConfig | Write-Background
	}
}

# http://www.hanselman.com/blog/SyncingWindowsLiveWriterDraftsToTheCloudDropboxAndOtherBugFixes.aspx
# for windows live writer

# Desired State configuration
# https://gallery.technet.microsoft.com/scriptcenter/DSC-Resource-Kit-All-c449312d

# Interesting:
# https://gallery.technet.microsoft.com/scriptcenter/Get-RemoteProgram-Get-list-de9fd2b4

# File System Security PowerShell Module
# https://gallery.technet.microsoft.com/scriptcenter/1abd77a5-9c0b-4a2b-acef-90dbb2b84e85

# git alias: clone and enter dir
# ps: cd..... -> also in bash
# autohotkey: open and set most often used folder / open in explorer / in cmder new tab?
#(http://www.techunboxed.com/2013/09/how-to-disable-aero-shake-in-windows-8.html)
#~/.bash_aliases

# Library
# Install-Package WindowsAPICodePack-Core
# Install-Package WindowsAPICodePack-Shell
# Microsoft.WindowsAPICodePack.Shell.KnownFolders.Libraries
# http://blogs.technet.com/b/heyscriptingguy/archive/2012/11/11/weekend-scripter-working-with-windows-libraries.aspx

Stop-Process -processname explorer

# SETTINGS TO ADD
{'fraction_non_alphanumeric': 0.12672229769066562, 'fraction_numerical': 0.020958664855424025, 'mean_word_length': 5.085005903187722, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 8, 'lorem ipsum': 0, 'www.': 3, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '51731', 'n_tokens_mistral': 1851, 'n_tokens_neox': 1747, 'n_words': 311}