SlideShare une entreprise Scribd logo
1  sur  43
Thomas Lee (tfl@psp.co.uk)
MCT and PowerShell MVP




POWERSHELL 101 – WHAT IS IT

AND WHY IT MATTERS
 What IS PowerShell?
 What are Cmdlets, Objects and the Pipeline?
 Language fundamentals
 How do I install and setup PowerShell>
 How do I use PowerShell?
 PowerShell profiles
 Getting the most from PowerShell
 Why does it matter?
 PowerShell is
   Microsoft’s task automation platform.
   Part of Microsoft’s Common Engineering Criteria
   Included with every version of Windows 7/Server 2008
    R2 (and as a OS patch for earlier versions)


 In a couple of years, if you don’t know
  PowerShell you may not have a job as an IT Pro!
 Shell
   Unix like (console.exe)
   Lightweight IDE (sort of VS Lite)
 Scripting Language
   Power of Perl/Ruby
 Extensible
   Create your own cmdlets/providers/types/etc
   Leverage the community
 Built on .NET and Windows
   MS-centric/MS-focused
Cmdlets   Objects   Pipeline
 The fundamental unit of functionality
   Implemented as a .NET Class
   Get some, buy some, find some, or build your own
 Cmdlets take parameters
   Parameters have names (prefaced with “-”)
   Parameter names can be abbreviated
 Cmdlets can have aliases
   Built in or add your own
   Aliases do NOT include parameter aliasing 
 A computer abstraction of a real life thing
   A process
   A server
   An AD User
 Objects have occurrences you manage
   The processes running on a computer
   The users in an OU
   The files in a folder
 PowerShell supports:
   .NET objects
   COM objects
   WMI objects
 Syntax and usage vary
   So similar, yet so different
 LOTS more detail – just not in this session
 Connects cmdlets
   One cmdlet outputs objects
   Next cmdlet uses them as input
 Pipeline is not a new concept
   Came From Unix/Linux
   PowerShell Pipes objects not text
 Connects output from a cmdlet to the input of
  another cmdlet
 Combination of the all cmdlets etc makes a
  pipeline
Process
              Object


Get-Process
  Cmdlet
                        Pipe



                                     Sort-Object
PS C:>   Get-Process | Sort-Object     Cmdlet
 Simple to use
   Just string cmdlets/scripts/functions together
   Simpler to write in many cases
 Very powerful in operation
   Lets PowerShell do the heavy lifting
 Integrates functionality stacks
     OS
     Application
     PowerShell Base
     Community
 A key concept in PowerShell
 Built-in help (Get-Help, Get-Command)
 Automatic linking to online help
 Huge PowerShell ecosystem – the community
   Social networking: eg Twitter, Facebook, etc
   Mailing lists and newsgroups
   Web sites and blogs
   User Groups
   3rd party support – free stuff coming!
Cmdlets, Objects, and the Pipeline


DEMO
 Variables contain objects during a session
 Variables named starting with ‘$’
     $myvariable = 42

 Variable’s Type is implied (or explicit)
     $myfoo = ls c:foo

 Variables can put objects into pipeline
     $myfoo | format-table name

 Variables can be reflected on
     $myfoo | get-member

 You can use variables in scripts and the command line
 Some variables come with PowerShell
   $PSVersionTable
   $PSHome

 Some variables tell PowerShell what to do
   $WarningPreference
   $MaximumHistoryCount

 You can create variables in Profile(s) that persist
   Using your profile (more later)
 See the variables in your current session
   ls Variable:
 Scalar variable contains a single value
   $i=42

 Can use properties/methods directly
   $i=42; $i.tostring("p")

 Use to calculate a value for use in formatting
   See more in discussion on Formatting (next session)
 Array variables contain multiple values/objects
 Array members addressed with [], e.g. $a[0]
   $a[0]   is first item in array
     $a[-1] is last item
 Use .GetType()
   $myfoo = LS c:foo
   $myfoo.gettype()
 Array members can be one or multiple types
   LS c: | Get-Member

 Arrays used with loops
 Special type of an array
   Also known as dictionary or property bag
 Contains a set of key/value pairs
   Values can be read automagically
    $ht=@{"singer"="Jerry Garcia“;
          "band"="Greatful Dead”}
    $ht.singer

 Value can be another hash table!
 See Get-Help   about_hash_tables
$ht = @{Firstname=“Thomas"; Surname="Lee";
Country="UK";Town="Cookham}
$ht | sort name | ft -a
Name      Value
----      -----
Surname   Lee
County    Berkshire
Town      Cookham
Firstname Thomas
Country   UK
 $ht = @{Firstname=“Thomas"; Surname="Lee";
    Country="UK";Town="Cookham}
   $ht.GetEnumerator() | sort name | ft -a
   Name      Value
   ----      -----
   Country   UK
   County    Berkshire
   Firstname Thomas
   Surname   Lee
   Town      Cookham
 Variables can be implicitly typed
   PowerShell works it out by default
     $I=42;$i.gettype()

 Variables can be explicitly typed
   [int64] $i = 42
   $i.gettype()

 Typing an expression
   $i = [int64] (55 – 13); $i.gettype()
   $i = [int64] 55 – [int32] 13; $i.gettype()
   $i = [int32] 55 – [int64] 13; $i.gettype()
Operator Type                   Operator
Arithmetic operator             +, -, *, /, %
                                See: about_arithmetic operator
Assignment operators            =, +=, -=, *=, /=, %=
                                See: about_assignment_operators
Comparison Operators            -eq, -ne, -gt, -lt, -le, -ge, -like,
                                -notlike, -match, -notmatch
                                -band, -bor, -bxor,-bnot
                                See: about_comparison_operators
Logical Operators               -and, -or, -xor –not, !
                                See: about_logical_operators



Also See Get-Help      about_operators
Operator Type           Operator
Redirection operators   >, >> 2> 2>&1
                        See: get-help about-redirection
Split/Join operators    -split, -join
                        See: about_split,about_join
Type operators          -is, -isnot, -as
                        See: about_type_operators
Urinary operators       ++, --
Operator Function              Operator
Call                           &
Property dereference           .
Range Operator                 ..
Format operator                -f
Subexpression operator         $( )
Array Subexpression operator   @( )
Array operator                 ,
 Variables plus operators
   Produce some value
   Value can be an object too!
 Simple expressions
   $i+1; $j-1; $k*2, $l/4

 Boolean expression
   General format is: <value> -<operator> <value>
   $a –gt $b
   $name –eq "Thomas Lee"
 History
   Redirection etc a historical reality
 Keep the parser simple
 PowerShell does more than simple ">"!!
   Case insensitive vs. case sensitive comparisons
 Lots!
 Modules
   Way of managing PowerShell code in an enterprise
 Remoting
   1:1 or 1:many Remoting
 XML Support
   Native XML
 More, more, more
   Discover, discover, discover!
Objects,Variables, Types, etc


DEMO
 Built in to Win7, Server 2008 R2
   On Server, add ISE Feature
   On Server Core PowerShell – add feature (and .NET)
 Down-level operating systems
   Shipped as an OS Patch with WinRM – KB 968929
   Get it from the net - http://tinyurl.com/pshr2rtm
   NB: Different versions i386 vs x64, XP/Vista/2008
   No version for IA64 or Windows 2000(Or earlier)
   Beware of search engine links to beta versions
 From the Console
   Start/PowerShell
 From the PowerShell ISE
   Start/PowerShellISE
 Part of an application
   GUI layered on PowerShell
   Application focused console
 Third Party IDEs
   PowerShell Plus
   PowerGUI
 Add third party tools
   There are lots!
 Using Built-in tools
   This will vary with what OS you use and which
    applications you are running
 Configure PowerShell using Profiles
 Special scripts that run at startup
 Multiple Profiles
   Per User vs. Per System
   Per PowerShell Console vs. for ALL consoles
   ISE profile – just for ISE
 Creating a profile
 Leveraging other people’s work
 If you use it - stick it in your profile!
 Set up prompt
     Function prompt {“Psh`[$(pwd)]: “}
 Add personal aliases
     Set-Alias gh get-help
 Create PSDrives
     New-PsDrive demo file e:pshdemo
 Set size/title of of PowerShell console
     $host.ui.rawui.WindowTitle = "PowerShell Rocks!!!"
     $host.ui.rawui.buffersize.width=120
     $host.ui.rawui.buffersize.height=9999
     $host.ui.rawui.windowsize.width=120
     $host.ui.rawui.windowsize.height=42
 Start with replacing CMD.Exe with PowerShell
 Get some good training
 Use shared code where possible
 Use great tools
 Don’t re-invent the wheel
 Leverage the community
 Official MOC
   6434 – 3 day based on PowerShell V1
   10325 – upcoming 5 day course (due 8/10)
 PowerShell Master Class
   http://www.powershellmasterclass.com
 New Horizons CWL
   V2 course coming
 Use your favorite search engine!!!
 PowerShell Owner’s Manual
   http://technet.microsoft.com/en-
    us/library/ee221100.aspx
 PowerShell – Getting Started Guide
   http://tinyurl.com/pshgsg
 PowerShell references
   http://www.reskit.net/psmc
 PowerShell is not just an IT Pro tool
 Developers need it too
   Build cmdlets
   Build providers
   Build Management GUIs
 More on this topic in some other day.
 PowerShell:
   Combines cmdlets, objects and the pipeline
   Provides a programming language and many more
    features we’ve not looked at today
   Enables local and remote management
   Is easy to get and easy to customise via profiles
   Is supported by discovery and a vibrant community
 PowerShell is the future of managing Windows
  and Windows applications
 I will answer what I can now


 More questions – email me at:
  doctordns@gmail.com
THE END

Contenu connexe

Tendances

Introduction to Perl - Day 1
Introduction to Perl - Day 1Introduction to Perl - Day 1
Introduction to Perl - Day 1Dave Cross
 
LPW: Beginners Perl
LPW: Beginners PerlLPW: Beginners Perl
LPW: Beginners PerlDave Cross
 
Subroutines in perl
Subroutines in perlSubroutines in perl
Subroutines in perlsana mateen
 
Dependency injection - phpday 2010
Dependency injection - phpday 2010Dependency injection - phpday 2010
Dependency injection - phpday 2010Fabien Potencier
 
PHP 良好實踐 (Best Practice)
PHP 良好實踐 (Best Practice)PHP 良好實踐 (Best Practice)
PHP 良好實踐 (Best Practice)Win Yu
 
Object Oriented PHP5
Object Oriented PHP5Object Oriented PHP5
Object Oriented PHP5Jason Austin
 
Perl programming language
Perl programming languagePerl programming language
Perl programming languageElie Obeid
 
PHP7. Game Changer.
PHP7. Game Changer. PHP7. Game Changer.
PHP7. Game Changer. Haim Michael
 
Introduction to Perl Best Practices
Introduction to Perl Best PracticesIntroduction to Perl Best Practices
Introduction to Perl Best PracticesJosé Castro
 
Improving Dev Assistant
Improving Dev AssistantImproving Dev Assistant
Improving Dev AssistantDave Cross
 
Php pattern matching
Php pattern matchingPhp pattern matching
Php pattern matchingJIGAR MAKHIJA
 
Shell scripting - By Vu Duy Tu from eXo Platform SEA
Shell scripting - By Vu Duy Tu from eXo Platform SEAShell scripting - By Vu Duy Tu from eXo Platform SEA
Shell scripting - By Vu Duy Tu from eXo Platform SEAThuy_Dang
 
Introduction To Php For Wit2009
Introduction To Php For Wit2009Introduction To Php For Wit2009
Introduction To Php For Wit2009cwarren
 

Tendances (20)

Functions in PHP
Functions in PHPFunctions in PHP
Functions in PHP
 
Introduction to Perl - Day 1
Introduction to Perl - Day 1Introduction to Perl - Day 1
Introduction to Perl - Day 1
 
LPW: Beginners Perl
LPW: Beginners PerlLPW: Beginners Perl
LPW: Beginners Perl
 
Subroutines in perl
Subroutines in perlSubroutines in perl
Subroutines in perl
 
Dependency injection - phpday 2010
Dependency injection - phpday 2010Dependency injection - phpday 2010
Dependency injection - phpday 2010
 
New in php 7
New in php 7New in php 7
New in php 7
 
Subroutines
SubroutinesSubroutines
Subroutines
 
PHP 良好實踐 (Best Practice)
PHP 良好實踐 (Best Practice)PHP 良好實踐 (Best Practice)
PHP 良好實踐 (Best Practice)
 
Object Oriented PHP5
Object Oriented PHP5Object Oriented PHP5
Object Oriented PHP5
 
Perl programming language
Perl programming languagePerl programming language
Perl programming language
 
Intro to Perl and Bioperl
Intro to Perl and BioperlIntro to Perl and Bioperl
Intro to Perl and Bioperl
 
PHP7. Game Changer.
PHP7. Game Changer. PHP7. Game Changer.
PHP7. Game Changer.
 
Introduction in php
Introduction in phpIntroduction in php
Introduction in php
 
Symfony2 - WebExpo 2010
Symfony2 - WebExpo 2010Symfony2 - WebExpo 2010
Symfony2 - WebExpo 2010
 
Introduction to Perl Best Practices
Introduction to Perl Best PracticesIntroduction to Perl Best Practices
Introduction to Perl Best Practices
 
Improving Dev Assistant
Improving Dev AssistantImproving Dev Assistant
Improving Dev Assistant
 
Php pattern matching
Php pattern matchingPhp pattern matching
Php pattern matching
 
Shell scripting - By Vu Duy Tu from eXo Platform SEA
Shell scripting - By Vu Duy Tu from eXo Platform SEAShell scripting - By Vu Duy Tu from eXo Platform SEA
Shell scripting - By Vu Duy Tu from eXo Platform SEA
 
Introduction in php part 2
Introduction in php part 2Introduction in php part 2
Introduction in php part 2
 
Introduction To Php For Wit2009
Introduction To Php For Wit2009Introduction To Php For Wit2009
Introduction To Php For Wit2009
 

En vedette

PowerShell from *nix user perspective
PowerShell from *nix user perspectivePowerShell from *nix user perspective
PowerShell from *nix user perspectiveJuraj Michálek
 
Gray Hat PowerShell - ShowMeCon 2015
Gray Hat PowerShell - ShowMeCon 2015Gray Hat PowerShell - ShowMeCon 2015
Gray Hat PowerShell - ShowMeCon 2015Ben Ten (0xA)
 
Managing VMware with PowerShell - VMworld 2008
Managing VMware with PowerShell - VMworld 2008Managing VMware with PowerShell - VMworld 2008
Managing VMware with PowerShell - VMworld 2008Carter Shanklin
 
[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...
[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...
[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...CODE BLUE
 
Client side attacks using PowerShell
Client side attacks using PowerShellClient side attacks using PowerShell
Client side attacks using PowerShellNikhil Mittal
 
PowerUp - Automating Windows Privilege Escalation
PowerUp - Automating Windows Privilege EscalationPowerUp - Automating Windows Privilege Escalation
PowerUp - Automating Windows Privilege EscalationWill Schroeder
 
PSConfEU - Offensive Active Directory (With PowerShell!)
PSConfEU - Offensive Active Directory (With PowerShell!)PSConfEU - Offensive Active Directory (With PowerShell!)
PSConfEU - Offensive Active Directory (With PowerShell!)Will Schroeder
 
Building an Empire with PowerShell
Building an Empire with PowerShellBuilding an Empire with PowerShell
Building an Empire with PowerShellWill Schroeder
 
Powershell Seminar @ ITWorx CuttingEdge Club
Powershell Seminar @ ITWorx CuttingEdge ClubPowershell Seminar @ ITWorx CuttingEdge Club
Powershell Seminar @ ITWorx CuttingEdge ClubEssam Salah
 
Practical PowerShell Programming for Professional People - Extended Edition
Practical PowerShell Programming for Professional People - Extended EditionPractical PowerShell Programming for Professional People - Extended Edition
Practical PowerShell Programming for Professional People - Extended EditionBen Ten (0xA)
 
Office 365 & PowerShell - A match made in heaven
Office 365 & PowerShell - A match made in heavenOffice 365 & PowerShell - A match made in heaven
Office 365 & PowerShell - A match made in heavenSébastien Levert
 
Better, Faster, Stronger! Boost Your Team-Based SharePoint Development Using ...
Better, Faster, Stronger! Boost Your Team-Based SharePoint Development Using ...Better, Faster, Stronger! Boost Your Team-Based SharePoint Development Using ...
Better, Faster, Stronger! Boost Your Team-Based SharePoint Development Using ...Richard Calderon
 
PowerShell Plus v4.7 Overview
PowerShell Plus v4.7 OverviewPowerShell Plus v4.7 Overview
PowerShell Plus v4.7 OverviewRichard Giles
 
Windows Server 2008 (PowerShell Scripting Uygulamaları)
Windows Server 2008 (PowerShell Scripting Uygulamaları)Windows Server 2008 (PowerShell Scripting Uygulamaları)
Windows Server 2008 (PowerShell Scripting Uygulamaları)ÇözümPARK
 
Power on, Powershell
Power on, PowershellPower on, Powershell
Power on, PowershellRoo7break
 
Managing Virtual Infrastructures With PowerShell
Managing Virtual Infrastructures With PowerShellManaging Virtual Infrastructures With PowerShell
Managing Virtual Infrastructures With PowerShellguesta849bc8b
 
Incorporating PowerShell into your Arsenal with PS>Attack
Incorporating PowerShell into your Arsenal with PS>AttackIncorporating PowerShell into your Arsenal with PS>Attack
Incorporating PowerShell into your Arsenal with PS>Attackjaredhaight
 
Getting Started With PowerShell Scripting
Getting Started With PowerShell ScriptingGetting Started With PowerShell Scripting
Getting Started With PowerShell ScriptingRavikanth Chaganti
 

En vedette (20)

PowerShell from *nix user perspective
PowerShell from *nix user perspectivePowerShell from *nix user perspective
PowerShell from *nix user perspective
 
Gray Hat PowerShell - ShowMeCon 2015
Gray Hat PowerShell - ShowMeCon 2015Gray Hat PowerShell - ShowMeCon 2015
Gray Hat PowerShell - ShowMeCon 2015
 
Managing VMware with PowerShell - VMworld 2008
Managing VMware with PowerShell - VMworld 2008Managing VMware with PowerShell - VMworld 2008
Managing VMware with PowerShell - VMworld 2008
 
[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...
[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...
[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...
 
Client side attacks using PowerShell
Client side attacks using PowerShellClient side attacks using PowerShell
Client side attacks using PowerShell
 
PowerUp - Automating Windows Privilege Escalation
PowerUp - Automating Windows Privilege EscalationPowerUp - Automating Windows Privilege Escalation
PowerUp - Automating Windows Privilege Escalation
 
I hunt sys admins 2.0
I hunt sys admins 2.0I hunt sys admins 2.0
I hunt sys admins 2.0
 
PSConfEU - Offensive Active Directory (With PowerShell!)
PSConfEU - Offensive Active Directory (With PowerShell!)PSConfEU - Offensive Active Directory (With PowerShell!)
PSConfEU - Offensive Active Directory (With PowerShell!)
 
Building an Empire with PowerShell
Building an Empire with PowerShellBuilding an Empire with PowerShell
Building an Empire with PowerShell
 
Powershell Seminar @ ITWorx CuttingEdge Club
Powershell Seminar @ ITWorx CuttingEdge ClubPowershell Seminar @ ITWorx CuttingEdge Club
Powershell Seminar @ ITWorx CuttingEdge Club
 
Practical PowerShell Programming for Professional People - Extended Edition
Practical PowerShell Programming for Professional People - Extended EditionPractical PowerShell Programming for Professional People - Extended Edition
Practical PowerShell Programming for Professional People - Extended Edition
 
Office 365 & PowerShell - A match made in heaven
Office 365 & PowerShell - A match made in heavenOffice 365 & PowerShell - A match made in heaven
Office 365 & PowerShell - A match made in heaven
 
Better, Faster, Stronger! Boost Your Team-Based SharePoint Development Using ...
Better, Faster, Stronger! Boost Your Team-Based SharePoint Development Using ...Better, Faster, Stronger! Boost Your Team-Based SharePoint Development Using ...
Better, Faster, Stronger! Boost Your Team-Based SharePoint Development Using ...
 
PowerShell Plus v4.7 Overview
PowerShell Plus v4.7 OverviewPowerShell Plus v4.7 Overview
PowerShell Plus v4.7 Overview
 
Windows Server 2008 (PowerShell Scripting Uygulamaları)
Windows Server 2008 (PowerShell Scripting Uygulamaları)Windows Server 2008 (PowerShell Scripting Uygulamaları)
Windows Server 2008 (PowerShell Scripting Uygulamaları)
 
Power on, Powershell
Power on, PowershellPower on, Powershell
Power on, Powershell
 
Managing Virtual Infrastructures With PowerShell
Managing Virtual Infrastructures With PowerShellManaging Virtual Infrastructures With PowerShell
Managing Virtual Infrastructures With PowerShell
 
PowerShell UIAtomation
PowerShell UIAtomationPowerShell UIAtomation
PowerShell UIAtomation
 
Incorporating PowerShell into your Arsenal with PS>Attack
Incorporating PowerShell into your Arsenal with PS>AttackIncorporating PowerShell into your Arsenal with PS>Attack
Incorporating PowerShell into your Arsenal with PS>Attack
 
Getting Started With PowerShell Scripting
Getting Started With PowerShell ScriptingGetting Started With PowerShell Scripting
Getting Started With PowerShell Scripting
 

Similaire à PowerShell 101

Power shell training
Power shell trainingPower shell training
Power shell trainingDavid Brabant
 
Introduction to PowerShell
Introduction to PowerShellIntroduction to PowerShell
Introduction to PowerShellBoulos Dib
 
NIIT ISAS Q5 Report - Windows PowerShell
NIIT ISAS Q5 Report - Windows PowerShellNIIT ISAS Q5 Report - Windows PowerShell
NIIT ISAS Q5 Report - Windows PowerShellPhan Hien
 
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.pdfClapperboardCinemaPV
 
PowerShell Core Skills (TechMentor Fall 2011)
PowerShell Core Skills (TechMentor Fall 2011)PowerShell Core Skills (TechMentor Fall 2011)
PowerShell Core Skills (TechMentor Fall 2011)Concentrated Technology
 
PowerShell Workshop Series: Session 2
PowerShell Workshop Series: Session 2PowerShell Workshop Series: Session 2
PowerShell Workshop Series: Session 2Bryan Cafferky
 
Powershell Training
Powershell TrainingPowershell Training
Powershell TrainingFahad Noaman
 
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 PowershellSharePoint 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 PowershellSharePoint Saturday NY
 
Working Effectively With Legacy Perl Code
Working Effectively With Legacy Perl CodeWorking Effectively With Legacy Perl Code
Working Effectively With Legacy Perl Codeerikmsp
 
Introduction to PowerShell
Introduction to PowerShellIntroduction to PowerShell
Introduction to PowerShellSalaudeen Rajack
 
Simplify your professional web development with symfony
Simplify your professional web development with symfonySimplify your professional web development with symfony
Simplify your professional web development with symfonyFrancois Zaninotto
 
PowerShell for SharePoint Developers
PowerShell for SharePoint DevelopersPowerShell for SharePoint Developers
PowerShell for SharePoint DevelopersBoulos Dib
 
SVCC 5 introduction to powershell
SVCC 5 introduction to powershellSVCC 5 introduction to powershell
SVCC 5 introduction to powershellqawarrior
 
Get-Help: An intro to PowerShell and how to Use it for Evil
Get-Help: An intro to PowerShell and how to Use it for EvilGet-Help: An intro to PowerShell and how to Use it for Evil
Get-Help: An intro to PowerShell and how to Use it for Eviljaredhaight
 
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 PowerShellShane Hoey
 

Similaire à PowerShell 101 (20)

Power shell training
Power shell trainingPower shell training
Power shell training
 
Introduction to PowerShell
Introduction to PowerShellIntroduction to PowerShell
Introduction to PowerShell
 
No-script PowerShell v2
No-script PowerShell v2No-script PowerShell v2
No-script PowerShell v2
 
NIIT ISAS Q5 Report - Windows PowerShell
NIIT ISAS Q5 Report - Windows PowerShellNIIT ISAS Q5 Report - Windows PowerShell
NIIT ISAS Q5 Report - Windows PowerShell
 
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
 
PowerShell Core Skills (TechMentor Fall 2011)
PowerShell Core Skills (TechMentor Fall 2011)PowerShell Core Skills (TechMentor Fall 2011)
PowerShell Core Skills (TechMentor Fall 2011)
 
PowerShell Workshop Series: Session 2
PowerShell Workshop Series: Session 2PowerShell Workshop Series: Session 2
PowerShell Workshop Series: Session 2
 
Powershell Training
Powershell TrainingPowershell Training
Powershell Training
 
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
 
Working Effectively With Legacy Perl Code
Working Effectively With Legacy Perl CodeWorking Effectively With Legacy Perl Code
Working Effectively With Legacy Perl Code
 
Introduction to PowerShell
Introduction to PowerShellIntroduction to PowerShell
Introduction to PowerShell
 
Simplify your professional web development with symfony
Simplify your professional web development with symfonySimplify your professional web development with symfony
Simplify your professional web development with symfony
 
Powershell notes
Powershell notesPowershell notes
Powershell notes
 
PowerShell for SharePoint Developers
PowerShell for SharePoint DevelopersPowerShell for SharePoint Developers
PowerShell for SharePoint Developers
 
SVCC 5 introduction to powershell
SVCC 5 introduction to powershellSVCC 5 introduction to powershell
SVCC 5 introduction to powershell
 
Get-Help: An intro to PowerShell and how to Use it for Evil
Get-Help: An intro to PowerShell and how to Use it for EvilGet-Help: An intro to PowerShell and how to Use it for Evil
Get-Help: An intro to PowerShell and how to Use it for Evil
 
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
 
Best practices tekx
Best practices tekxBest practices tekx
Best practices tekx
 
Php i basic chapter 3
Php i basic chapter 3Php i basic chapter 3
Php i basic chapter 3
 

Plus de Thomas Lee

PowerShell 101 - What is it and Why should YOU Care!
PowerShell 101 - What is it and Why should YOU Care!PowerShell 101 - What is it and Why should YOU Care!
PowerShell 101 - What is it and Why should YOU Care!Thomas Lee
 
Doing Azure With PowerShell
Doing Azure With PowerShellDoing Azure With PowerShell
Doing Azure With PowerShellThomas Lee
 
2016 spice world_london_breakout
2016 spice world_london_breakout2016 spice world_london_breakout
2016 spice world_london_breakoutThomas Lee
 
2015 spice world_london_breakout
2015 spice world_london_breakout2015 spice world_london_breakout
2015 spice world_london_breakoutThomas Lee
 
Three cool cmdlets I wish PowerShell Had!
Three cool cmdlets I wish PowerShell Had!Three cool cmdlets I wish PowerShell Had!
Three cool cmdlets I wish PowerShell Had!Thomas Lee
 
2014 SpiceWorld London Breakout
2014 SpiceWorld London Breakout2014 SpiceWorld London Breakout
2014 SpiceWorld London BreakoutThomas Lee
 
Formatting With PowerShell
Formatting With PowerShell Formatting With PowerShell
Formatting With PowerShell Thomas Lee
 
Top 10 PowerShell Features in Server 2012
Top 10 PowerShell Features in Server 2012Top 10 PowerShell Features in Server 2012
Top 10 PowerShell Features in Server 2012Thomas Lee
 
Coping with Murphy’s Law
Coping with Murphy’s LawCoping with Murphy’s Law
Coping with Murphy’s LawThomas Lee
 
Deep dive formatting
Deep dive formattingDeep dive formatting
Deep dive formattingThomas Lee
 

Plus de Thomas Lee (10)

PowerShell 101 - What is it and Why should YOU Care!
PowerShell 101 - What is it and Why should YOU Care!PowerShell 101 - What is it and Why should YOU Care!
PowerShell 101 - What is it and Why should YOU Care!
 
Doing Azure With PowerShell
Doing Azure With PowerShellDoing Azure With PowerShell
Doing Azure With PowerShell
 
2016 spice world_london_breakout
2016 spice world_london_breakout2016 spice world_london_breakout
2016 spice world_london_breakout
 
2015 spice world_london_breakout
2015 spice world_london_breakout2015 spice world_london_breakout
2015 spice world_london_breakout
 
Three cool cmdlets I wish PowerShell Had!
Three cool cmdlets I wish PowerShell Had!Three cool cmdlets I wish PowerShell Had!
Three cool cmdlets I wish PowerShell Had!
 
2014 SpiceWorld London Breakout
2014 SpiceWorld London Breakout2014 SpiceWorld London Breakout
2014 SpiceWorld London Breakout
 
Formatting With PowerShell
Formatting With PowerShell Formatting With PowerShell
Formatting With PowerShell
 
Top 10 PowerShell Features in Server 2012
Top 10 PowerShell Features in Server 2012Top 10 PowerShell Features in Server 2012
Top 10 PowerShell Features in Server 2012
 
Coping with Murphy’s Law
Coping with Murphy’s LawCoping with Murphy’s Law
Coping with Murphy’s Law
 
Deep dive formatting
Deep dive formattingDeep dive formatting
Deep dive formatting
 

Dernier

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 

Dernier (20)

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 

PowerShell 101

  • 1. Thomas Lee (tfl@psp.co.uk) MCT and PowerShell MVP POWERSHELL 101 – WHAT IS IT AND WHY IT MATTERS
  • 2.  What IS PowerShell?  What are Cmdlets, Objects and the Pipeline?  Language fundamentals  How do I install and setup PowerShell>  How do I use PowerShell?  PowerShell profiles  Getting the most from PowerShell  Why does it matter?
  • 3.  PowerShell is  Microsoft’s task automation platform.  Part of Microsoft’s Common Engineering Criteria  Included with every version of Windows 7/Server 2008 R2 (and as a OS patch for earlier versions)  In a couple of years, if you don’t know PowerShell you may not have a job as an IT Pro!
  • 4.  Shell  Unix like (console.exe)  Lightweight IDE (sort of VS Lite)  Scripting Language  Power of Perl/Ruby  Extensible  Create your own cmdlets/providers/types/etc  Leverage the community  Built on .NET and Windows  MS-centric/MS-focused
  • 5.
  • 6.
  • 7. Cmdlets Objects Pipeline
  • 8.  The fundamental unit of functionality  Implemented as a .NET Class  Get some, buy some, find some, or build your own  Cmdlets take parameters  Parameters have names (prefaced with “-”)  Parameter names can be abbreviated  Cmdlets can have aliases  Built in or add your own  Aliases do NOT include parameter aliasing 
  • 9.  A computer abstraction of a real life thing  A process  A server  An AD User  Objects have occurrences you manage  The processes running on a computer  The users in an OU  The files in a folder
  • 10.  PowerShell supports:  .NET objects  COM objects  WMI objects  Syntax and usage vary  So similar, yet so different  LOTS more detail – just not in this session
  • 11.  Connects cmdlets  One cmdlet outputs objects  Next cmdlet uses them as input  Pipeline is not a new concept  Came From Unix/Linux  PowerShell Pipes objects not text
  • 12.  Connects output from a cmdlet to the input of another cmdlet  Combination of the all cmdlets etc makes a pipeline
  • 13. Process Object Get-Process Cmdlet Pipe Sort-Object PS C:> Get-Process | Sort-Object Cmdlet
  • 14.  Simple to use  Just string cmdlets/scripts/functions together  Simpler to write in many cases  Very powerful in operation  Lets PowerShell do the heavy lifting  Integrates functionality stacks  OS  Application  PowerShell Base  Community
  • 15.  A key concept in PowerShell  Built-in help (Get-Help, Get-Command)  Automatic linking to online help  Huge PowerShell ecosystem – the community  Social networking: eg Twitter, Facebook, etc  Mailing lists and newsgroups  Web sites and blogs  User Groups  3rd party support – free stuff coming!
  • 16. Cmdlets, Objects, and the Pipeline DEMO
  • 17.  Variables contain objects during a session  Variables named starting with ‘$’  $myvariable = 42  Variable’s Type is implied (or explicit)  $myfoo = ls c:foo  Variables can put objects into pipeline  $myfoo | format-table name  Variables can be reflected on  $myfoo | get-member  You can use variables in scripts and the command line
  • 18.  Some variables come with PowerShell  $PSVersionTable  $PSHome  Some variables tell PowerShell what to do  $WarningPreference  $MaximumHistoryCount  You can create variables in Profile(s) that persist  Using your profile (more later)  See the variables in your current session  ls Variable:
  • 19.  Scalar variable contains a single value  $i=42  Can use properties/methods directly  $i=42; $i.tostring("p")  Use to calculate a value for use in formatting  See more in discussion on Formatting (next session)
  • 20.  Array variables contain multiple values/objects  Array members addressed with [], e.g. $a[0]  $a[0] is first item in array  $a[-1] is last item  Use .GetType()  $myfoo = LS c:foo  $myfoo.gettype()  Array members can be one or multiple types  LS c: | Get-Member  Arrays used with loops
  • 21.  Special type of an array  Also known as dictionary or property bag  Contains a set of key/value pairs  Values can be read automagically $ht=@{"singer"="Jerry Garcia“; "band"="Greatful Dead”} $ht.singer  Value can be another hash table!  See Get-Help about_hash_tables
  • 22. $ht = @{Firstname=“Thomas"; Surname="Lee"; Country="UK";Town="Cookham} $ht | sort name | ft -a Name Value ---- ----- Surname Lee County Berkshire Town Cookham Firstname Thomas Country UK
  • 23.  $ht = @{Firstname=“Thomas"; Surname="Lee"; Country="UK";Town="Cookham}  $ht.GetEnumerator() | sort name | ft -a  Name Value  ---- -----  Country UK  County Berkshire  Firstname Thomas  Surname Lee  Town Cookham
  • 24.  Variables can be implicitly typed  PowerShell works it out by default  $I=42;$i.gettype()  Variables can be explicitly typed  [int64] $i = 42  $i.gettype()  Typing an expression  $i = [int64] (55 – 13); $i.gettype()  $i = [int64] 55 – [int32] 13; $i.gettype()  $i = [int32] 55 – [int64] 13; $i.gettype()
  • 25. Operator Type Operator Arithmetic operator +, -, *, /, % See: about_arithmetic operator Assignment operators =, +=, -=, *=, /=, %= See: about_assignment_operators Comparison Operators -eq, -ne, -gt, -lt, -le, -ge, -like, -notlike, -match, -notmatch -band, -bor, -bxor,-bnot See: about_comparison_operators Logical Operators -and, -or, -xor –not, ! See: about_logical_operators Also See Get-Help about_operators
  • 26. Operator Type Operator Redirection operators >, >> 2> 2>&1 See: get-help about-redirection Split/Join operators -split, -join See: about_split,about_join Type operators -is, -isnot, -as See: about_type_operators Urinary operators ++, --
  • 27. Operator Function Operator Call & Property dereference . Range Operator .. Format operator -f Subexpression operator $( ) Array Subexpression operator @( ) Array operator ,
  • 28.  Variables plus operators  Produce some value  Value can be an object too!  Simple expressions  $i+1; $j-1; $k*2, $l/4  Boolean expression  General format is: <value> -<operator> <value>  $a –gt $b  $name –eq "Thomas Lee"
  • 29.  History  Redirection etc a historical reality  Keep the parser simple  PowerShell does more than simple ">"!!  Case insensitive vs. case sensitive comparisons
  • 30.  Lots!  Modules  Way of managing PowerShell code in an enterprise  Remoting  1:1 or 1:many Remoting  XML Support  Native XML  More, more, more  Discover, discover, discover!
  • 32.  Built in to Win7, Server 2008 R2  On Server, add ISE Feature  On Server Core PowerShell – add feature (and .NET)  Down-level operating systems  Shipped as an OS Patch with WinRM – KB 968929  Get it from the net - http://tinyurl.com/pshr2rtm  NB: Different versions i386 vs x64, XP/Vista/2008  No version for IA64 or Windows 2000(Or earlier)  Beware of search engine links to beta versions
  • 33.  From the Console  Start/PowerShell  From the PowerShell ISE  Start/PowerShellISE  Part of an application  GUI layered on PowerShell  Application focused console  Third Party IDEs  PowerShell Plus  PowerGUI
  • 34.  Add third party tools  There are lots!  Using Built-in tools  This will vary with what OS you use and which applications you are running  Configure PowerShell using Profiles
  • 35.  Special scripts that run at startup  Multiple Profiles  Per User vs. Per System  Per PowerShell Console vs. for ALL consoles  ISE profile – just for ISE  Creating a profile  Leveraging other people’s work  If you use it - stick it in your profile!
  • 36.  Set up prompt  Function prompt {“Psh`[$(pwd)]: “}  Add personal aliases  Set-Alias gh get-help  Create PSDrives  New-PsDrive demo file e:pshdemo  Set size/title of of PowerShell console  $host.ui.rawui.WindowTitle = "PowerShell Rocks!!!"  $host.ui.rawui.buffersize.width=120  $host.ui.rawui.buffersize.height=9999  $host.ui.rawui.windowsize.width=120  $host.ui.rawui.windowsize.height=42
  • 37.  Start with replacing CMD.Exe with PowerShell  Get some good training  Use shared code where possible  Use great tools  Don’t re-invent the wheel  Leverage the community
  • 38.  Official MOC  6434 – 3 day based on PowerShell V1  10325 – upcoming 5 day course (due 8/10)  PowerShell Master Class  http://www.powershellmasterclass.com  New Horizons CWL  V2 course coming
  • 39.  Use your favorite search engine!!!  PowerShell Owner’s Manual  http://technet.microsoft.com/en- us/library/ee221100.aspx  PowerShell – Getting Started Guide  http://tinyurl.com/pshgsg  PowerShell references  http://www.reskit.net/psmc
  • 40.  PowerShell is not just an IT Pro tool  Developers need it too  Build cmdlets  Build providers  Build Management GUIs  More on this topic in some other day.
  • 41.  PowerShell:  Combines cmdlets, objects and the pipeline  Provides a programming language and many more features we’ve not looked at today  Enables local and remote management  Is easy to get and easy to customise via profiles  Is supported by discovery and a vibrant community  PowerShell is the future of managing Windows and Windows applications
  • 42.  I will answer what I can now  More questions – email me at: doctordns@gmail.com