You are on page 1of 28

Dan Harman Program Manager Microsoft Corporation

Ibrahim Abdul Rahim Test Engineer Microsoft Corporation WSV402

Improvements in PowerShell 2.0


Dozens of big features, thousands of fixes
Remoting PowerShell ISE Advanced Functions Background Jobs Restricted Sessions Transactions Out-GridView Script Debugging New & Improved Cmdlets Hosting APIs Modules Eventing Session Pools Language Enhancements WMI Improvements Improved AD Adapter Performance Improvements Script Internationalization Parser API Support More

PowerShell Architecture
User Experience
Shell

Engine
APIs

Managed Elements
Cmdlets WMI COM

Language

Execution Context

.NET XML ADO

Debugger

Object Manager

ADSI Native Commands

PowerShell 2.0 Themes


Production Scripting Automation Environment GUI over PowerShell

Language and Cmdlets

Production Scripting
Scripts are:
Easy to use Easy to share Easy to support Safe to operate

Production Scripting

Production Scripting Features


User Experience
Advanced Functions
Shell

Engine
APIs

Managed Elements
Cmdlets Advanced Functions WMI

Debugger Enhancements
Language Execution Restricted Language Context

Native Code COM


.NET XML ADO ADSI Native Commands

Modules
Debugger Object Manager

Transactions

Production Scripting
Dan Harman Program Manager Windows PowerShell

Universal Automation Environment


Interactive or programmatic In the foreground or background Local or remote Single machine or multiple machines Synchronous or asynchronous In restricted or unrestricted environments Wide range of authentication mechanisms Simple scripting to systems programming

Universal Automation

Automation Environment Features


User Experience
Shell

Engine
APIs

Managed Elements
Remoting
Cmdlets WMI COM .NET XML ADO ADSI Native Commands

Background Jobs
Language Execution Context Eventing

Restricted Sessions
Debugger Object Manager

Mobile Object Model

Remoting Scenarios
1:Many (fan-out): Large Scale Automation
Send the script to remote machines Select properties allows client to specify which properties to return Throttling limits the number of concurrent operations Job support runs commands in the background on client

1:1 (interactive): Secure Telnet Replacement


Cmdline equivalent of Remote Desktop Interact with a remote machine as if it were local No Invoke-Command required Ideal for troubleshooting a remote machine

Many:1 (fan-in): Delegated Administration & Hosting


Hosting model for web services No tools installation required on client Constrained session environment (cmdlets, parameters, language)

Universal Automation Environment


Ibrahim Abdul Rahim Test Engineer Windows PowerShell

GUI over PowerShell


Layering admin GUIs on top of PowerShell
Drives consistency between CLI & GUI Enables agility in delivering new GUIs Guarantees automation of GUI commands Facilitates GUI teaching command line Standardizes access to managed elements

GUI over PowerShell

GUI over PowerShell Features


User Experience
PowerShell ISE
Shell

Engine
APIs

Managed Elements
Cmdlets WMI COM

Out-GridView
Language Execution Context Hosting APIs

.NET XML ADO ADSI Native Commands

Session Pooling
Debugger Object Manager

Thread Control

GUI over PowerShell


Ibrahim Abdul Rahim Test Engineer Windows PowerShell

Language and Cmdlets


Responding to community feedback
Enhance the language Improve the engine Provide more built-in cmdlets

Language and Cmdlets

Language and Cmdlets


User Experience
Shell

Engine
APIs

Managed Elements
Cmdlets New Cmdlets WMI

WMI++ COM Language Language Enhancements


Debugger Execution Context .NET XML ADO

Improved Object Adapters


Object Manager

ADSI Native Commands

Over 100 New Built-In Cmdlets


Hundreds more from partners
Remoting
Disable-PSSessionConfiguration Enable-PSRemoting Enable-PSSessionConfiguration Enter-PSSession Exit-PSSession Export-PSSession Get-PSSession Get-PSSessionConfiguration Import-PSSession Invoke-Command New-PSSession New-PSSessionOption New-WebServiceProxy Register-PSSessionConfiguration Remove-PSSession Set-PSSessionConfiguration

Modules
Export-ModuleMember Get-Module Import-Module New-Module New-ModuleManifest Remove-Module Test-ModuleManifest

Transactions
Complete-Transaction Get-Transaction Start-Transaction Undo-Transaction Use-Transaction

Computers
Add-Computer Checkpoint-Computer Disable-ComputerRestore Enable-ComputerRestore Get-ComputerRestorePoint Remove-Computer Reset-ComputerPassword Restart-Computer Restore-Computer Stop-Computer Test-Connection

Debugging
Disable-PSBreakpoint Enable-PSBreakpoint Get-PSBreakpoint Get-PSCallStack Remove-PSBreakpoint Set-PSBreakpoint

Eventing
Get-Event Get-EventSubscriber New-Event Register-EngineEvent Register-ObjectEvent Remove-Event Unregister-Event Wait-Event

WMI
Invoke-WMIMethod Register-WMIEvent Remove-WMIObject Set-WMIInstance

Type Conversion
Add-Type ConvertFrom-Csv ConvertFrom-StringData ConvertTo-Csv ConvertTo-Xml

Custom Sessions
Disable-PSSessionConfiguration Enable-PSSessionConfiguration Get-PSSessionConfiguration New-PSSessionOption Register-PSSessionConfiguration Set-PSSessionConfiguration Unregister-PSSessionConfiguration

WS-Man
Connect-WSMan Disable-WSManCredSSP Disconnect-WSMan Enable-WSManCredSSP Get-WSManCredSSP Get-WSManInstance Invoke-WSManAction New-WSManInstance New-WSManSessionOption Remove-WSManInstance Set-WSManInstance Set-WSManQuickConfig Test-WSMan

Other
Clear-History Debug-Process Export-FormatData Get-FormatData Get-Random Import-LocalizedData Out-GridView Select-Xml Send-MailMessage Set-StrictMode Start-Process Test-ComputerSecureChannel Update-List Wait-Process

Diagnostics
Clear-EventLog Export-Counter Get-Counter Get-Hotfix Get-WinEvent Import-Counter Limit-EventLog New-EventLog Remove-EventLog Show-EventLog Write-EventLog

Background Jobs
Get-Job Receive-Job Remove-Job Start-Job Stop-Job Wait-Job

Example: Virtual Machine Self-Service Portal


Dan Harman Program Manager Windows PowerShell

16 Partners in Windows 7 & WS08 R2


70+ active internal partners
Exchange Server Windows Diagnostics Server Manager SQL Server Active Directory Failover Clustering System Center Operations Manager Windows Backup Server Migration System Center Virtual Machine Manager Best Practices Analyzer Active Directory Rights Management Services Internet Information Services Background Intelligent Transfer Service System Center Data Protection Manager Network Load Balancing Remote Desktop Services Group Policy WS-Management AppLocker WMI

Community Resources
Newsgroup: Microsoft.Public.Windows.PowerShell Team blog: http://blogs.msdn.com/PowerShell PowerShell Community: http://www.powershellcommunity.org Channel 9: http://channel9.msdn.com/tags/PowerShell Wiki: http://channel9.msdn.com/wiki/default.aspx/Channel9.WindowsPowerShellWiki Script Center: http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx CodePlex: http://codeplex.com/Project/ProjectDirectory.aspx?TagName=powershell Books
PowerShell in Action by Bruce Payette http://manning.com/powershell Windows PowerShell Cookbook by Lee Holmes http://www.oreilly.com/catalog/9780596528492/index.html Professional Windows PowerShell Programming http://www.wrox.com/WileyCDA/WroxTitle/productCd-0470173939.html Many others

Resources
www.microsoft.com/teched
Sessions On-Demand & Community

www.microsoft.com/learning
Microsoft Certification & Training Resources

http://microsoft.com/technet
Resources for IT Professionals

http://microsoft.com/msdn
Resources for Developers

www.microsoft.com/learning Microsoft Certification and Training Resources

Related Content
Breakout Sessions
DAT314 SIA313 WCL314 WSV304 WSV325 Microsoft SQL Server Automation on Steroids, Including PowerShell Support Managing Active Directory Identities with Active Directory PowerShell Windows PowerShell for the Windows 7 Enterprise Client Deploying and Managing Scalable Web Server Farms with IIS 7.0 Windows PowerShell: Tips from the Expert

Hands-on Labs
WSV08-HOL Introduction to Windows PowerShell Fundamentals WSV03-HOL Advanced Windows PowerShell Scripting WSV19-HOL Windows Server 2008 R2: Server Management and PowerShell V2

Birds of a Feather Sessions


BOF01 Should Developers Care about Windows PowerShell? BOF61 Practical PowerShell: Best Practices from the Field

Interactive Theater Sessions


UNC03-INT Mastering Exchange Management with the Exchange Management Shell

Windows Server Resources


Make sure you pick up your copy of Windows Server 2008 R2 RC from the Materials Distribution Counter

Learn More about Windows Server 2008 R2:


www.microsoft.com/WindowsServer2008R2

Technical Learning Center (Orange Section):


Highlighting Windows Server 2008 and R2 technologies Over 15 booths and experts from Microsoft and our partners

User Experience Studies


Help make Windows Server and System Center better

Participate in user experience studies while at TechEd

Sign up on Twitter @MS_ITPro_UX

Complete an evaluation on CommNet and enter to win!

2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.