Slide 1

Slide 1 text

Invoke-ChatOps ChatOps For PowerShell Users PS>Start-Presentation

Slide 2

Slide 2 text

whoami Brandon Olin Lead Systems Engineer @ Columbia Sportswear @devblackops github.com/devblackops devblackops.io PS>Get-Presenter

Slide 3

Slide 3 text

My first PowerShell script *To the best of my knowledge ls *.ps1 -recurse -file | sort lastwritetime | select -first 1 PS>Get-Script | Select-Object –First 1

Slide 4

Slide 4 text

PS>Get-Help –Name ChatOps

Slide 5

Slide 5 text

“We're taking the things we're already doing and putting them in line with the conversations we're already having” -James Fryman (StackStorm) PS>Get-Help –Name ChatOps

Slide 6

Slide 6 text

PS>Get-ChatClient #irc

Slide 7

Slide 7 text

PS>Get-BotFramework Pick your poison. There are as many bot frameworks as there are languages to build them.

Slide 8

Slide 8 text

Social Benefits PS>Get-Benefit –Type Social

Slide 9

Slide 9 text

Knowledge Sharing PS>Get-Benefit –Type Social

Slide 10

Slide 10 text

Team Empowerment PS>Get-Benefit –Type Social

Slide 11

Slide 11 text

Situational Awareness PS>Get-Benefit –Type Social

Slide 12

Slide 12 text

Faster Onboarding PS>Get-Benefit –Type Social

Slide 13

Slide 13 text

Enable Retrospectives PS>Get-Benefit –Type Social

Slide 14

Slide 14 text

Technical Benefits PS>Get-Benefit –Type Technical

Slide 15

Slide 15 text

Increased Automation PS>Get-Benefit –Type Technical

Slide 16

Slide 16 text

Reduced MTTR PS>Get-Benefit –Type Technical

Slide 17

Slide 17 text

Better History & Logging PS>Get-Benefit –Type Technical

Slide 18

Slide 18 text

Improved Safety PS>Get-Benefit –Type Technical

Slide 19

Slide 19 text

The Old and Busted PS>Get-OldWay Bob: Hey Sally, a user called me and said the server hq-frodo1 fell over again. I'm not sure what's wrong. Can you take a look? Sally: Ok, I don't know much about that server but I think John does. I'll try and track him down. 2 hours later... Sally: try now Bob: It works! What ever you did fixed it! Thanks a bunch!

Slide 20

Slide 20 text

PS>Get-OldWay

Slide 21

Slide 21 text

The New Hotness PS>Get-NewWay JoeUser: Hey Bob, we got a report that hq-frodo1 is not responding. Can you take a look? Bob: Sure, one sec. Bob: bender test-application --computer hq-frodo1 Bender: Application [MyAwesomeApp] on hq-frodo1 is not responding :( Bob: bender get-diskusage --computer hq-frodo1 Bender: hq-frodo1 disk usage: Volume Size Used Free C:\ 50GB 50GB 0GB Bob: bender clean-disk --computer hq-frodo1 Bender: Cleaned up temp files on hq-frodo1: Before: Volume Size Used Free C:\ 50GB 50GB 0GB After: Volume Size Used Free C:\ 50GB 22GB 28GB Bob: bender test-application --computer hq-frodo1 Bender: Application [MyAwesomeApp] on hq-frodo1 is responding normally :) JoeUser: Thanks Bob!

Slide 22

Slide 22 text

PS>Get-NewWay

Slide 23

Slide 23 text

So what can Bots Do? PS>Get-ChatBotScript • Restart services • Get / set /resolve Service Desk ticket • Query APIs • Modify AD group membership • Create VMs • Check status of automated processes • Get performance graphs • Query monitoring system for alerts • Deploy code / Kick off pipeline • Anything really…

Slide 24

Slide 24 text

Real World Examples PS>Get-ChatBotExample

Slide 25

Slide 25 text

Undisputed Street Fighter Champion PS>Get-ChatBot –Name Ryu

Slide 26

Slide 26 text

PS>Get-ChatBotExample

Slide 27

Slide 27 text

What About PowerShell? PS>Get-ChatBot –Type PowerShell

Slide 28

Slide 28 text

PS>Get-PoshBot PoshBot PowerShell-based bot framework • PowerShell 5 • Class-based • Modules for bot command packaging/distribution • Roll-based Access Control • Command/event/regex triggers • Multiple chat networks* github.com/poshbotio/PoshBot

Slide 29

Slide 29 text

PS>Get-PoshBotArchitecture Bot Backend Storage Plugin Manager Plugin1 Plugin2 Plugin3 Role Manager Executor

Slide 30

Slide 30 text

Useful PoshBot Plugins PS>Get-PoshBotPlugin ServiceNow • !get-tickets --last 5 • !resolve-ticket --id 12345 --message ‘I fixed all the things’ vSphere • !new-vm --dc 'MyDatacenter01' --vcpu 2 -ram 4 • !snapshot-vm --name server01 --description 'Hold my beer, I'm going to try something' --keepdays 2 CMDB • !get-cmdbinfo --name server01 Monitoring • !get-alerts --computername server01 –critical • !run-smoketest --computername server01 --test componantA

Slide 31

Slide 31 text

PS>Start-Demo

Slide 32

Slide 32 text

Brandon Olin @devblackops github.com/devblackops devblackops.io Get-Links PoshBot: https://github.com/poshbotio/PoshBot Other Interesting Projects Watchmen: https://github.com/devblackops/watchmen PSHealthZ: https://github.com/devblackops/PSHealthZ POSHOrigin: https://github.com/devblackops/POSHOrigin POSHOrigin_vSphere: https://github.com/devblackops/POSHOrigin_vSphere NetScaler: https://github.com/devblackops/NetScaler PasswordState: https://github.com/devblackops/PasswordState