introduction to powershell n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Introduction to PowerShell PowerPoint Presentation
Download Presentation
Introduction to PowerShell

Loading in 2 Seconds...

play fullscreen
1 / 28

Introduction to PowerShell - PowerPoint PPT Presentation


  • 119 Views
  • Uploaded on

Introduction to PowerShell. James Boother Email: james@boother.co.uk Twitter: @jimmyboo Blog: http://www.boother.co.uk. Agenda. A brief history lesson Don’t be scared everything’s familiar What’s new in 2.0 ? Scripting IDE’s Profiles Cmdlets and Variables Providers Resources.

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 'Introduction to PowerShell' - kim


Download Now 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
introduction to powershell

Introduction to PowerShell

James Boother

Email: james@boother.co.uk

Twitter: @jimmyboo

Blog: http://www.boother.co.uk

agenda
Agenda
  • A brief history lesson
  • Don’t be scared everything’s familiar
  • What’s new in 2.0?
  • Scripting IDE’s
  • Profiles
  • Cmdlets and Variables
  • Providers
  • Resources
how do i get powershell installed
How do I get PowerShell installed?
  • PowerShell 2 Pre-Installed on Windows 7 and Windows Server 2008 R2
  • Can be installed on Windows XP and Windows Server 2003 & 2008
    • Download from http://support.microsoft.com/kb/968929 - Windows Management Framework
what s new in version 2
What’s new in version 2?
  • Remoting
  • Integrated Scripting Environment
  • Modules
  • Advanced functions
  • Background jobs
  • Eventing
  • Script internationalisation
  • Script debugging
  • New cmdlets
scripting ides
Scripting IDEs
  • Notepad++
  • Microsoft’s Interactive Scripting Environment (Part of PowerShell 2)
  • PowerGui
  • Visual Studio VSX – Adam Driscoll
getting help
Getting Help
  • Get-Help commandlet
  • F1 in ISE
  • Autocomplete in PowerGui & VSX
  • Visual Search on Bing
powershell profiles
PowerShell Profiles
  • A PowerShell script that is run by the PowerShell host on launch
  • I’ve created a global profile to be run by all users and all hosts
  • Create C:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1
  • Why?
    • Add Visual Studio Environment Variables
    • Add SQL Server Environment Variables
    • Load Dlls into memory
cmdlets
cmdlets
  • Main building block of PowerShell Scripts
  • Mini Commands that perform one action
  • Common naming convention: Verb then Noun
  • e.g.: Get-Help, Get-Object, Remove-Item
  • Actually .NET Classes that can easily be created if new functionality is required
  • The output of one Cmdlet can be piped into further cmdlets using the | operator
  • Destructive CmdLets have –WhatIf parameter
variables
Variables
  • Defined by a name prceeded by a dollar sign (“$”)
  • When working in the pipeline (“$_”) is the current item
  • A single equals character is used for assignment e.g. $a = 1 or $a = $b
  • Equality test with expressions such as –eq–ne –gt –ge –lt –le –like –and -or
  • Strings in double quotes automatically replace variables with their value.
    • To prevent this from happening use single quotes ‘Some test $no replacement here”
  • If you want to include carriage returns format your string like this @”…”@
providers
Providers
  • Providers are .net libraries. The SQL Server team created a provider
wmi script
WMI Script
  • Full access to WMI from within Powershell:
scheduling scripts
Scheduling Scripts
  • SQL Server Agent or windows Task Scheduler
summary
Summary
  • Powerful object based scripting engine
  • Backwards compatible so you can start from what you already know
  • Full access to File System; Registry; WMI; COM; .NET Objects and SQL Server
  • Simple to schedule using Windows Scheduled Tasks or SQL Jobs
  • Extensible through .NET
web resources
Web Resources
  • Master-PowerShell | With Dr Tobias Weltner http://powershell.com/cs/blogs/ebook/default.aspx
  • The Scripting Centre http://technet.microsoft.com/en-gb/scriptcenter/dd742419.aspx
  • PowerShell owners manual http://technet.microsoft.com/en-us/library/ee221100.aspx
  • PowerShell team blog http://blogs.msdn.com/b/powershell/
  • Adam Driscoll – Visual Studio PowerGUI VSX - http://visualstudiogallery.msdn.microsoft.com/01516103-d487-4a7e-bb40-c15ec709afa3/
  • Setting SQL Environment Variables
    • http://sqlblogcasts.com/blogs/martinbell/archive/2009/09/06/Using-SQL-Server-in-Powershell-outside-of-SQLPS.aspx
questions
Questions
  • If you have any questions now’s your chance…
thank you
Thank you
  • Thank you for attending Automating admin tasks with PowerShell
  • if you have any further questions please see my contact details here:
    • Email: james@boother.co.uk
    • Twitter: @jimmyboo
    • Blog: http://www.boother.co.uk
  • Happy scripting!