SlideShare a Scribd company logo
Windows PowerShellJohn Claytonhttp://codemonkeylabs.com/
Next generation command line shellProcesses objects instead of plain textLarge set of built-in commandsConsistent command parserScripting languageDesigned for managing .NET objectsProvides a consistent environment for using cmdletsSupports complex tasks without making simple tasks more complexWhat is it?
Built on .NETUnderlying objects are .NETExtensible via cmdlets, providers, & host applicationsTargeted at IT professionalsSupported by the latest server productsAn astonishing amount can be accomplished without any programmingTechNet Script Center has hundreds of resourcesWhat is it? (cont.)
Using Windows PowerShellPrepare to be amazed
All commands use a Verb-Noun syntaxSelf-describing, discoverable environmentTab expansionCommand aliasesBrings in native applications & utilitiesObject pipelineFormattingNavigationFilteringScriptingThe Shell
Get-Command
Get-Command
Get-Command
Get-Help
Get-PSDrive
Get-Member
Command Aliases
Native Applications
Object pipeline
Formatting
Navigation
Navigation
Navigation
Filtering, Looping, & Selecting
Scripting
Scripting
Scripting
Scripting
Extending Windows PowerShellIf built in it is not, make it you shall
Creating CmdletsIn a class library reference System.Management.AutomationHint: It’s not in the GAC!
Creating CmdletsIn a class library reference System.Configuration.Install
Creating CmdletsAdd a class and build your cmdlet
Creating CmdletsAdd a class and build your snap-in
Creating CmdletsFrom an administrative Visual Studio command prompt navigate to your output directory and install your assemblyGotcha: On a 64-bit system you’ll need to use the 64-bit version of InstallUtil.exe
Creating CmdletsLaunch a new instance of PowerShellView the registered snap-ins:Get-PSSnapIn –RegisteredRegister the snap-in:Add-PSSnapIn
Creating CmdletsExport the current console:Export-ConsoleInclude the exported file in your projectSet it to always copy to the output directory
Creating CmdletsIn the project properties set the debug action to start powershell.exeIn the command line arguments specify your console export file using the –PSConsoleFileflag
Creating Cmdlets
Hosting PowerShellCreate a new windows forms applicationAdd a reference to System.Management.Automation and your snap-in project
Hosting PowerShellIn the form use a RunspaceConfiguration instance to add your snap-in, then create and open the runspace
Hosting PowerShellUsing the runspace create and invoke a pipelineRemember that Get-Proc is returning a collection and not individual items!
PowerShell 1.0Included in Windows Server 2008Separate download for Windows XP SP2, Windows Server 2003, & Windows VistaPowerShell 2.0Included in Windows 7 & Windows Server 2008 R2RC available for Windows XP SP3, Windows Server 2003 SP2, Vista SP1, & Windows Server 2008Where do I get it?
http://blogs.msdn.com/PowerShell/http://bit.ly/powershell-ebookhttp://bit.ly/scriptcenterhttp://bit.ly/poshtweethttp://bit.ly/easy-powershellResources

More Related Content

PPTX
Getting Started With PowerShell Scripting
PPTX
Introduction to .NET Programming
PPTX
Namespaces in C#
PPTX
.NET and C# Introduction
PPTX
Asp.net and .Net Framework ppt presentation
PPTX
Introduction to Powershell Version 5
PPTX
.NET Core: a new .NET Platform
PPTX
What's New in .Net 4.5
Getting Started With PowerShell Scripting
Introduction to .NET Programming
Namespaces in C#
.NET and C# Introduction
Asp.net and .Net Framework ppt presentation
Introduction to Powershell Version 5
.NET Core: a new .NET Platform
What's New in .Net 4.5

What's hot (20)

PPTX
Web developer tools
PDF
Powershell training material
PDF
Windows batch scripting
PPT
Asp.net architecture
PDF
Windows script host
PPT
.Net Overview -- Training (Lesson 1)
PPTX
.NET and C# introduction
PPT
.Net Overview
PPTX
Introduction To Windows Power Shell
KEY
Development workflow
PPTX
Roslyn: el futuro de C#
PPTX
.NET Framework 4.0 – Changes & Benefits
PPT
Introduction to .NET Framework
PPT
Microsoft .NET Framework
PPT
Lecture 10 software development
PPTX
Dotnet Frameworks Version History
PPTX
What's new in c# 10
PDF
Telosys project booster Paris Open Source Summit 2019
PPT
Attributes & .NET components
PPTX
PowerShell-1
Web developer tools
Powershell training material
Windows batch scripting
Asp.net architecture
Windows script host
.Net Overview -- Training (Lesson 1)
.NET and C# introduction
.Net Overview
Introduction To Windows Power Shell
Development workflow
Roslyn: el futuro de C#
.NET Framework 4.0 – Changes & Benefits
Introduction to .NET Framework
Microsoft .NET Framework
Lecture 10 software development
Dotnet Frameworks Version History
What's new in c# 10
Telosys project booster Paris Open Source Summit 2019
Attributes & .NET components
PowerShell-1
Ad

Viewers also liked (20)

PDF
Antediluvian Unix: A Guide to Unix Fundamentals
PPTX
Twitter For Lawyers
PPTX
Three cool cmdlets I wish PowerShell Had!
PPTX
Implementing dr w. hyper v clustering
PPTX
PowerShell crashcourse for sharepoint
PPT
PS scripting and modularization
PPT
Ad disasters & how to prevent them
PPTX
Managing enterprise with PowerShell remoting
PPT
PPT
From VB Script to PowerShell
PPT
Automating Active Directory mgmt in PowerShell
PPT
PS error handling and debugging
PPTX
Combining output from multiple sources
PPTX
PowerShell and WMI
PPT
PowerShell 8tips
PPTX
Introduction to powershell
PPT
No-script PowerShell v2
PPTX
VDI-in-a-Box: Microsoft Desktop Virtualization for Smaller Businesses and Uses
KEY
PowerShell and the Future of Windows Automation
PPT
PowerShell v4 Desired State Configuration
Antediluvian Unix: A Guide to Unix Fundamentals
Twitter For Lawyers
Three cool cmdlets I wish PowerShell Had!
Implementing dr w. hyper v clustering
PowerShell crashcourse for sharepoint
PS scripting and modularization
Ad disasters & how to prevent them
Managing enterprise with PowerShell remoting
From VB Script to PowerShell
Automating Active Directory mgmt in PowerShell
PS error handling and debugging
Combining output from multiple sources
PowerShell and WMI
PowerShell 8tips
Introduction to powershell
No-script PowerShell v2
VDI-in-a-Box: Microsoft Desktop Virtualization for Smaller Businesses and Uses
PowerShell and the Future of Windows Automation
PowerShell v4 Desired State Configuration
Ad

Similar to Windows PowerShell - Billings .NET User Group - August 2009 (20)

PPTX
PDF
PowerShell for SharePoint Developers
PPTX
Wsv406 Advanced Automation Using Windows Power Shell2.0
PPTX
Install .Net Core, SQL Server V-Next on Linux and deploy .Net core applicatio...
PPTX
Automating PowerShell with SharePoint
PPTX
PowerShell-2
PPTX
[Portland 365Sat] PCF Custom Controls
PPTX
CCI2019 - I've got the Power! I've got the Shell!
PDF
Learn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdf
PDF
Sql Server & PowerShell
PPT
Powershell Seminar @ ITWorx CuttingEdge Club
PPTX
Power shell training
PPTX
Introducing PowerShell 3.0
PPT
24 Hours Of Exchange Server 2007 (Part 8 Of 24)
PPTX
Automating Desktop Management with Windows Powershell V2.0 and Group Policy M...
PDF
Automating Your Enterprise Application Deployments with PowerShell
PPTX
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
PPTX
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
PPTX
01. introduction to-programming
PPT
24 Hours Of Exchange Server 2007 ( Part 9 Of 24)
PowerShell for SharePoint Developers
Wsv406 Advanced Automation Using Windows Power Shell2.0
Install .Net Core, SQL Server V-Next on Linux and deploy .Net core applicatio...
Automating PowerShell with SharePoint
PowerShell-2
[Portland 365Sat] PCF Custom Controls
CCI2019 - I've got the Power! I've got the Shell!
Learn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdf
Sql Server & PowerShell
Powershell Seminar @ ITWorx CuttingEdge Club
Power shell training
Introducing PowerShell 3.0
24 Hours Of Exchange Server 2007 (Part 8 Of 24)
Automating Desktop Management with Windows Powershell V2.0 and Group Policy M...
Automating Your Enterprise Application Deployments with PowerShell
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
01. introduction to-programming
24 Hours Of Exchange Server 2007 ( Part 9 Of 24)

Recently uploaded (20)

PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Cloud computing and distributed systems.
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
KodekX | Application Modernization Development
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Encapsulation_ Review paper, used for researhc scholars
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
cuic standard and advanced reporting.pdf
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Empathic Computing: Creating Shared Understanding
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf
Machine learning based COVID-19 study performance prediction
Cloud computing and distributed systems.
Understanding_Digital_Forensics_Presentation.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
20250228 LYD VKU AI Blended-Learning.pptx
KodekX | Application Modernization Development
Network Security Unit 5.pdf for BCA BBA.
NewMind AI Weekly Chronicles - August'25 Week I
The Rise and Fall of 3GPP – Time for a Sabbatical?
Per capita expenditure prediction using model stacking based on satellite ima...
MYSQL Presentation for SQL database connectivity
Encapsulation_ Review paper, used for researhc scholars
“AI and Expert System Decision Support & Business Intelligence Systems”
Chapter 3 Spatial Domain Image Processing.pdf
cuic standard and advanced reporting.pdf
sap open course for s4hana steps from ECC to s4
Empathic Computing: Creating Shared Understanding
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf

Windows PowerShell - Billings .NET User Group - August 2009

Editor's Notes

  • #3: Shells have historically executed commands or utilities and presented results as textCmd.exe is the shell on windowsFew built-in commands, large variety of external utilities
  • #8: You can filter by verb
  • #9: You can filter by noun
  • #14: Applications found in your path are available in PowerShellOutput from executables becomes a full-fledged object in PowerShell
  • #17: Anything can be navigable using PowerShell providers!Even the registry!
  • #18: SQLPS.exe, which comes with SQL Server 2008, is a custom PowerShell hostIt adds its own provider for navigating objects in SQL Server instances
  • #19: The things returned by providers are itemsYou can use the –Item commands to work with them directlyIn this case when we get the subtext item we see that it is a Database type from the SMO library
  • #20: Like everything else there are simple commands for filtering, looping, and sortingThose commands have simple aliasesFilter using whereSelect a new object from an existing object using selectLoop using foreach – notice that your have to ‘return’ something at the endTypical comparison operators like =, <, > aren’t used for parsing reasons
  • #22: Creating a virtual machine using Hyper-V
  • #23: Twitter!
  • #25: It may be easier to believe now, but there is a lot you can do with PowerShell without even opening Visual Studio.