Contents
The morning workday routine for me usually involved freshly brewed coffee and the click-click-click to start Visual Studio, Docker, SQL Server, Outlook…. It was very easy to miss one of those clicks, leading to, for example, wasted minutes waiting for a localhost website to start up but only getting a spinning circle and then eventually a yellow screen of death complaingin that the database cannot be connected to.
Now, mornings 2.0 have been scripted!
The following are the contents of my powershell file, LetTheWorkBegin.ps1:
Start-Process -FilePath "C:\Program Files\Docker\Docker\Docker Desktop.exe"
Start-Process -FilePath "C:\Program Files (x86)\WatchGuard\WatchGuard Mobile VPN with SSL\wgsslvpnc.exe"
Start-Process -FilePath "C:\Program Files\Microsoft Office\root\Office16\OUTLOOK.EXE"
Start-Process -FilePath "C:\Paul\Work\CurrentProject\CurrentProject.sln"
git -C C:\Paul\Work\CurrentProject\ fetch
Start-Sleep -s 30
docker start SQL1
Start-Sleep -s 5
Start-Process -FilePath "Ssms.exe" -WorkingDirectory "C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\" -ArgumentList "-S 127.0.0.1 -d ProjectDatabase -U sa -nosplash"
I fire up Windows Terminal, drag the desktop link to LetTheWorkBegin.ps1 onto the terminal window, and I’m ready to go.
- I start with the slowest kid on the block, Docker Desktop
- VPN app for tunnelling into the corporate network and Outlook are next
- The VS solution project I am currently working on is started and a call to fetch the latest updates from the Git repo
- The two delays are based on my experience on the time needed for the preceeding action to complete
- Start the SQL Docker container.
- Start SQL Studio and connect to the project’s database