How to Automate a Process with PowerShell

by Rob Richardson



About Me

Rob Richardson

Rob Richardson is a software craftsman building web properties in ASP.NET and Node, React and Vue. He's a frequent speaker at conferences, user groups, and community events, and a diligent teacher and student of high quality software development. You can find this and other talks on https://robrich.org/presentations and follow him on twitter at @rob_rich.

Why PowerShell?

PowerShell vs Batch Files

PowerShell vs Bash

PowerShell aliases

see also https://linuxhint.com/powershell-bash-shell-scripting/


Running commands from Powershell prompt

The Executable

... they function the same

Powershell Commands

Let's build it

Recursively count the number of files in the directory

Let's build it

Change a token in a text file

Let's build it

Download weather forecast for location

Level-up with PowerShell

Let's build it

Parse report:

  • copy report from file share
  • print sum of column 8
  • print line count
  • error if file not found

Let's build it

DevOps build:

  • git checkout latest
  • docker build & push
  • start on kubernetes

What do you want to automate

with PowerShell scripts?