Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

What’s New in PowerShell v3 and Introducing Script Explorer


Published on

Presentation to NEBytes user group on 18th January 2012. Audience was mixed IT pro/developer; 1/4 people who have used PowerShell to some degree; 2/3 had at least some awareness. The aim of the presentation was to show existing PowerShell users some of the exciting new features/directions, and persuade the rest that PowerShell has come of age and is a technology that they should be exploring.

Published in: Technology
    Are you sure you want to  Yes  No
    Your message goes here

What’s New in PowerShell v3 and Introducing Script Explorer

  1. 1. @jonobleWhat’s New in PowerShell v3 Disclaimer: All of this is pre-release functionality and is subject to change
  2. 2. Automating all management operations forservers within an organization increases thequality and reliability of the operations andlowers the total cost of ownership. WindowsPowerShell scripting is the Microsoft standardfor automation. Windows PowerShell enablesIT pros to automate operations such asdeployment, configuration, life cyclemanagement, data management, securitymanagement, and diagnostics. Microsoft serverproducts provide high-level, task-orientedWindows PowerShell cmdlets and optionalnamespace providers. Microsoft Common Engineering Criteria
  3. 3. Masses of Modules AppLocker PKIClient BestPractices PrintManagement BitsTransfer PSScheduledJob BranchCache PSWorkflow ClusterAwareUpdating RDManagementDirectAccessClientComponents ScheduledTasks DnsConfig SecureBoot DnsLookup ServerManager FailoverClusters SmbShare FileServer SmbWitness iSCSI Storage MsDtc TelemetryManagement NetAdapter TroubleshootingPack NetQos TrustedPlatformModule NetSwitchTeam UserAccessLogging NetTCPIP …and more! NetworkConnectivityStatus NetworkSecurity
  4. 4. Feature Specific Modules or added with RSAT ActiveDirectory ADDSDeployment ADRMSAdmin DhcpServer DnsServer GroupPolicyNetworkLoadBalancingClusters RemoteAccess
  5. 5. Active Directory• 76 cmdlets on Server 2008 R2• 134 on Server 8 support for managing… Active Directory replication, sites, site links, subnets Central Access Policies, Rules, Claims• ADDSDeployment module contains cmdlets to replace dcpromo• ADDS Installation Wizard and ADAC expose the PowerShell they use in the background
  6. 6. Remoting• Enabled on Server 8 by default• Server Manager allows management of multiple machines using PowerShell Remoting and WMI• Add Roles/Features wizards can act against multiple targets
  7. 7. Remoting Improvements• New configuration options SharedHosts RunasUser AutoRestart ServerBufferingMode• Disconnected sessions• Resilient sessions• New cmdlets that make creation of restricted sessions easier
  8. 8. Workflow• Based on Windows Workflow Foundation• Run complex, large, multi-machine management tasks Repeatable Parallelizable Interruptible Recoverable• Resume after reboot, network/power loss• RunBook automation
  9. 9. Workflow• Look a lot like functions• Runs on top of PowerShell job engine• Use *-Job cmdlets• Parallel and Sequence blocks• Can be nested• Check out the PDF with WMF3 CTP2
  10. 10. Workflow Language Differences• Adds Workflow specific parallel ForEach statement and Parallel keyword• You can’t use these within Workflow Switch statements (except basic string comparisons) Begin, Process and End In loops: Break, Continue, variable modifying conditions Sub expressions Multiple assignments Dynamic parameters Dot-sourcing or the invocation operator Positional parameters
  11. 11. Simplified Syntax (try saying that ten times quickly after a few drinks!)• Where-Object {$_.<propertyname>}• Where-Object <propertyname>Get-CASMailbox | Where {$_.IMAPEnabled} becomes Get-CASMailbox | Where IMAPEnabled• Now works like Sort-Object, Group-Object
  12. 12. Other New Stuff• Export-Csv now has an –Append switch Requires matching headings in the file Unless you use –Force• Get-ChildItem has new filter parameters -Directory, -File, -Attributes [<FileAttributes>]• New operators -in and –notin Like –contains and –notcontains in reverse
  13. 13. Other New Stuff• PowerShell Jobs can be scheduled On a timescale In response to an event• Automatic module loading makes cmdlet discovery easier Be careful about duplicate cmdlets Set your PSModulePath• Show-Command• Updatable help
  14. 14. Other New Stuff• Restart-Computer has new parameters -Wait -For <Wmi|WinRM|PowerShell>• Invoke-RestMethod• ConvertFrom/To-Json• Better control passing arguments to exes --% to dumb-down parser
  16. 16. ISE Enhancements• F8• Better IntelliSense• Add-ons Horizontal/vertical tool pane• XML File highlighting• Script region folding• Code snippets• Auto-save• Recent file list• PowerShell Magazine article scripting-model-changes-improvements/
  17. 17. PowerShell Web Access• Gives a remote console in a browser• Runs on IIS, over SSL• Just add feature & run a script to configure• Blog post by Jan Egil Ring
  18. 18. Introducing Script Explorer …or to be precise Microsoft Script Explorer for Windows PowerShell
  19. 19. • Standalone or ISE add-on• Online repositories• Local file system and network shares• Search or browse• Scripts, snippets or how-to• Save to local file or copy to ISE editor• Explore community resources
  20. 20. • Any questions?• NE PowerShell Script Club, anyone?