Windows 10 Device Setup
One time-consuming ‘chore’ I have seen when moving from one job to the other (or just from one device to another device in the same job) is setting up a server or your own developer machine. Whether the machine is Windows 10, a version of Linux, or some other OS, there are ways to minimize this setup burden. In my current job, we get a new Windows server that needs to be setup probably once every two or three months. Manually spending the time to install all the drivers and programs that are needed gets tedious and time consuming.
There must be a better way!
Introducing a Windows 10 Basic Programs Installation Script
Take a look at my Github, specifically at https://github.com/tscott8706/win10devicesetup/
This script runs in an administrative PowerShell. Before it is run, you will need to allow PowerShell scripts to be run on your device. You can do this for just your existing PowerShell session by running the following:
Set-ExecutionPolicy Bypass -Scope Process
The script enables some optional Windows Features (such as Windows Containers, Hypervisor, and Bash Subsystem for Windows). It then installs several Windows programs (only if they are not already installed) using a Windows package manager called Chocolatey. Some of the programs in that script include Git, TortoiseSVN, Notepad++, and quite a few others.
You will probably want to install different programs or enable different Windows 10 features. It should not be too difficult for one to modify this script to meet different requirements. If you have to setup multiple servers/computers, or you just want your coworkers to have a standard set of tools or features (both my desire when I wrote this script), you should be able to modify this script to your needs.
While it is nice to have a standard set of tools, one of the biggest focuses I have for this script is to be able to run Docker as soon as possible once given a new machine. The old process (and the one I am trying to move us away from) is this:
- Get a new server (currently Windows 7, but I’m pushing to get it to Windows 10 for Windows containers support).
- Install several drivers needed to operate different devices connected to that server.
- Install tools and programs on that server such as Notepad++, an FTP server, and an SSH server.
This process takes some time, and it is not always consistent. If a problem occurs, is it the equipment that we have connected to the server, or is it a problem with the drivers or software? We do not know because the environment is not consistent.
Now suppose the process is the following:
- Use this script so that a few tools get installed on the new server… especially Docker.
- Pull a Windows Docker container that has our software framework within it (and probably in another container, all the drivers are installed).
- Run the Docker containers using docker-compose.
This process that once used to take at best a couple of hours, but at worst several days, would now be changed to take most likely an hour worst-case scenario. And it would be consistent. If something did not work, it is very likely a hardware issue. The software and entire environment are the same.
In addition, we can do automated builds in the future. Each time we make a change to software, it could automatically deploy on the server.
Hopefully this script, or at least these ideas, can help setup your own Windows 10 device. Best of luck!