windows powershell introduction
Download
Skip this Video
Download Presentation
Windows PowerShell Introduction

Loading in 2 Seconds...

play fullscreen
1 / 28

Windows PowerShell Introduction - PowerPoint PPT Presentation


  • 114 Views
  • Uploaded on

Windows PowerShell Introduction. Morgan Simonsen [email protected] Ementor. 1. What Will We Cover?. What is Windows PowerShell? How does Windows PowerShell work? How can I use Windows PowerShell?. 2. Helpful Experience. Command line experience; cmd.exe, BASH etc.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Windows PowerShell Introduction' - rowa


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
what will we cover
What Will We Cover?
  • What is Windows PowerShell?
  • How does Windows PowerShell work?
  • How can I use Windows PowerShell?

2

helpful experience
Helpful Experience
  • Command line experience; cmd.exe, BASH etc.
  • Command line experience; parameters, output etc.
  • Scripting experience (PERL, VBScript, JScript) etc.)

Level 200

3

microsoft products providing windows powershell cmdlets

Microsoft Products Providing Windows PowerShell Cmdlets

Windows Server “Longhorn”

Windows Vista

Exchange Server 2007

Operations Manager 2007

Virtual Machine Manager

Data Protection Manager “V2”

4

why powershell
Why PowerShell?
  • As companiesscale-out; managementbecomesvery hard
  • Currenttechnologies; VBScript, WMI, RDP
  • PowerShell willprovide a unifiedmanagementexperience

5

admin development model
Admin Development Model
  • Try things out in an interactive shell
  • Stitch things together with utilities
  • Put the results in a script file
    • Realize that the tools are unsuitable and restart with a new set of tools
  • Generalize (e.g., parameterize)
  • Clean it up  production-quality
  • Integrate into your environment
  • Share with the community

7

introducing windows powershell
Introducing Windows PowerShell
  • New Windows command-lineshelldesigned for system administrators
  • Interactive prompt and scripting environment
  • Builton .NET CommonLanguageRuntime (CLR) and .NET Framework

8

powershell design goals
PowerShell Design Goals
  • Easeofuse
  • Consisencyofsyntax
  • Easeoflearningcurve

9

how is powershell different
How is PowerShell different?
  • PS processesobjects, not text
  • Large set (>100) ofbuilt in commandswithcosistentinterface
  • Commoncommand parser
  • Can run all existingutilities, tools
  • Multiple commandswithoutbatch files (;)

10

getting and installing powershell
Getting and installing PowerShell
  • Microsoft Downloadsite
  • x86/x64 versionsavailable
  • Installationrequirements:
    • Windows XP SP2, Windows Server 2003 SP1 or later versionsof Windows
    • .NET Framework 2.0

11

getting and installing powershell continued
Getting and installing PowerShell Continued
  • WinXP, W2K3 Srv: Update.exeinstall
  • Vista/W2K8 Srv: .msu (componentbasedinstall)
  • Install locations:
    • X86:
      • %systemroot%\system32\WindowsPowerShell\V1.0
    • X64:
      • %systemroot%\system32\WindowsPowerShell\V1.0
      • %systemroot%\Syswow64\WindowsPowerShell\V1.0

12

starting powershell
Starting PowerShell
  • Powershell.exe <parameters>
    • powershell-psconsolefile sqlsnapin.psc1
    • powershell-version 1.0 -nologo -inputformat text -outputformat XML
    • powershell-command {get-eventlog-lognamesecurity}
    • powershell-command "& {get-eventlog-lognamesecurity}”
  • Start Menu

13

cmdlets command lets
Cmdlets (Command-lets)
  • Built-in, single-featurecommandsthatmanipulateobjects in PS
  • Small and simple, designed to be used togetherwithother cmdlets (pipelining)
  • Comeswithbuilt-inhelp (Get-Help)
  • Use a Verb-Nounnames (Get-Service, Set-Service)

14

cmdlets command lets structure
Cmdlets (Command-lets) Structure

Name Alias Server StorageQuota

---- ---- ------ ------------

Bob Kelly bobk smbex01 unlimited

Kim Akers kima smbex01 unlimited

Property Names

Property Values

Name

Argument

String

Verb

Noun

MSH> get-mailbox –server “smbex01”

Command

Parameter

15

cmdlet parameters
Cmdlet parameters
  • Alwaysidentified by -, never /, -- or \
  • Supports concatenation:get-help <command> -det
  • Namescan be omitted:get-help –nameget-alias = get-helpget-alias

16

getting help in ps
Gettinghelp in PS
  • Get-Helpcmdlet
  • Get-Help <cmdlet>eg. Get-HelpGet-Commandeg. Get-HelpGet-Command –detailedeg. Get-HelpGet-Command –fulleg. Get-HelpGet-Command-examples
  • Get-Helpabout_signing

17

getting help the 4 pillars of discoverability
Getting help: The 4 Pillars of Discoverability

Get-Command

Get-Help and -?

Get-PSDrive

Get-Members

18

processing objects
ProcessingObjects
  • PS workswith .NET Objects
  • .NET Objectscontain:
    • Data
    • Properties
    • Methods

19

learning about objects
Learningaboutobjects
  • Get-Member: displays informationabout .NET objects a cmdletreturnsget-service | get-member

20

formatting output
Formatting Output
  • PS cmdlets never format data
  • Format cmdlets format data
    • Format-List
    • Format-Table
    • Format-Custom
    • Format-Wide
  • Everycmdlet has default formatting basedonthe format cmdlets, whichyoucan override

21

aliases
Aliases
  • PS has severalaliases by default (dir, ls, cls, del etc)
  • Display aliases:get-alias
  • Create alias:set-aliasghGet-Help
  • Delete alias:remove-itemalias:gh

22

some useful cmdlets
Someuseful cmdlets
  • Get-Command
  • Get-Childitem
  • Get-ChildItemProperty
  • Get-Service
  • Get-WMIObject
  • Invoke-Item

23

using windows programs
Using Windows Programs
  • PS can run all Windows programs
  • Must be in pathstatement($env:path)
  • List:Get-Command *.exe
  • Aliases do not support itsnamesake’sparamteres

24

tab completion
Tab Completion
  • PS support Tab completions for:
    • Cmdletnames
    • Registrypaths
    • Filesystem paths
    • Certificatepaths

25

pipelining
Pipelining
  • Cmdlets can be ”piped” together to form complexcommands
  • Output from onecmdletmovealongthe pipe to anothercmdlet
  • PS pipeline operator is | (pipe)

26

for more information
For More Information
  • Windows PowerShell Team blog at: http://blogs.msdn.com/PowerShell
  • Windows PowerShell ScriptCenter at: http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx

27

ad