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.
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
What’s New in PowerShell v3 and Introducing Script Explorer
1. @jonoble
What’s New in PowerShell v3
Disclaimer:
All of this is pre-release functionality
and is subject to change
2. Automating all management operations for
servers within an organization increases the
quality and reliability of the operations and
lowers the total cost of ownership. Windows
PowerShell scripting is the Microsoft standard
for automation. Windows PowerShell enables
IT pros to automate operations such as
deployment, configuration, life cycle
management, data management, security
management, and diagnostics. Microsoft server
products provide high-level, task-oriented
Windows PowerShell cmdlets and optional
namespace providers. Microsoft Common Engineering Criteria
4. Feature Specific Modules
or added with RSAT
ActiveDirectory
ADDSDeployment
ADRMSAdmin
DhcpServer
DnsServer
GroupPolicy
NetworkLoadBalancingClusters
RemoteAccess
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. 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. Remoting Improvements
• New configuration options
SharedHosts
RunasUser
AutoRestart
ServerBufferingMode
• Disconnected sessions
• Resilient sessions
• New cmdlets that make creation of restricted
sessions easier
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. 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. 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. 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. 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. 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. 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. 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
http://www.powershellmagazine.com/2011/09/28/powershell-v3-ise-and-ise-
scripting-model-changes-improvements/
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
http://blog.powershell.no/2011/09/14/windows-powershell-web-access/
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