SlideShare a Scribd company logo
Mastering PowerShell
To Call RESTful API Endpoints
Who is @ChrisWahl?
VMware Certified Design Expert (VCDX) #104
Data Center Virtualization (DCV)
Network Virtualization (NV)
3
Technical Blog
WahlNetwork.com
Networking for VMware
Administrators
Over 30 hours of video training
Pluralsight.com
Datanauts – Busting IT Silos
DatanautsPodcast.com
Internet Resources
Networking for
VMware
Administrators
100% of royalties are being
donated to the Alzheimer’s
Association
5
Can I Get The Deck?
Yes. Yes you can.
7
Why should you care?
8
Why Should You Care?
9
Rise of the generalist!
Why Should You Care?
10
Make disparate systems
work together (fun)
Why Should You Care?
11
Feed your hungry
orchestration engines
Why Should You Care?
12
Make buckets of cash
Why Should You Care?
13
It’s really easy to learn
Why Should You Care?
14
The ecosystem has done
most of the work
Why Should You Care?
15
But, most of all …
16
VMUG - Mastering PowerShell to Call RESTful API Endpoints
18
The first step!
19
PowerShell Version 4
… or better
20
The second step!
 Console
 The command line interface
 Microsoft.PowerShell_profile.ps1
 ISE
 Integrated Scripting Environment
 Microsoft.PowerShellISE_profile.ps1
 Console + ISE
 profile.ps1
Profiles make life easier and happier
Set up your profile
 Current User:
%USERPROFILE%DocumentsWindowsPowerShell
 All Users:
%WINDIR%System32WindowsPowerShellv1.0
Profiles make life easier and happier
Drop in your profile
Set-ExecutionPolicy Bypass
Set-Location C:DropboxCode
if ($psISE)
{
Start-Steroids
Clear-Host
Write-Host 'BEAST MODE (╯°□°)╯︵ ┻━┻'
}
Write yourself fun messages
Self motivation for the win!
Set-ExecutionPolicy Bypass
Set-Location C:DropboxCode
if ($psISE)
{
Start-Steroids
Clear-Host
Write-Host 'BEAST MODE (╯°□°)╯︵ ┻━┻'
}
Write yourself fun messages
Self motivation for the win!
25
The third step!
VMUG - Mastering PowerShell to Call RESTful API Endpoints
27
Everyone who knows
something today…
Didn’t know it yesterday
28
Let’s dig into the code
Cmdlets for Calling a RESTful API
• Invoke-WebRequest
– Returns the entire response
– Status, headers, body content, etc.
• Invoke-RestMethod
– Returns only the content from the response
29
Endpoints (and Resources)
• Endpoints are expressed as URIs
– Uniform Resource Identifier
– Example endpoint: https://the.device.url/system/version
– Used to access a resource
• Should be published somewhere
– If not, harass the vendor 
30
31
Methods
• Actions taken upon a resource
– GET
– PUT
– POST
– DELETE
– PATCH
32
Methods
• Actions taken upon a resource
– GET data from a resource
– PUT to create resources
– POST to update a resource
– DELETE to remove a resource
– PATCH to update parts of a resource
33
Authentication
• Verify your identity
– Basic auth (fairly common)
– Oauth
– Oauth2
34
Authentication
• Did you know?
– Basic auth uses Base64 encoding + SSL
– Encoding = reversible
– Thus, name and password are plain text
• Encryption is provided by SSL
– SSL is “optional” but … it really isn’t
– Don’t call endpoints with HTTP!
35
Sample Basic Auth Code for PowerShell
$auth =
[System.Convert]::ToBase64String([System.Text.Encoding]:
:UTF8.GetBytes($Username + “:” + $Password))
$header =
@{“Authorization”=“Basic $auth”}
36
37
Cmdlet Format / Usage
38
Invoke-WebRequest `
-Uri something.urlvmlist `
-Method Get `
-Headers $header
Cmdlet
39
Invoke-WebRequest `
-Uri something.urlvmlist `
-Method Get `
-Headers $header
Resource /
Endpoint
40
Invoke-WebRequest `
-Uri something.urlvmlist `
-Method Get `
-Headers $header
Method
41
Invoke-WebRequest `
-Uri something.urlvmlist `
-Method Get `
-Headers $headerAuthentication
VMUG - Mastering PowerShell to Call RESTful API Endpoints
VMUG - Mastering PowerShell to Call RESTful API Endpoints
VMUG - Mastering PowerShell to Call RESTful API Endpoints
45
46
47
What can I do with this?
Protecting Applications with Rubrik
48
Imperative Declarative
VMUG - Mastering PowerShell to Call RESTful API Endpoints
50
Policy{SLA
51
Recovery Point Objective (RPO)
Availability Duration (Retention)
When to Archive (RTO)
Replication Schedule (DR)
{SLA
52
Associate Policy to vSphere Objects
53
vCenter Server
VM VM VM VM
VM VM VM VM
Silver SLA
Gold SLA
Bronze SLA
54
End-to-End Data Management
Primary Data Center
DR Site/Offsite
VM VM
VM VM
VM
VM
Hypervisor
Production Servers
SAN
VM VM
VM VM
VM
VM
Hypervisor
DR Servers
Rubrik
Backup Software + Dedupe Storage
Rubrik
Replication & DR
Offsite + Long Term Archive
55
Free Code as Examples
Community PowerShell Module
GitHub PowerShell-Module Repository
– https://github.com/rubrikinc/PowerShell-Module
PowerShell Gallery (NuGet)
– https://www.powershellgallery.com/packages/Rubrik
– Install-Module -Name Rubrik
56
vRealize Orchestrator (vRO) Package
GitHub vRO-Workflow Repository
– https://github.com/rubrikinc/vRO-Workflow
– Visit the Wiki for a full walkthrough!
57
Thank You
@ChrisWahl
chris.wahl@rubrik.com
58

More Related Content

What's hot (20)

PDF
Carlos Conde : AWS Game Days - TIAD Paris
The Incredible Automation Day
 
PDF
CMS Tools for Developers- Owen Harris
WordCamp New Zealand
 
PPTX
Event Sourcing your AngularJS applications
Maurice De Beijer [MVP]
 
PDF
TIAD : Automating the modern datacenter
The Incredible Automation Day
 
PDF
Kubernetes security and you
Karthik Gaekwad
 
PPTX
How to Build Your First Web App in Go
All Things Open
 
PDF
Liz Quilty – Security, Scaling & High End Hosting for WordPress sites
WordCamp New Zealand
 
PPTX
Azure virtual machine-network
Thi Nguyen Dinh
 
PDF
Docker open manage_meetup_sep_2016
Jose De La Rosa
 
PDF
Delivery Pipeline for Windows Machines
Dmitry Buzdin
 
PPTX
Distributed automation sel_conf_2015
aragavan
 
PDF
Securing your Cloud Environment
ShapeBlue
 
PPTX
Hashicorp Vault ppt
Shrey Agarwal
 
PDF
DCSF19 Containerized Databases for Enterprise Applications
Docker, Inc.
 
PDF
Neil Saunders (Beamly) - Securing your AWS Infrastructure with Hashicorp Vault
Outlyer
 
PDF
Vault
dawnlua
 
PDF
DockerCon EU 2015: Monitoring Docker
Docker, Inc.
 
PPTX
How to work with Selenium Grid and Cloud Solutions
Noam Zakai
 
PPTX
Industrialization, be fast be furious!
Patrick Morin
 
PDF
SF DevOps: Introducing Vagrant
Mitchell Hashimoto
 
Carlos Conde : AWS Game Days - TIAD Paris
The Incredible Automation Day
 
CMS Tools for Developers- Owen Harris
WordCamp New Zealand
 
Event Sourcing your AngularJS applications
Maurice De Beijer [MVP]
 
TIAD : Automating the modern datacenter
The Incredible Automation Day
 
Kubernetes security and you
Karthik Gaekwad
 
How to Build Your First Web App in Go
All Things Open
 
Liz Quilty – Security, Scaling & High End Hosting for WordPress sites
WordCamp New Zealand
 
Azure virtual machine-network
Thi Nguyen Dinh
 
Docker open manage_meetup_sep_2016
Jose De La Rosa
 
Delivery Pipeline for Windows Machines
Dmitry Buzdin
 
Distributed automation sel_conf_2015
aragavan
 
Securing your Cloud Environment
ShapeBlue
 
Hashicorp Vault ppt
Shrey Agarwal
 
DCSF19 Containerized Databases for Enterprise Applications
Docker, Inc.
 
Neil Saunders (Beamly) - Securing your AWS Infrastructure with Hashicorp Vault
Outlyer
 
Vault
dawnlua
 
DockerCon EU 2015: Monitoring Docker
Docker, Inc.
 
How to work with Selenium Grid and Cloud Solutions
Noam Zakai
 
Industrialization, be fast be furious!
Patrick Morin
 
SF DevOps: Introducing Vagrant
Mitchell Hashimoto
 

Viewers also liked (16)

PDF
VMUG - Learning to Learn - Experiences and Tips for Certifications and Tech S...
Chris Wahl
 
PDF
VMUG - My Journey to Full Stack Engineering
Chris Wahl
 
PPTX
VMworld - vSphere Distributed Switch 6.0 Technical Deep Dive
Chris Wahl
 
PDF
VMUG - Community - Two Sides of the Same Coin
Chris Wahl
 
PDF
VMUG - Picking Up New Skills - Tips and Tricks to Build Your Technical Tool C...
Chris Wahl
 
PDF
A No-Nonsense Approach to Hyperconvergence
Chris Wahl
 
ODP
An Introduction to Windows PowerShell
Dale Lane
 
PPTX
Wsv406 Advanced Automation Using Windows Power Shell2.0
jsnover1
 
PPTX
Wsv315 Windows Power Shell For Beginners
jsnover1
 
PPTX
Everything you need to know about PowerShell
Shane Hoey
 
PDF
VMworld 2013: vSphere Distributed Switch – Design and Best Practices
VMworld
 
PPTX
Windows 2012 R2 Multi Server Management
Sharkrit JOBBO
 
PPTX
What's New in System Center 2012
Perficient, Inc.
 
PDF
World Population Datasheet 2008
richm711
 
PDF
System Center 2012 R2 - Enterprise Automation
Scientia Groups
 
PPTX
Using SCUP (System Center Updates Publisher) to Security Patch 3rd Party Apps...
Lumension
 
VMUG - Learning to Learn - Experiences and Tips for Certifications and Tech S...
Chris Wahl
 
VMUG - My Journey to Full Stack Engineering
Chris Wahl
 
VMworld - vSphere Distributed Switch 6.0 Technical Deep Dive
Chris Wahl
 
VMUG - Community - Two Sides of the Same Coin
Chris Wahl
 
VMUG - Picking Up New Skills - Tips and Tricks to Build Your Technical Tool C...
Chris Wahl
 
A No-Nonsense Approach to Hyperconvergence
Chris Wahl
 
An Introduction to Windows PowerShell
Dale Lane
 
Wsv406 Advanced Automation Using Windows Power Shell2.0
jsnover1
 
Wsv315 Windows Power Shell For Beginners
jsnover1
 
Everything you need to know about PowerShell
Shane Hoey
 
VMworld 2013: vSphere Distributed Switch – Design and Best Practices
VMworld
 
Windows 2012 R2 Multi Server Management
Sharkrit JOBBO
 
What's New in System Center 2012
Perficient, Inc.
 
World Population Datasheet 2008
richm711
 
System Center 2012 R2 - Enterprise Automation
Scientia Groups
 
Using SCUP (System Center Updates Publisher) to Security Patch 3rd Party Apps...
Lumension
 
Ad

Similar to VMUG - Mastering PowerShell to Call RESTful API Endpoints (20)

PPTX
Luc Dekens - Italian vmug usercon
VMUG IT
 
PPTX
VMworld 2015: Automating Everything VMware with PowerCLI- Deep Dive
VMworld
 
PPTX
TA6944 PowerCLI is for Administrators!
Alan Renouf
 
PPTX
VMworld 2015: Day to Day Automation of VMware Products to Increase Productivi...
VMworld
 
PDF
VMworld 2013: PowerCLI Best Practices - A Deep Dive
VMworld
 
PDF
TW SEAT - DevOps: Security 干我何事?
smalltown
 
PPT
Managing Virtual Infrastructures With PowerShell
guesta849bc8b
 
PPTX
PowerCLI Workshop
Carter Shanklin
 
PPTX
VMworld 2016: Getting Started with PowerShell and PowerCLI for Your VMware En...
VMworld
 
PDF
2010 za con_jameel_haffejee
Johan Klerk
 
PPTX
BePUG - PowerShell and REST - Expanding your Horizon
Eurocontrol
 
PDF
Student Spring 2022
Denis Zakharov
 
PDF
VMware Automation, PowerCLI presented at the Northern California PSUG
Alan Renouf
 
PDF
Powering up on PowerShell - BSides Charleston - Nov 2018
Fernando Tomlinson, CISSP, MBA
 
PDF
Power on, Powershell
Roo7break
 
PDF
Who Should Use Powershell? You Should Use Powershell!
Ben Finke
 
PPTX
Powering up on power shell avengercon - 2018
Fernando Tomlinson, CISSP, MBA
 
PDF
Power shell for newbies getting started powershell 4
Zafar Ali Khan
 
PDF
Powershell
padrino98
 
PPTX
Dutch VMUG 2010 PowerCLI Presentation
Alan Renouf
 
Luc Dekens - Italian vmug usercon
VMUG IT
 
VMworld 2015: Automating Everything VMware with PowerCLI- Deep Dive
VMworld
 
TA6944 PowerCLI is for Administrators!
Alan Renouf
 
VMworld 2015: Day to Day Automation of VMware Products to Increase Productivi...
VMworld
 
VMworld 2013: PowerCLI Best Practices - A Deep Dive
VMworld
 
TW SEAT - DevOps: Security 干我何事?
smalltown
 
Managing Virtual Infrastructures With PowerShell
guesta849bc8b
 
PowerCLI Workshop
Carter Shanklin
 
VMworld 2016: Getting Started with PowerShell and PowerCLI for Your VMware En...
VMworld
 
2010 za con_jameel_haffejee
Johan Klerk
 
BePUG - PowerShell and REST - Expanding your Horizon
Eurocontrol
 
Student Spring 2022
Denis Zakharov
 
VMware Automation, PowerCLI presented at the Northern California PSUG
Alan Renouf
 
Powering up on PowerShell - BSides Charleston - Nov 2018
Fernando Tomlinson, CISSP, MBA
 
Power on, Powershell
Roo7break
 
Who Should Use Powershell? You Should Use Powershell!
Ben Finke
 
Powering up on power shell avengercon - 2018
Fernando Tomlinson, CISSP, MBA
 
Power shell for newbies getting started powershell 4
Zafar Ali Khan
 
Powershell
padrino98
 
Dutch VMUG 2010 PowerCLI Presentation
Alan Renouf
 
Ad

More from Chris Wahl (14)

PDF
The Strategic Imperative of CI/CD - Thoughtfully Critical Podcast
Chris Wahl
 
PDF
Building Better, Stronger Systems - Thoughtfully Critical Podcast
Chris Wahl
 
PDF
DevOps in the Modern Era - Thoughtfully Critical Podcast
Chris Wahl
 
PDF
Subscriptions Gone Wild - Thoughtfully Critical Podcast
Chris Wahl
 
PDF
The Meteoric Rise of Online Platforms - Thoughtfully Critical Podcast
Chris Wahl
 
PDF
Forging a New Path to Equitable Justice – Platform Engineering for State Gove...
Chris Wahl
 
PDF
Least Privilege AWS IAM Role Permissions
Chris Wahl
 
PDF
Create a Beautiful Terminal for Windows 🚀
Chris Wahl
 
PDF
Constructing Open Source SDKs for Ops Teams with REST and GraphQL
Chris Wahl
 
PDF
Getting Started with AWS - Enterprise Landing Zone for Terraform Learning & D...
Chris Wahl
 
PDF
Scotland VMUG - My Journey to Full Stack Engineering
Chris Wahl
 
PDF
Norway VMUG Tour - The Architecture Behind Policy-Driven Data Protection - A ...
Chris Wahl
 
PDF
Automation for Anyone at Nutanix NEXT 2017 US
Chris Wahl
 
PDF
How to Test PowerShell Code Using Pester
Chris Wahl
 
The Strategic Imperative of CI/CD - Thoughtfully Critical Podcast
Chris Wahl
 
Building Better, Stronger Systems - Thoughtfully Critical Podcast
Chris Wahl
 
DevOps in the Modern Era - Thoughtfully Critical Podcast
Chris Wahl
 
Subscriptions Gone Wild - Thoughtfully Critical Podcast
Chris Wahl
 
The Meteoric Rise of Online Platforms - Thoughtfully Critical Podcast
Chris Wahl
 
Forging a New Path to Equitable Justice – Platform Engineering for State Gove...
Chris Wahl
 
Least Privilege AWS IAM Role Permissions
Chris Wahl
 
Create a Beautiful Terminal for Windows 🚀
Chris Wahl
 
Constructing Open Source SDKs for Ops Teams with REST and GraphQL
Chris Wahl
 
Getting Started with AWS - Enterprise Landing Zone for Terraform Learning & D...
Chris Wahl
 
Scotland VMUG - My Journey to Full Stack Engineering
Chris Wahl
 
Norway VMUG Tour - The Architecture Behind Policy-Driven Data Protection - A ...
Chris Wahl
 
Automation for Anyone at Nutanix NEXT 2017 US
Chris Wahl
 
How to Test PowerShell Code Using Pester
Chris Wahl
 

Recently uploaded (20)

PPTX
Enabling the Digital Artisan – keynote at ICOCI 2025
Alan Dix
 
PDF
''Taming Explosive Growth: Building Resilience in a Hyper-Scaled Financial Pl...
Fwdays
 
PDF
Unlocking FME Flow’s Potential: Architecture Design for Modern Enterprises
Safe Software
 
PPTX
CapCut Pro PC Crack Latest Version Free Free
josanj305
 
PPTX
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Poster...
Michele Kryston
 
PPSX
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
 
PDF
Kubernetes - Architecture & Components.pdf
geethak285
 
PDF
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
PDF
ArcGIS Utility Network Migration - The Hunter Water Story
Safe Software
 
PDF
Quantum Threats Are Closer Than You Think – Act Now to Stay Secure
WSO2
 
PPTX
Mastering Authorization: Integrating Authentication and Authorization Data in...
Hitachi, Ltd. OSS Solution Center.
 
PDF
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
 
PDF
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
PPTX
01_Approach Cyber- DORA Incident Management.pptx
FinTech Belgium
 
PDF
How to Visualize the ​Spatio-Temporal Data Using CesiumJS​
SANGHEE SHIN
 
PPTX
Wondershare Filmora Crack Free Download 2025
josanj305
 
PDF
Automating the Geo-Referencing of Historic Aerial Photography in Flanders
Safe Software
 
PDF
Java 25 and Beyond - A Roadmap of Innovations
Ana-Maria Mihalceanu
 
PPTX
2025 HackRedCon Cyber Career Paths.pptx Scott Stanton
Scott Stanton
 
PDF
Pipeline Industry IoT - Real Time Data Monitoring
Safe Software
 
Enabling the Digital Artisan – keynote at ICOCI 2025
Alan Dix
 
''Taming Explosive Growth: Building Resilience in a Hyper-Scaled Financial Pl...
Fwdays
 
Unlocking FME Flow’s Potential: Architecture Design for Modern Enterprises
Safe Software
 
CapCut Pro PC Crack Latest Version Free Free
josanj305
 
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Poster...
Michele Kryston
 
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
 
Kubernetes - Architecture & Components.pdf
geethak285
 
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
ArcGIS Utility Network Migration - The Hunter Water Story
Safe Software
 
Quantum Threats Are Closer Than You Think – Act Now to Stay Secure
WSO2
 
Mastering Authorization: Integrating Authentication and Authorization Data in...
Hitachi, Ltd. OSS Solution Center.
 
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
 
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
01_Approach Cyber- DORA Incident Management.pptx
FinTech Belgium
 
How to Visualize the ​Spatio-Temporal Data Using CesiumJS​
SANGHEE SHIN
 
Wondershare Filmora Crack Free Download 2025
josanj305
 
Automating the Geo-Referencing of Historic Aerial Photography in Flanders
Safe Software
 
Java 25 and Beyond - A Roadmap of Innovations
Ana-Maria Mihalceanu
 
2025 HackRedCon Cyber Career Paths.pptx Scott Stanton
Scott Stanton
 
Pipeline Industry IoT - Real Time Data Monitoring
Safe Software
 

VMUG - Mastering PowerShell to Call RESTful API Endpoints