SlideShare a Scribd company logo
WELCOME TO THE POWERSHELL
DEVELOPMENT WORKSHOP
SESSION 2
Bryan Cafferky
Business Intelligence Consultant
BPC Global Solutions LLC
bryan256@msn.com
www.sql-fy.com
http://www.meetup.com/The-RI-Microsoft-BIUG/
WORKSHOP FORMAT
PowerShell Development Workshop 2
• Series of presentations and exercises that build on each other.
• Start at the very basics and work up.
• Webinar for all sessions.
• GoTo Meeting Messages to ask questions.
GOALS OF THIS LESSON
PowerShell Development Workshop 3
• Discuss cmdlets, pronounced command-lets.
• Introduce some useful cmdlets.
• Introduce PowerShell variables.
• Discuss Aliases.
• Discuss PowerShell Providers.
• Learn about PowerShell Drives.
WORKSHOP LESSON 2: CMDLET REVIEW
PowerShell Development Workshop 4
Is a single-feature command that manipulates objects in
Windows PowerShell.
You can recognize cmdlets by their name format -- a verb
and noun separated by a dash (-), such as Get-Help, Get-
Process, and Start-Service
Are designed to be used in combination with other cmdlets
"get" cmdlets only retrieve data,
"set" cmdlets only establish or change data,
"format" cmdlets only format data,
"out" cmdlets only direct the output to a specified destination..
Each cmdlet has a help file that you can access by typing:
get-help <cmdlet-name> -detailed
Example: get-help write-host
WORKSHOP LESSON 2: CMDLET REVIEW:
PARAMETERS
PowerShell Development Workshop 5
Write-Host -Object "Good day!" -ForegroundColor DarkGreen -BackgroundColor Yellow
Values passed to a cmdlet to control what it does.
Parameter Name
Parameter Values
WORKSHOP LESSON 2: CMDLET REVIEW:
PARAMETERS - EXAMPLE
PowerShell Development Workshop 6
Passing Parameters by Position
Write-Host "Good day!“
Write-Host [-Object] [-NoNewline] [-Separator] [-ForegroundColor] [BackgroundColor]
[<CommonParameters>]
Passing Parameters by Name
Write-Host -Object "Good day!"
Parameter Name
No Parameter Name
WORKSHOP LESSON 2: CMDLET REVIEW:
COMMON PARAMETERS
PowerShell Development Workshop 7
Parameters that are supported by all cmdlets.
-Debug (db)
-ErrorAction (ea)
-ErrorVariable (ev)
-OutVariable (ov)
-OutBuffer (ob)
-PipelineVariable (pv)
-Verbose (vb)
-WarningAction (wa)
-WarningVariable (wv)
* Aliases are in parentheses.
WORKSHOP LESSON 2: CMDLET REVIEW
USEFUL CMDLETS
PowerShell Development Workshop 8
Get-Help Get Help on a cmdlet.
Read-Host Get user input.
Write-Host Write to the console.
Get-Member Display methods and properties of an object.
Set-Location Set the current location for a provider.
Get-ChildItem List the items within a collection.
Export-Csv Write out a CSV file.
Import-CSV Load a CSV file.
Invoke-Item Loads the file using the application associated with the file's extension.
Examples: scr_useful_cmdlets
WORKSHOP LESSON 2: VARIABLES
PowerShell Development Workshop 9
• Types of Variables
• Creating and Using Variables
WORKSHOP LESSON 2: VARIABLES
PowerShell Development Workshop 10
User Created – These variables are created in the shell and in scripts and only
persist for the session. We can create variables in scripts with global, script, or
local scope.
Automatic – These variables keep the state of the PowerShell session and can
not be modified directly. The values of this variables change as we execute and
use the PowerShell session.
Preference – These variables store user preferences for PowerShell. These
variables are created by PowerShell when a session is started and are populated
with default values. We can change the values of these variables.
Environment – These variables are the variables set by the system for Command
and PowerShell environments.
WORKSHOP LESSON 2:
USER CREATED VARIABLES
PowerShell Development Workshop 11
User Created – These variables are created in the shell and in scripts and only
persist for the session. We can create variables in scripts with global, script, or
local scope.
Examples:
$name = “Bryan” # Declares and assigns a value to an untyped variable.
[int]$amount = 200 # Declares an integer type variable and assigns a value.
WORKSHOP LESSON 2:
USER CREATED VARIABLES
PowerShell Development Workshop 12
[string] Fixed-length string of Unicode characters
[char] A Unicode 16-bit character
[byte] An 8-bit unsigned character
[int] 32-bit signed integer
[long] 64-bit signed integer
[bool] Boolean True/False value
[decimal] A 128-bit decimal value
[single] Single-precision 32-bit floating point number
[double] Double-precision 64-bit floating point number
[DateTime] Date and Time
[xml] Xml object
[array] An array of values
[hashtable] Hashtable object
[object] Default type when no type specified.
Taken from http://ss64.com/ps/syntax-datatypes.html
• Blue indicates most
frequently used types.
Examples: scr_variables and scr_declare_variables
WORKSHOP LESSON 2: CREATING VARIABLES
PowerShell Development Workshop 13
• Create untyped and assign a value in one statement.
$var1 = “some value”
• Create typed variable and assign value.
[string]$var1 = “some value”
• Create variable with cmdlet. Gives you greater control over properties.
New-Variable -Name var1 -Value "some value" -Scope private
• Assign value with cmdlet.
Set-Variable –Name var1 –Value “some value”
• Remove a variable with cmdlet.
Remove-Variable –Name var1
WORKSHOP LESSON 2: ALIASES
PowerShell Development Workshop 14
• An alternate name for a cmdlet, function, or program.
• Used to create shortcuts and easier to remember names for commands.
• PowerShell has a number of predefined aliases.
• Some emulate DOS or Linux commands.
• We can create and maintain our own aliases with the following cmdlets.
• New-Alias – creates a new alias.
• Set-Alias – changes or creates a new alias.
• Get-Alias – gets information about aliases.
• Export-Alias – Saves aliases to csv file.
• Import-Alias – Loads aliases from a csv file. Example: scr_alias.ps1
WORKSHOP LESSON 2: PROVIDERS
PowerShell Development Workshop 15
• Allow us to interact with a resource as if it were a physical network drive.
• Built-in providers include:
• Alias
• Variables
• Registry
• FileSystem
• Function
• Certificate
• WSMan
• To see a list of installed providers use the Get-PSProvider cmdlet.
Example: scr_provider_demo.ps1
WORKSHOP LESSON 2: POWERSHELL DRIVES
PowerShell Development Workshop 16
• Simulates a network drive mapping but can be to any PowerShell provider.
• Is not limited to drive letters. Can be any name you want.
• Do not persist beyond the PowerShell session unless you use the –Persist parameter.
• Related cmdlets:
• New-PSDrive
• Get-PSDrive
• Remove-PSDrive
Example: scr_psdrives.ps1
REVIEW
PowerShell Development Workshop 17
• What cmdlets are.
• Parameters and some useful cmdlets
• Creating and using PowerShell variables.
• What Aliases are and how to use them.
• What PowerShell Providers are.
• What PowerShell Drives are and how to use them.
QUESTIONS?
PowerShell Development Workshop 18

More Related Content

What's hot

C make tutorial
C make tutorialC make tutorial
Effective CMake
Effective CMakeEffective CMake
Effective CMake
Daniel Pfeifer
 
Introducing DeploYii 0.5
Introducing DeploYii 0.5Introducing DeploYii 0.5
Introducing DeploYii 0.5
Giovanni Derks
 
CMake Tutorial
CMake TutorialCMake Tutorial
CMake Tutorial
Fu Haiping
 
CMake - Introduction and best practices
CMake - Introduction and best practicesCMake - Introduction and best practices
CMake - Introduction and best practices
Daniel Pfeifer
 
PowerShell - Be A Cool Blue Kid
PowerShell - Be A Cool Blue KidPowerShell - Be A Cool Blue Kid
PowerShell - Be A Cool Blue Kid
Matthew Johnson
 
short_intro_to_CMake_(inria_REVES_team)
short_intro_to_CMake_(inria_REVES_team)short_intro_to_CMake_(inria_REVES_team)
short_intro_to_CMake_(inria_REVES_team)
Jérôme Esnault
 
G rpc lection1
G rpc lection1G rpc lection1
G rpc lection1
eleksdev
 
Shell programming in ubuntu
Shell programming in ubuntuShell programming in ubuntu
Mastering power shell - Windows
Mastering power shell - WindowsMastering power shell - Windows
Mastering power shell - Windows
Ariel Devulsky
 
Puppet DSL gotchas, and understandiing Roles & Profiles pattern
Puppet DSL gotchas, and understandiing Roles & Profiles patternPuppet DSL gotchas, and understandiing Roles & Profiles pattern
Puppet DSL gotchas, and understandiing Roles & Profiles pattern
Alex Simenduev
 
SHELL PROGRAMMING
SHELL PROGRAMMINGSHELL PROGRAMMING
SHELL PROGRAMMING
jinal thakrar
 
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)Advanced Eclipse Workshop (held at IPC2010 -spring edition-)
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)
Bastian Feder
 
Sql killedserver
Sql killedserverSql killedserver
Sql killedserver
ColdFusionConference
 
Power shell training
Power shell trainingPower shell training
Power shell training
David Brabant
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
simha.dev.lin
 
119764860 dx-auth
119764860 dx-auth119764860 dx-auth
119764860 dx-auth
Birtan Yıldız
 
Complete Guide for Linux shell programming
Complete Guide for Linux shell programmingComplete Guide for Linux shell programming
Complete Guide for Linux shell programming
sudhir singh yadav
 
Shell programming
Shell programmingShell programming
Shell programming
Moayad Moawiah
 
Windows PowerShell
Windows PowerShellWindows PowerShell
Windows PowerShell
Sandun Perera
 

What's hot (20)

C make tutorial
C make tutorialC make tutorial
C make tutorial
 
Effective CMake
Effective CMakeEffective CMake
Effective CMake
 
Introducing DeploYii 0.5
Introducing DeploYii 0.5Introducing DeploYii 0.5
Introducing DeploYii 0.5
 
CMake Tutorial
CMake TutorialCMake Tutorial
CMake Tutorial
 
CMake - Introduction and best practices
CMake - Introduction and best practicesCMake - Introduction and best practices
CMake - Introduction and best practices
 
PowerShell - Be A Cool Blue Kid
PowerShell - Be A Cool Blue KidPowerShell - Be A Cool Blue Kid
PowerShell - Be A Cool Blue Kid
 
short_intro_to_CMake_(inria_REVES_team)
short_intro_to_CMake_(inria_REVES_team)short_intro_to_CMake_(inria_REVES_team)
short_intro_to_CMake_(inria_REVES_team)
 
G rpc lection1
G rpc lection1G rpc lection1
G rpc lection1
 
Shell programming in ubuntu
Shell programming in ubuntuShell programming in ubuntu
Shell programming in ubuntu
 
Mastering power shell - Windows
Mastering power shell - WindowsMastering power shell - Windows
Mastering power shell - Windows
 
Puppet DSL gotchas, and understandiing Roles & Profiles pattern
Puppet DSL gotchas, and understandiing Roles & Profiles patternPuppet DSL gotchas, and understandiing Roles & Profiles pattern
Puppet DSL gotchas, and understandiing Roles & Profiles pattern
 
SHELL PROGRAMMING
SHELL PROGRAMMINGSHELL PROGRAMMING
SHELL PROGRAMMING
 
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)Advanced Eclipse Workshop (held at IPC2010 -spring edition-)
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)
 
Sql killedserver
Sql killedserverSql killedserver
Sql killedserver
 
Power shell training
Power shell trainingPower shell training
Power shell training
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
 
119764860 dx-auth
119764860 dx-auth119764860 dx-auth
119764860 dx-auth
 
Complete Guide for Linux shell programming
Complete Guide for Linux shell programmingComplete Guide for Linux shell programming
Complete Guide for Linux shell programming
 
Shell programming
Shell programmingShell programming
Shell programming
 
Windows PowerShell
Windows PowerShellWindows PowerShell
Windows PowerShell
 

Similar to PowerShell Workshop Series: Session 2

PowerShellForDBDevelopers
PowerShellForDBDevelopersPowerShellForDBDevelopers
PowerShellForDBDevelopers
Bryan Cafferky
 
Holy PowerShell, BATman! - dogfood edition
Holy PowerShell, BATman! - dogfood editionHoly PowerShell, BATman! - dogfood edition
Holy PowerShell, BATman! - dogfood edition
Dave Diehl
 
PowerShell 101
PowerShell 101PowerShell 101
PowerShell 101
Thomas Lee
 
Everything you need to know about PowerShell
Everything you need to know about PowerShellEverything you need to know about PowerShell
Everything you need to know about PowerShell
Shane Hoey
 
PowerShell for Penetration Testers
PowerShell for Penetration TestersPowerShell for Penetration Testers
PowerShell for Penetration Testers
Nikhil Mittal
 
VMworld 2016: Getting Started with PowerShell and PowerCLI for Your VMware En...
VMworld 2016: Getting Started with PowerShell and PowerCLI for Your VMware En...VMworld 2016: Getting Started with PowerShell and PowerCLI for Your VMware En...
VMworld 2016: Getting Started with PowerShell and PowerCLI for Your VMware En...
VMworld
 
Learn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdf
Learn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdfLearn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdf
Learn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdf
ClapperboardCinemaPV
 
Nagios Conference 2014 - Mike Weber - Nagios Rapid Deployment Options
Nagios Conference 2014 - Mike Weber - Nagios Rapid Deployment OptionsNagios Conference 2014 - Mike Weber - Nagios Rapid Deployment Options
Nagios Conference 2014 - Mike Weber - Nagios Rapid Deployment Options
Nagios
 
Working Effectively With Legacy Perl Code
Working Effectively With Legacy Perl CodeWorking Effectively With Legacy Perl Code
Working Effectively With Legacy Perl Code
erikmsp
 
Powershell_Basics_Robin
Powershell_Basics_RobinPowershell_Basics_Robin
Powershell_Basics_Robin
Robin Aggarwal
 
24 Hours Of Exchange Server 2007 (Part 8 Of 24)
24 Hours Of Exchange Server 2007 (Part 8 Of 24)24 Hours Of Exchange Server 2007 (Part 8 Of 24)
24 Hours Of Exchange Server 2007 (Part 8 Of 24)
Harold Wong
 
Ruby On Rails
Ruby On RailsRuby On Rails
Ruby On Rails
Balint Erdi
 
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with PowershellBrian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
SharePoint Saturday NY
 
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with PowershellBrian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
SharePoint Saturday NY
 
PowerShell Technical Overview
PowerShell Technical OverviewPowerShell Technical Overview
PowerShell Technical Overview
allandcp
 
Sql Server & PowerShell
Sql Server & PowerShellSql Server & PowerShell
Sql Server & PowerShell
Aaron Shilo
 
Windows PowerShell
Windows PowerShellWindows PowerShell
Inria Tech Talk : Comment améliorer la qualité de vos logiciels avec STAMP
Inria Tech Talk : Comment améliorer la qualité de vos logiciels avec STAMPInria Tech Talk : Comment améliorer la qualité de vos logiciels avec STAMP
Inria Tech Talk : Comment améliorer la qualité de vos logiciels avec STAMP
Stéphanie Roger
 
Extending Eclipse Che to build custom cloud IDEs
Extending Eclipse Che to build custom cloud IDEsExtending Eclipse Che to build custom cloud IDEs
Extending Eclipse Che to build custom cloud IDEs
Florent BENOIT
 
Shell tutorial
Shell tutorialShell tutorial
Shell tutorial
Vu Duy Tu
 

Similar to PowerShell Workshop Series: Session 2 (20)

PowerShellForDBDevelopers
PowerShellForDBDevelopersPowerShellForDBDevelopers
PowerShellForDBDevelopers
 
Holy PowerShell, BATman! - dogfood edition
Holy PowerShell, BATman! - dogfood editionHoly PowerShell, BATman! - dogfood edition
Holy PowerShell, BATman! - dogfood edition
 
PowerShell 101
PowerShell 101PowerShell 101
PowerShell 101
 
Everything you need to know about PowerShell
Everything you need to know about PowerShellEverything you need to know about PowerShell
Everything you need to know about PowerShell
 
PowerShell for Penetration Testers
PowerShell for Penetration TestersPowerShell for Penetration Testers
PowerShell for Penetration Testers
 
VMworld 2016: Getting Started with PowerShell and PowerCLI for Your VMware En...
VMworld 2016: Getting Started with PowerShell and PowerCLI for Your VMware En...VMworld 2016: Getting Started with PowerShell and PowerCLI for Your VMware En...
VMworld 2016: Getting Started with PowerShell and PowerCLI for Your VMware En...
 
Learn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdf
Learn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdfLearn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdf
Learn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdf
 
Nagios Conference 2014 - Mike Weber - Nagios Rapid Deployment Options
Nagios Conference 2014 - Mike Weber - Nagios Rapid Deployment OptionsNagios Conference 2014 - Mike Weber - Nagios Rapid Deployment Options
Nagios Conference 2014 - Mike Weber - Nagios Rapid Deployment Options
 
Working Effectively With Legacy Perl Code
Working Effectively With Legacy Perl CodeWorking Effectively With Legacy Perl Code
Working Effectively With Legacy Perl Code
 
Powershell_Basics_Robin
Powershell_Basics_RobinPowershell_Basics_Robin
Powershell_Basics_Robin
 
24 Hours Of Exchange Server 2007 (Part 8 Of 24)
24 Hours Of Exchange Server 2007 (Part 8 Of 24)24 Hours Of Exchange Server 2007 (Part 8 Of 24)
24 Hours Of Exchange Server 2007 (Part 8 Of 24)
 
Ruby On Rails
Ruby On RailsRuby On Rails
Ruby On Rails
 
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with PowershellBrian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
 
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with PowershellBrian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
 
PowerShell Technical Overview
PowerShell Technical OverviewPowerShell Technical Overview
PowerShell Technical Overview
 
Sql Server & PowerShell
Sql Server & PowerShellSql Server & PowerShell
Sql Server & PowerShell
 
Windows PowerShell
Windows PowerShellWindows PowerShell
Windows PowerShell
 
Inria Tech Talk : Comment améliorer la qualité de vos logiciels avec STAMP
Inria Tech Talk : Comment améliorer la qualité de vos logiciels avec STAMPInria Tech Talk : Comment améliorer la qualité de vos logiciels avec STAMP
Inria Tech Talk : Comment améliorer la qualité de vos logiciels avec STAMP
 
Extending Eclipse Che to build custom cloud IDEs
Extending Eclipse Che to build custom cloud IDEsExtending Eclipse Che to build custom cloud IDEs
Extending Eclipse Che to build custom cloud IDEs
 
Shell tutorial
Shell tutorialShell tutorial
Shell tutorial
 

Recently uploaded

Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
ScyllaDB
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
Neo4j
 
"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
Fwdays
 
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
Ajin Abraham
 
inQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
inQuba Webinar Mastering Customer Journey Management with Dr Graham HillinQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
inQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
LizaNolte
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Neo4j
 
Demystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through StorytellingDemystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through Storytelling
Enterprise Knowledge
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
Antonios Katsarakis
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
Alex Pruden
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
saastr
 
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptxPRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
christinelarrosa
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
"Scaling RAG Applications to serve millions of users", Kevin Goedecke
"Scaling RAG Applications to serve millions of users",  Kevin Goedecke"Scaling RAG Applications to serve millions of users",  Kevin Goedecke
"Scaling RAG Applications to serve millions of users", Kevin Goedecke
Fwdays
 
Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
c5vrf27qcz
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
DianaGray10
 
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
saastr
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
Ivo Velitchkov
 
Christine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptxChristine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptx
christinelarrosa
 

Recently uploaded (20)

Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
 
"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
 
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
 
inQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
inQuba Webinar Mastering Customer Journey Management with Dr Graham HillinQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
inQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
 
Demystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through StorytellingDemystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through Storytelling
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
 
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptxPRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
"Scaling RAG Applications to serve millions of users", Kevin Goedecke
"Scaling RAG Applications to serve millions of users",  Kevin Goedecke"Scaling RAG Applications to serve millions of users",  Kevin Goedecke
"Scaling RAG Applications to serve millions of users", Kevin Goedecke
 
Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
 
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
 
Christine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptxChristine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptx
 

PowerShell Workshop Series: Session 2

  • 1. WELCOME TO THE POWERSHELL DEVELOPMENT WORKSHOP SESSION 2 Bryan Cafferky Business Intelligence Consultant BPC Global Solutions LLC bryan256@msn.com www.sql-fy.com http://www.meetup.com/The-RI-Microsoft-BIUG/
  • 2. WORKSHOP FORMAT PowerShell Development Workshop 2 • Series of presentations and exercises that build on each other. • Start at the very basics and work up. • Webinar for all sessions. • GoTo Meeting Messages to ask questions.
  • 3. GOALS OF THIS LESSON PowerShell Development Workshop 3 • Discuss cmdlets, pronounced command-lets. • Introduce some useful cmdlets. • Introduce PowerShell variables. • Discuss Aliases. • Discuss PowerShell Providers. • Learn about PowerShell Drives.
  • 4. WORKSHOP LESSON 2: CMDLET REVIEW PowerShell Development Workshop 4 Is a single-feature command that manipulates objects in Windows PowerShell. You can recognize cmdlets by their name format -- a verb and noun separated by a dash (-), such as Get-Help, Get- Process, and Start-Service Are designed to be used in combination with other cmdlets "get" cmdlets only retrieve data, "set" cmdlets only establish or change data, "format" cmdlets only format data, "out" cmdlets only direct the output to a specified destination.. Each cmdlet has a help file that you can access by typing: get-help <cmdlet-name> -detailed Example: get-help write-host
  • 5. WORKSHOP LESSON 2: CMDLET REVIEW: PARAMETERS PowerShell Development Workshop 5 Write-Host -Object "Good day!" -ForegroundColor DarkGreen -BackgroundColor Yellow Values passed to a cmdlet to control what it does. Parameter Name Parameter Values
  • 6. WORKSHOP LESSON 2: CMDLET REVIEW: PARAMETERS - EXAMPLE PowerShell Development Workshop 6 Passing Parameters by Position Write-Host "Good day!“ Write-Host [-Object] [-NoNewline] [-Separator] [-ForegroundColor] [BackgroundColor] [<CommonParameters>] Passing Parameters by Name Write-Host -Object "Good day!" Parameter Name No Parameter Name
  • 7. WORKSHOP LESSON 2: CMDLET REVIEW: COMMON PARAMETERS PowerShell Development Workshop 7 Parameters that are supported by all cmdlets. -Debug (db) -ErrorAction (ea) -ErrorVariable (ev) -OutVariable (ov) -OutBuffer (ob) -PipelineVariable (pv) -Verbose (vb) -WarningAction (wa) -WarningVariable (wv) * Aliases are in parentheses.
  • 8. WORKSHOP LESSON 2: CMDLET REVIEW USEFUL CMDLETS PowerShell Development Workshop 8 Get-Help Get Help on a cmdlet. Read-Host Get user input. Write-Host Write to the console. Get-Member Display methods and properties of an object. Set-Location Set the current location for a provider. Get-ChildItem List the items within a collection. Export-Csv Write out a CSV file. Import-CSV Load a CSV file. Invoke-Item Loads the file using the application associated with the file's extension. Examples: scr_useful_cmdlets
  • 9. WORKSHOP LESSON 2: VARIABLES PowerShell Development Workshop 9 • Types of Variables • Creating and Using Variables
  • 10. WORKSHOP LESSON 2: VARIABLES PowerShell Development Workshop 10 User Created – These variables are created in the shell and in scripts and only persist for the session. We can create variables in scripts with global, script, or local scope. Automatic – These variables keep the state of the PowerShell session and can not be modified directly. The values of this variables change as we execute and use the PowerShell session. Preference – These variables store user preferences for PowerShell. These variables are created by PowerShell when a session is started and are populated with default values. We can change the values of these variables. Environment – These variables are the variables set by the system for Command and PowerShell environments.
  • 11. WORKSHOP LESSON 2: USER CREATED VARIABLES PowerShell Development Workshop 11 User Created – These variables are created in the shell and in scripts and only persist for the session. We can create variables in scripts with global, script, or local scope. Examples: $name = “Bryan” # Declares and assigns a value to an untyped variable. [int]$amount = 200 # Declares an integer type variable and assigns a value.
  • 12. WORKSHOP LESSON 2: USER CREATED VARIABLES PowerShell Development Workshop 12 [string] Fixed-length string of Unicode characters [char] A Unicode 16-bit character [byte] An 8-bit unsigned character [int] 32-bit signed integer [long] 64-bit signed integer [bool] Boolean True/False value [decimal] A 128-bit decimal value [single] Single-precision 32-bit floating point number [double] Double-precision 64-bit floating point number [DateTime] Date and Time [xml] Xml object [array] An array of values [hashtable] Hashtable object [object] Default type when no type specified. Taken from http://ss64.com/ps/syntax-datatypes.html • Blue indicates most frequently used types. Examples: scr_variables and scr_declare_variables
  • 13. WORKSHOP LESSON 2: CREATING VARIABLES PowerShell Development Workshop 13 • Create untyped and assign a value in one statement. $var1 = “some value” • Create typed variable and assign value. [string]$var1 = “some value” • Create variable with cmdlet. Gives you greater control over properties. New-Variable -Name var1 -Value "some value" -Scope private • Assign value with cmdlet. Set-Variable –Name var1 –Value “some value” • Remove a variable with cmdlet. Remove-Variable –Name var1
  • 14. WORKSHOP LESSON 2: ALIASES PowerShell Development Workshop 14 • An alternate name for a cmdlet, function, or program. • Used to create shortcuts and easier to remember names for commands. • PowerShell has a number of predefined aliases. • Some emulate DOS or Linux commands. • We can create and maintain our own aliases with the following cmdlets. • New-Alias – creates a new alias. • Set-Alias – changes or creates a new alias. • Get-Alias – gets information about aliases. • Export-Alias – Saves aliases to csv file. • Import-Alias – Loads aliases from a csv file. Example: scr_alias.ps1
  • 15. WORKSHOP LESSON 2: PROVIDERS PowerShell Development Workshop 15 • Allow us to interact with a resource as if it were a physical network drive. • Built-in providers include: • Alias • Variables • Registry • FileSystem • Function • Certificate • WSMan • To see a list of installed providers use the Get-PSProvider cmdlet. Example: scr_provider_demo.ps1
  • 16. WORKSHOP LESSON 2: POWERSHELL DRIVES PowerShell Development Workshop 16 • Simulates a network drive mapping but can be to any PowerShell provider. • Is not limited to drive letters. Can be any name you want. • Do not persist beyond the PowerShell session unless you use the –Persist parameter. • Related cmdlets: • New-PSDrive • Get-PSDrive • Remove-PSDrive Example: scr_psdrives.ps1
  • 17. REVIEW PowerShell Development Workshop 17 • What cmdlets are. • Parameters and some useful cmdlets • Creating and using PowerShell variables. • What Aliases are and how to use them. • What PowerShell Providers are. • What PowerShell Drives are and how to use them.

Editor's Notes

  1. This template can be used as a starter file for presenting training materials in a group setting. Sections Right-click on a slide to add sections. Sections can help to organize your slides or facilitate collaboration between multiple authors. Notes Use the Notes section for delivery notes or to provide additional details for the audience. View these notes in Presentation View during your presentation. Keep in mind the font size (important for accessibility, visibility, videotaping, and online production) Coordinated colors Pay particular attention to the graphs, charts, and text boxes. Consider that attendees will print in black and white or grayscale. Run a test print to make sure your colors work when printed in pure black and white and grayscale. Graphics, tables, and graphs Keep it simple: If possible, use consistent, non-distracting styles and colors. Label all graphs and tables.
  2. Microsoft Confidential