Version: 1.1
Powershell script which simplifies PC installation which primarily target devs but everyone can use it. Installs apps via chocolatey, nodejs and executes other specific commands.
It has a base configuration file config.base.json
which can be extended/overwritten by a profile configuration config.home.json
.
Generally you should clone repo before formatting or you can download as zip file.
- Run
git clone https://github.com/sketch7/machine-setup.git
- Powershell 5.0+
- Run
pre-requisites.ps1
- If you have powershell issues run this command in PS as Administrator:
Set-ExecutionPolicy RemoteSigned
.
- If you have powershell issues run this command in PS as Administrator:
- Update
config.base.json
- Create/Update any profile configuration. example:
config.home.json
.- At least one profile is required!
- I've provided my configurations which I've used for my home/work pc installations.
- Make Sure you are running powershell as
Administrator
. - Right click on
machine-setup.ps1
and selectRun With Powershell
.
Enjoy :)
The below process is assuming that you have set ignore: false
and install: true
in your config.json
files.
- Set PS Gallery as Trusted
- Chocolatey install
- NodeJs install
- Set GlobalSettings
- otherCommands - PreCommands executions
*** Restart PC (first time) ***
- Chocolatey install packages
*** Restart PC (second time) ***
- NodeJs install packages
- otherCommands - PreCommands executions
Name | Type | Default | Description |
---|---|---|---|
setPSGalleryAsTrusted | boolean | false | Set Powershell Gallery as 'Trusted'. |
restartRequired | boolean | false | Restart your computer (first time). |
chocolatey | object | - | Chocolatey section (refer to: chocolatey configuration). |
NodeJs | object | - | Node section (refer to: nodejs configuration). |
otherCommands | object | - | otherCommands section (refer to: otherCommands configuration). |
Name | Type | Default | Description | Example |
---|---|---|---|---|
ignore | boolean | false | This will skip the whole section. | - |
install | boolean | false | Install chocolatey on your machine. | - |
commandName | string | - | Execution command name. | "choco" |
prefix | string | - | Execution command prefixes. | "install -y" |
restartRequired | boolean | false | Restart your computer (second time). | - |
packages | string[] | [] | Package names to be installed. | ["googlechrome", "yarn"] |
skipPackages | string[] | [] | Skip any packages that match. | ["yarn"] |
Name | Type | Default | Description | Example |
---|---|---|---|---|
ignore | boolean | false | This will skip the whole section. | - |
install | boolean | false | Install NodeJs on your machine. | - |
commandName | string | - | Execution command name. | "npm" |
prefix | string | - | Execution command prefixes. | "install -g" |
setGlobalSettings | boolean | false | Set Global Settings. | - |
packages | string[] | [] | Package names to be installed. | ["typescript", "gulp"] |
skipPackages | string[] | [] | Skip any packages that match. | ["gulp"] |
Name | Type | Default | Description | Example |
---|---|---|---|---|
ignore | boolean | false | This will skip the whole section. | - |
install | boolean | false | Allow preCommands to execute. | - |
preCommands | object[] | [] | Commands to be executed. | [{ "dotnet-install": "choco install dotnet4.6 -y" }] |
skipPreCommands | string[] | [] | PreCommands Names to be skipped. | ["dotnet-install"] |
postCommands | object[] | [] | Commands to be executed. | [{ "npm-pull": "npm pull" }, { "npm-install": "npm install" }] |
skipPostCommands | string[] | [] | PostCommands Names to be skipped. | ["npm-install"] |