16
POWERSHELL BASICS What do you need to know to get started?

[Webinar] PowerShell Series Part 1 – Introduction to PowerShell

Embed Size (px)

DESCRIPTION

Windows PowerShell is a task-based command-line shell and scripting language designed for system administration. If you haven't had the chance to learn how to use it, now is the time!

Citation preview

Page 1: [Webinar] PowerShell Series Part 1 – Introduction to PowerShell

POWERSHELL BASICSWhat do you need to know to get started?

Page 2: [Webinar] PowerShell Series Part 1 – Introduction to PowerShell

Welcome

• Kevin Sullivan– [email protected]– @kevsully67

• Director of Sales Engineering• Recovering GP MVP, Musician• Previously Principal Program Manager at

Microsoft• Technology lover – geek dad

WHOAMI

Page 3: [Webinar] PowerShell Series Part 1 – Introduction to PowerShell

Specops Software

• Focused on the IT Professional, systems administrator

• Making the complex easy• Password Management• Desktop Management• http://www.specopssoft.com

SPECOPS

Page 4: [Webinar] PowerShell Series Part 1 – Introduction to PowerShell

Agenda

• Why PowerShell?• The Basics

– The consoles– cmdlets, objects, pipeline – oh my– The help system– Console output– Formatting output

• Wrap-up – questions – what’s to come?

SETTING EXPECTATIONS

Page 5: [Webinar] PowerShell Series Part 1 – Introduction to PowerShell

THE BEGINNING

“The secret of getting ahead is getting started”

- Mark Twain

Page 6: [Webinar] PowerShell Series Part 1 – Introduction to PowerShell

Why PowerShell

• Some History– Monad Manifesto – Vision paper that kicked off

PowerShell - <2002– WMIC, NetSH – previous shells

• Monad – Gottfried Leibniz – 1714– Monad as a simple substance – cannot be divided– Compound substances are aggregates of monads

• COM, WMI etc. are powerful and hard to access• Previous scripting environments (cscript) were

leaving open vulnerabilities• Do complex things ‘simply’

WHY AM I HERE?

Page 7: [Webinar] PowerShell Series Part 1 – Introduction to PowerShell

The Challenge

• The learning curve• Experts get bored talking about basics• Learning basics is critical path• Three audiences (at least)

1. Systems Administrators2. Scripters (not always the same as #1)3. Developers

• Make complex tasks simple– This also defines Specops and our vision

REALLY WHAT AM I DOING HERE?

Page 8: [Webinar] PowerShell Series Part 1 – Introduction to PowerShell

The Basics

• The console(s)• cmdlets, objects, pipeline – oh my• The help system• Formatting output

FINALLY SOME POWERSHELL

Page 9: [Webinar] PowerShell Series Part 1 – Introduction to PowerShell

PowerShell Console(s)

• Two main options to consider• PowerShell console• Integrated Scripting Environment (ISE)• PSReadline

– http://www.hanselman.com/blog/TowardsABetterConsolePSReadlineForPowerShellCommandLineEditing.aspx

– Not sure about this yet but take a look

• Let’s take a look

USE THE ISE

Page 10: [Webinar] PowerShell Series Part 1 – Introduction to PowerShell

PowerShell ISE

• IntelliSense• Scripting Tools

– Scripting pane (<CTRL + R>)– Debugging

• Command Add-on• New PowerShell Tab• New Remote PowerShell Tab

DID I SAY USE THE ISE?

Page 11: [Webinar] PowerShell Series Part 1 – Introduction to PowerShell

PowerShell Internals

• Cmdlets• Modules• PS Snapins• Objects• Pipeline• Providers • Aliases, shortcuts• $Profile – what does this do?• $PSVersionTable

PEELING BACK THE ONION

Page 12: [Webinar] PowerShell Series Part 1 – Introduction to PowerShell

PowerShell Help SystemIt’s like sliced bread!

• Update-Help• Get-Command• Command add-on• Get-Help

– Detailed– Full– Examples– Show-Windows– Online

HELP! HELP! HELP!

Page 13: [Webinar] PowerShell Series Part 1 – Introduction to PowerShell

Console output

• Format-Table• Format-List• Format right…

WHAT YOU ASK FOR IS WHAT YOU GET

Page 14: [Webinar] PowerShell Series Part 1 – Introduction to PowerShell

Wrap-up

• Questions• Next month?• Send feedback• [email protected]

WHAT DOES THE FUTURE BRING?

Page 15: [Webinar] PowerShell Series Part 1 – Introduction to PowerShell

Resources• Learn PowerShell in a Month of Lunches – Don

Jones @concentrateddon, Jeffery Hicks @jeffHicks• Learn PowerShell Tool Making in a Month of

Lunches – Don Jones, Jeffery Hicks• Follow

– Jeffery Snover @jsnover– MSFT Scripting Guys @scriptingGuys– June Blender @juneb_get_help– Lee Holmes @lee_holmes– /r/powershell @r_powershell– PowerShell Tips @powerTip– PowerShell.org @PSHOrg

LOTS OF RESOURCES

Page 16: [Webinar] PowerShell Series Part 1 – Introduction to PowerShell

Resources• http://www.powershellpro.com

– Some great tutorials

• http://powershell.org• http://technet.Microsoft.com/scriptcenter

– Repository!

• http://jdhitsolutions.com/blog– Jeff Hicks

• PowerShell help system!• http://www.specopssoft.com• http://success.specopssoft.com

LOTS OF RESOURCES