-
Notifications
You must be signed in to change notification settings - Fork 0
/
WorkstationSetupDefinitions.ps1
125 lines (70 loc) · 2.93 KB
/
WorkstationSetupDefinitions.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
Write-Host ---------------------------------------------------------------------------
Write-Host --------------------------- Definition ------------- Loading --------------
Write-Host ---------------------------------------------------------------------------
function Get_The_Machine_Ready()
{
#install Chocolatey
#iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
#ensure that the top level directories for apps and configs are on disk
cd c:\
$directoriesToCreate = "dev-apps", "dev-scripts", "dev-source", "dev-demos", "dev-temp"
$directoriesToCreate | % { Write-Host "Creating $_"}
$directoriesToCreate | % { New-Item -ItemType Directory -Name $_ -ErrorAction Continue }
}
function Git_Install_and_Setup
{
Write-Host "Installing Git"
choco -y install git
Write-host "Configuring Git"
git config --global user.name "Frison Alexander"
git config --global user.email "fri.b.alex@gmail.com"
#TODO: grab ssh key from github account
# github for windows looks like a better way
}
function Vim_and_Plugins_Install{
cd c:\dev-apps
mkdir Vim
cd Vim
git clone https://github.com/frialex/vim_custom.git
#Fetch Neovim AND vim cream .. sometimes neovim acts strange on a networked file
}
#install Visual studio, plugins, and fonts (Fira Code)
function AutoHotkey_and_Scripts_Install
{
#TODO: Need a solid link to ahkscript to get autohotkey executable
cd c:\dev-apps
mkdir keyboard
cd keyboard
$ahkScriptRoot = "$pwd/ahk/ModeBasedInput"
write-host "cloning ahk config into $pwd"
git clone https://github.com/frialex/ahk.git
$outputzipFilePath = "$pwd/ahk.zip"
write-host "Download ahk.zip into $outputzipFilePath"
Invoke-WebRequest "https://autohotkey.com/download/ahk.zip" -OutFile ahk.zip
$zipExtractionPath = "$pwd/vendor"
write-host "Extracting ahk.zip into $zipExtractionPath"
Add-Type -AssemblyName "System.IO.Compression.FileSystem"
[IO.Compression.ZipFile]::ExtractToDirectory($outputzipFilePath, $zipExtractionPath)
$ahkDotExe = "$zipExtractionPath/AutoHotkeyU64.exe"
$script = "$ahkScriptRoot/main.ahk"
write-host "Running ahk with custom script (With &)"
#have to cd in to dir with scripts so ahk can find the scripts dependencies
cd $ahkScriptRoot
& $ahkDotExe $script
}
function Powershell_setup
{
#create a profile
#bring down custom modules
#install powershell community extensions
}
function Change_Capital_To_ControlKey
{
#:)
#https://superuser.com/a/997448/148077
Write-Host "Changing Capital Key to Control"
$hexified = "00,00,00,00,00,00,00,00,02,00,00,00,1d,00,3a,00,00,00,00,00".Split(',') | % { "0x$_"};
$kbLayout = 'HKLM:\System\CurrentControlSet\Control\Keyboard Layout';
New-ItemProperty -Path $kbLayout -Name "Scancode Map" -PropertyType Binary -Value ([byte[]]$hexified);
}