SlideShare a Scribd company logo
POWERSHELL ZERO TO HERO!
PRESENTED BY :- DAISY OLIVIA STEVENS
DATE: 16/07/2019
THE AGENDA!
TOOLING FUNDAMENTALS CONSTRUCTION
MEET THE PRESENTER
 I have worked in the majority of all market sectors within
tech functions for over 10 years
 My Specialties are:-
 Networking (Multi-vendor full stack)
 Cloud (Public and Private)
 VMware, Hyper-V and Citrix
 Azure, AWS, GCP
 Storage (Dell EMC / HP etc)
 Deployment Automation (Windows / Linux)
 Social
 LinkedIn :- https://www.linkedin.com/in/theheroic/
 Instagram :-
https://www.instagram.com/daisyoliviastevens/
 WordPress :- https://adminscriptbank.wordpress.com/
WHAT IS POWERSHELL?
 PowerShell is an automated task framework from Microsoft, with a command line shell and a scripting
language integrated into the .NET framework.
 PowerShell is used to automate batch process’s and perform administrative tasks in Windows, Linux and
MacOS environments.
 Windows PowerShell executes four types of commands:
 Cmdlets
 PowerShell functions
 PowerShell scripts
 Executable programs
TOOLING
A GREAT TOOL IMPROVES THE WAY YOU THINK!
TOOLING - VSCODE
Visual Studio Code is a source-code editor
developed by Microsoft for Windows, Linux and
macOS. With a large array of features to enhance
your development experience such as :-
 Intellisence
 Refactoring
 Debugging
 Version Control
 Terminal Integration
 Multi Language Support (15+)
TOOLING – NOTEPAD++
Notepad++ is a free (as in "free speech" and also as in "free beer")
source code editor and Notepad replacement that supports
several languages. Running in the MS Windows environment
 Syntax Highlighting and Syntax Folding
 PCRE (Perl Compatible Regular Expression) Search/Replace
 GUI entirely customizable: minimalist, tab with close button,
multi-line tab, vertical tab and vertical document list
 Document Map
 Auto-completion: Word completion, Function completion and
Function parameters hint
 Multi-Document (Tab interface)
 Multi-Language environment supported
 Bookmark
 Macro recording and playback
TOOLING – POWERSHELL ISE
The Windows PowerShell Integrated Scripting
Environment (ISE) is a host application for Windows
PowerShell. In the ISE, you can run commands and
write, test, and debug scripts in a single Windows-
based graphic user interface.
 Context-sensitive help
 Selective execution
 Multiline editing
FUNDAMENTALS
TALK IS CHEAP SHOW ME THE CODE! – LINUS TORVADS
DATA TYPES
A data type is an attribute of data which tells the
compiler or interpreter how the programmer
intends to use the data.
Data types defines the operations that can be
done on the data
Data Type Description Example
[string] Text String Hello World
[char] Symbol =
[bool] Boolean $true
[int] Integer 32 Bit 235235345
[long] Integer 64 Bit 2352353457
[decimal] 128 Bit Decimal 23523.53456d
[DateTime] Date And Time 26/07/19 10:30
[array] A series of objects all of
which are the same size
and type
“One”,”Two”,”Three”
And More!
OBJECTS / VARIABLES
PowerShell lets you create named objects known as
variables. Variable names can include the underscore
character and any alphanumeric characters.
When used in PowerShell, a variable is always specified
using the $ character followed by variable name.
Within PowerShell you have also have global and local
variables:
 Global variables are declared outside any function,
and they can be accessed (used) on any function in
the program
 Local variables are declared inside a function, and
can be used only inside that function. It is possible
to have local variables with the same name in
different functions.
FUNCTIONS
A function is a list of PowerShell statements that
has a name that you assign. When you run a
function, you type the function name. The
statements in the list run as if you had typed them
at the command prompt.
Like cmdlets, functions can have parameters. The
parameters can be named, positional, switch, or
dynamic parameters. Function parameters can be
read from the command line or from the pipeline.
IF
Every programming and scripting language has had
some sort of way to perform a conditional
operation using an If statement as part of flow
control in a script or program.
You can use the If statement to run code blocks if a
specified conditional test evaluates to true. You can
also specify one or more additional conditional
tests to run if all the prior tests evaluate to false
TRY
Handle a terminating error (exception) within a
script block.
Use the Try block to define a section of a script in
which you want PowerShell to monitor for errors.
When an error occurs within the Try block, the error
is first saved to the $Error.
PowerShell then searches for a Catch block to
handle the error. After a Catch block is completed,
the Finally block is run.
LOOP
 It is a fundamental concept of any programming
language
 PowerShell loops, at their most basic, simply
repeat the same set of commands a set number
of times.
STRUCTURE
Structured programming is a subset of procedural
programming that enforces a logical structure on
the program being written to make it more efficient
and easier to understand and modify.
Structured programming frequently employs a top-
down design model, in which developers map out
the overall program structure into separate
subsections.
Remember be consistent!
Naming Conventions, Indentation, Capitalisation
• Comment Block
• Comment Based Help
Header
• $UserName
• $UserAge
Input Params
• $Global:UDateTime = get-date
• $Env:ComputerName
Global Params
• Function Get-CompName {write-host “The Computer Name is $Env:ComputerName”}
Functions
• Get-ComputerName
Call Stack
• Write-host “The Script Has Now Finished Executing!”
Script End
CONSTRUCTION
LET’S GO INVENT TOMORROW INSTEAD OF WORRYING ABOUT WHAT HAPPENED YESTERDAY. – STEVE JOBS
HELLO WORLD!
HELLO WORLD – FORMATTED!
HELLO WORLD – STRUCTURED!
HELLO WORLD – LOOP!
HELLO WORLD – IF!
Array Size Count Greater Than 4 Array Size Count Less Than 4
HELLO WORLD – TRY!
No Error! Invoked Error!
RESOURCE LINKS
 VSCODE
 https://code.visualstudio.com/
 Data Type Detail
 https://ss64.com/ps/syntax-datatypes.html
 Microsoft PowerShell Help Documentation
 https://docs.microsoft.com/en-
gb/powershell/scripting/overview?view=powershell
-6
THANK YOU
DAISYSTEVENS100@OUTLOOK.COM
ADMINSCRIPTBANK.WORDPRESS.COM/
MOBILE UK: +44 (0) 7757 998 750
MOBILE RO: +40 (0) 7846 784 65

More Related Content

What's hot (20)

PPTX
Photographic Characteristic of X ray Film.pptx
PrashantVerma227710
 
PPTX
Image reconstruction
Melvin Alex
 
PPTX
Stereoscopic Imaging
Charanjeet Singh
 
PPT
Webchat using flask socket io
Linggar Primahastoko
 
PPTX
Barium swallow. Srinivas Rao Khorfakkhan hospital
almasmkm
 
PPTX
X ray production and interaction
haribudke
 
PPT
radiology x-ray production
Parth Thakkar
 
PPT
CT Physics
RMLIMS
 
PPTX
Photographic principles
SakshiMathur36
 
PPTX
X ray machine l
DiNa Amin
 
PPTX
Xeroradiography
alma dsouza
 
PPTX
Intern presentation based on Flutter Lawyer App.
Independent University , Bangladesh
 
PPTX
C spine positioning
docaashishgupt
 
PPTX
MRI Artefacts
Anjan Dangal
 
PPT
Artifacts in MRI
Arun Alanallur A
 
PPT
X ray tube
Bipin Joseph
 
PDF
Radiology procedure questions and answer 1
Ganesan Yogananthem
 
PPTX
Image Processing Using MATLAB
Amarjeetsingh Thakur
 
PPTX
Mammographic equipment
SharmaRajan4
 
PDF
Sheet 2 section 2 rating x-ray tube
cairo university
 
Photographic Characteristic of X ray Film.pptx
PrashantVerma227710
 
Image reconstruction
Melvin Alex
 
Stereoscopic Imaging
Charanjeet Singh
 
Webchat using flask socket io
Linggar Primahastoko
 
Barium swallow. Srinivas Rao Khorfakkhan hospital
almasmkm
 
X ray production and interaction
haribudke
 
radiology x-ray production
Parth Thakkar
 
CT Physics
RMLIMS
 
Photographic principles
SakshiMathur36
 
X ray machine l
DiNa Amin
 
Xeroradiography
alma dsouza
 
Intern presentation based on Flutter Lawyer App.
Independent University , Bangladesh
 
C spine positioning
docaashishgupt
 
MRI Artefacts
Anjan Dangal
 
Artifacts in MRI
Arun Alanallur A
 
X ray tube
Bipin Joseph
 
Radiology procedure questions and answer 1
Ganesan Yogananthem
 
Image Processing Using MATLAB
Amarjeetsingh Thakur
 
Mammographic equipment
SharmaRajan4
 
Sheet 2 section 2 rating x-ray tube
cairo university
 

Similar to PowerShell Zero To Hero Workshop! (20)

PPTX
PowerShell 101
Thomas Lee
 
PPTX
Holy PowerShell, BATman! - dogfood edition
Dave Diehl
 
PDF
Windows Powershell in Action 1st Edition Bruce G. Payette
zahithovor
 
PDF
Windows Powershell in Action 1st Edition Bruce G. Payette
moudenongui20
 
PDF
Windows Powershell in Action 1st Edition Bruce G. Payette
takabedembe
 
PPTX
Power shell training
David Brabant
 
PPTX
PowerShell for Penetration Testers
Nikhil Mittal
 
PPT
Introduction to PowerShell
Salaudeen Rajack
 
PDF
Practical PowerShell Programming for Professional People
Ben Ten (0xA)
 
PPTX
Windows PowerShell
Sandun Perera
 
PDF
Powershell notes
Carlos Amorim
 
PDF
Learn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdf
ClapperboardCinemaPV
 
PDF
Practical PowerShell Programming for Professional People - DerbyCon 4
Ben Ten (0xA)
 
PDF
Introduction to PowerShell
Boulos Dib
 
PDF
Powershell training material
Dr. Awase Khirni Syed
 
PPTX
Introduction to PowerShell (SharePoint Fest Chicago 2016 Workshop)
Michael Blumenthal (Microsoft MVP)
 
PPTX
Introduction to PowerShell and getting started
Ravikanth Chaganti
 
PDF
Practical PowerShell Programming for Professional People - Extended Edition
Ben Ten (0xA)
 
PDF
Power Shell For Testers
Mca140 software solutions
 
PDF
Modernizing PowerShell Scripts
Axxes IT Consultancy
 
PowerShell 101
Thomas Lee
 
Holy PowerShell, BATman! - dogfood edition
Dave Diehl
 
Windows Powershell in Action 1st Edition Bruce G. Payette
zahithovor
 
Windows Powershell in Action 1st Edition Bruce G. Payette
moudenongui20
 
Windows Powershell in Action 1st Edition Bruce G. Payette
takabedembe
 
Power shell training
David Brabant
 
PowerShell for Penetration Testers
Nikhil Mittal
 
Introduction to PowerShell
Salaudeen Rajack
 
Practical PowerShell Programming for Professional People
Ben Ten (0xA)
 
Windows PowerShell
Sandun Perera
 
Powershell notes
Carlos Amorim
 
Learn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdf
ClapperboardCinemaPV
 
Practical PowerShell Programming for Professional People - DerbyCon 4
Ben Ten (0xA)
 
Introduction to PowerShell
Boulos Dib
 
Powershell training material
Dr. Awase Khirni Syed
 
Introduction to PowerShell (SharePoint Fest Chicago 2016 Workshop)
Michael Blumenthal (Microsoft MVP)
 
Introduction to PowerShell and getting started
Ravikanth Chaganti
 
Practical PowerShell Programming for Professional People - Extended Edition
Ben Ten (0xA)
 
Power Shell For Testers
Mca140 software solutions
 
Modernizing PowerShell Scripts
Axxes IT Consultancy
 
Ad

Recently uploaded (20)

PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PDF
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
PDF
Impact of IEEE Computer Society in Advancing Emerging Technologies including ...
Hironori Washizaki
 
PDF
Building Resilience with Digital Twins : Lessons from Korea
SANGHEE SHIN
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
SFWelly Summer 25 Release Highlights July 2025
Anna Loughnan Colquhoun
 
PDF
Smart Air Quality Monitoring with Serrax AQM190 LITE
SERRAX TECHNOLOGIES LLP
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PDF
Persuasive AI: risks and opportunities in the age of digital debate
Speck&Tech
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
Predicting the unpredictable: re-engineering recommendation algorithms for fr...
Speck&Tech
 
PDF
CloudStack GPU Integration - Rohit Yadav
ShapeBlue
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
Apache CloudStack 201: Let's Design & Build an IaaS Cloud
ShapeBlue
 
PPTX
Darren Mills The Migration Modernization Balancing Act: Navigating Risks and...
AWS Chicago
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PDF
July Patch Tuesday
Ivanti
 
PPT
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
PPTX
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
Impact of IEEE Computer Society in Advancing Emerging Technologies including ...
Hironori Washizaki
 
Building Resilience with Digital Twins : Lessons from Korea
SANGHEE SHIN
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
SFWelly Summer 25 Release Highlights July 2025
Anna Loughnan Colquhoun
 
Smart Air Quality Monitoring with Serrax AQM190 LITE
SERRAX TECHNOLOGIES LLP
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
Persuasive AI: risks and opportunities in the age of digital debate
Speck&Tech
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
Predicting the unpredictable: re-engineering recommendation algorithms for fr...
Speck&Tech
 
CloudStack GPU Integration - Rohit Yadav
ShapeBlue
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Apache CloudStack 201: Let's Design & Build an IaaS Cloud
ShapeBlue
 
Darren Mills The Migration Modernization Balancing Act: Navigating Risks and...
AWS Chicago
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
July Patch Tuesday
Ivanti
 
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
Ad

PowerShell Zero To Hero Workshop!

  • 1. POWERSHELL ZERO TO HERO! PRESENTED BY :- DAISY OLIVIA STEVENS DATE: 16/07/2019
  • 3. MEET THE PRESENTER  I have worked in the majority of all market sectors within tech functions for over 10 years  My Specialties are:-  Networking (Multi-vendor full stack)  Cloud (Public and Private)  VMware, Hyper-V and Citrix  Azure, AWS, GCP  Storage (Dell EMC / HP etc)  Deployment Automation (Windows / Linux)  Social  LinkedIn :- https://www.linkedin.com/in/theheroic/  Instagram :- https://www.instagram.com/daisyoliviastevens/  WordPress :- https://adminscriptbank.wordpress.com/
  • 4. WHAT IS POWERSHELL?  PowerShell is an automated task framework from Microsoft, with a command line shell and a scripting language integrated into the .NET framework.  PowerShell is used to automate batch process’s and perform administrative tasks in Windows, Linux and MacOS environments.  Windows PowerShell executes four types of commands:  Cmdlets  PowerShell functions  PowerShell scripts  Executable programs
  • 5. TOOLING A GREAT TOOL IMPROVES THE WAY YOU THINK!
  • 6. TOOLING - VSCODE Visual Studio Code is a source-code editor developed by Microsoft for Windows, Linux and macOS. With a large array of features to enhance your development experience such as :-  Intellisence  Refactoring  Debugging  Version Control  Terminal Integration  Multi Language Support (15+)
  • 7. TOOLING – NOTEPAD++ Notepad++ is a free (as in "free speech" and also as in "free beer") source code editor and Notepad replacement that supports several languages. Running in the MS Windows environment  Syntax Highlighting and Syntax Folding  PCRE (Perl Compatible Regular Expression) Search/Replace  GUI entirely customizable: minimalist, tab with close button, multi-line tab, vertical tab and vertical document list  Document Map  Auto-completion: Word completion, Function completion and Function parameters hint  Multi-Document (Tab interface)  Multi-Language environment supported  Bookmark  Macro recording and playback
  • 8. TOOLING – POWERSHELL ISE The Windows PowerShell Integrated Scripting Environment (ISE) is a host application for Windows PowerShell. In the ISE, you can run commands and write, test, and debug scripts in a single Windows- based graphic user interface.  Context-sensitive help  Selective execution  Multiline editing
  • 9. FUNDAMENTALS TALK IS CHEAP SHOW ME THE CODE! – LINUS TORVADS
  • 10. DATA TYPES A data type is an attribute of data which tells the compiler or interpreter how the programmer intends to use the data. Data types defines the operations that can be done on the data Data Type Description Example [string] Text String Hello World [char] Symbol = [bool] Boolean $true [int] Integer 32 Bit 235235345 [long] Integer 64 Bit 2352353457 [decimal] 128 Bit Decimal 23523.53456d [DateTime] Date And Time 26/07/19 10:30 [array] A series of objects all of which are the same size and type “One”,”Two”,”Three” And More!
  • 11. OBJECTS / VARIABLES PowerShell lets you create named objects known as variables. Variable names can include the underscore character and any alphanumeric characters. When used in PowerShell, a variable is always specified using the $ character followed by variable name. Within PowerShell you have also have global and local variables:  Global variables are declared outside any function, and they can be accessed (used) on any function in the program  Local variables are declared inside a function, and can be used only inside that function. It is possible to have local variables with the same name in different functions.
  • 12. FUNCTIONS A function is a list of PowerShell statements that has a name that you assign. When you run a function, you type the function name. The statements in the list run as if you had typed them at the command prompt. Like cmdlets, functions can have parameters. The parameters can be named, positional, switch, or dynamic parameters. Function parameters can be read from the command line or from the pipeline.
  • 13. IF Every programming and scripting language has had some sort of way to perform a conditional operation using an If statement as part of flow control in a script or program. You can use the If statement to run code blocks if a specified conditional test evaluates to true. You can also specify one or more additional conditional tests to run if all the prior tests evaluate to false
  • 14. TRY Handle a terminating error (exception) within a script block. Use the Try block to define a section of a script in which you want PowerShell to monitor for errors. When an error occurs within the Try block, the error is first saved to the $Error. PowerShell then searches for a Catch block to handle the error. After a Catch block is completed, the Finally block is run.
  • 15. LOOP  It is a fundamental concept of any programming language  PowerShell loops, at their most basic, simply repeat the same set of commands a set number of times.
  • 16. STRUCTURE Structured programming is a subset of procedural programming that enforces a logical structure on the program being written to make it more efficient and easier to understand and modify. Structured programming frequently employs a top- down design model, in which developers map out the overall program structure into separate subsections. Remember be consistent! Naming Conventions, Indentation, Capitalisation • Comment Block • Comment Based Help Header • $UserName • $UserAge Input Params • $Global:UDateTime = get-date • $Env:ComputerName Global Params • Function Get-CompName {write-host “The Computer Name is $Env:ComputerName”} Functions • Get-ComputerName Call Stack • Write-host “The Script Has Now Finished Executing!” Script End
  • 17. CONSTRUCTION LET’S GO INVENT TOMORROW INSTEAD OF WORRYING ABOUT WHAT HAPPENED YESTERDAY. – STEVE JOBS
  • 19. HELLO WORLD – FORMATTED!
  • 20. HELLO WORLD – STRUCTURED!
  • 22. HELLO WORLD – IF! Array Size Count Greater Than 4 Array Size Count Less Than 4
  • 23. HELLO WORLD – TRY! No Error! Invoked Error!
  • 24. RESOURCE LINKS  VSCODE  https://code.visualstudio.com/  Data Type Detail  https://ss64.com/ps/syntax-datatypes.html  Microsoft PowerShell Help Documentation  https://docs.microsoft.com/en- gb/powershell/scripting/overview?view=powershell -6
  • 25. THANK YOU [email protected] ADMINSCRIPTBANK.WORDPRESS.COM/ MOBILE UK: +44 (0) 7757 998 750 MOBILE RO: +40 (0) 7846 784 65