Nachfolger der PowerShell 3.0
enthalten in Windows 8.1 und Windows Server 2012 R2
Die PowerShell 4.0 gibt es als Bestandteil von Windows 8.1/Windows Server 2012 R2 und als Add-On für Windows 7 Service Pack 1, Windows Server 2008 R2 SP1 sowie Windows Server 2012.
Windows PowerShell 4.0
Some of the new features in Windows PowerShell 4.0 include:
- Support for workflow and remote script debugging
- Improved workflow authoring experience to make it more consistent with script authoring
- Added PipelineVariable as a common parameter
- Better support for downloading updatable help by using Save-Help and Update-Help in offline scenarios
- Several bug fixes and performance improvements
Windows PowerShell Integrated Scripting Environment
Windows PowerShell ISE in Windows Management Framework 4.0 Preview introduces:
Windows PowerShell Web Services
Windows PowerShell Web Services (Management Odata IIS Extension) enables an administrator to expose a set of Windows PowerShell cmdlets as a RESTful web endpoint accessible by using Odata (Open Data Protocol). This provides remote access to run cmdlets from both Windows-based and non-Windows-based client computers or devices.
- Improved error messages in event logs
- Endpoint versioning support
- Autopopulation of Odata dispatch schema fields
- Support for complex types
- Multilevel association support
- Ability to perform large binary stream transfers
- Support for non-Create/Read/Update/Delete (CRUD) actions
- Key-As-Segment URL syntax support
- Constrained resource operations
Windows PowerShell Desired State Configuration
Windows Management Framework 4.0 Preview introduces Windows PowerShell Desired State Configuration (DSC), with the following highlights:
- Local configuration manager for applying configurations on the local computer
- Windows PowerShell language extensions for authoring DSC documents
- PSDesiredStateConfiguration module and DSC-related cmdlets
- A set of built-in DSC configuration providers
- DSC service for distributed access to DSC resources
- Windows PowerShell Desired State Configuration (DSC) is a new management system in Windows PowerShell 4.0 that enables the deployment and management of configuration data for software services, and the environment in which these services run. For more information about DSC, see Get Started with Windows PowerShell Desired State Configuration.
- Save-Help now lets you save help for modules that are installed on remote computers. You can use Save-Help to download module Help from an Internet-connected client (on which not all of the modules for which you want help are necessarily installed), and then copy the saved help to a remote shared folder, or a remote computer that does not have Internet access.
- The Windows PowerShell debugger has been enhanced to allow debugging of Windows PowerShell workflows, as well as scripts that are running on remote computers. Windows PowerShell workflows can now be debugged at the script level from either the Windows PowerShell command line or Windows PowerShell ISE. Windows PowerShell scripts, including script workflows, can now be debugged over remote sessions. Remote debugging sessions are preserved over Windows PowerShell remote sessions that are disconnected and then later reconnected.
- A RunNow parameter for Register-ScheduledJob and Set-ScheduledJob eliminates the need to set an immediate start date and time for jobs by using the Trigger parameter.
- Invoke-RestMethod and Invoke-WebRequest now let you set all headers by using the Headers parameter. Although this parameter has always existed, it was one of several parameters for the web cmdlets that resulted in exceptions or errors.
- Get-Module has a new parameter, FullyQualifiedName, of the type ModuleSpecification. The Name parameter of Get-Module now lets you specify a module by using the module's name, version, and GUID. As before, it also lets you specify a module by using only the name.
- The default execution policy setting on Windows Server 2012 R2 Preview is RemoteSigned. On Windows 8.1 Preview, there is no change in default setting.
- Starting in Windows PowerShell 4.0, method invocation by using dynamic method names is supported.
- Asynchronous workflow jobs are no longer deleted when the time-out period that is specified by the PSElapsedTimeoutSec workflow common parameter has elapsed.
- A new parameter, RepeatIndefinitely, has been added to the New-JobTrigger and Set-JobTrigger cmdlets. This eliminates the necessity of specifying a TimeSpan.MaxValue value for the RepetitionDuration parameter to run a scheduled job repeatedly, for an indefinite period.
- A Passthru parameter has been added to the Enable-JobTrigger and Disable-JobTrigger cmdlets. The Passthru parameter displays any objects that are created or modified by your command.
- The parameter names for specifying a workgroup in the Add-Computer and Remove-Computer cmdlets are now consistent. Both cmdlets now use the parameter WorkgroupName.
- A new common parameter, PipelineVariable, has been added. PipelineVariable lets you save the results of a piped command (or part of a piped command) as a variable that can be passed through the remainder of the pipeline.
- Windows PowerShell now lets you add new keywords.
- Collection filtering by using a method syntax is now supported.
- The Get-Process cmdlet has a new switch parameter, IncludeUserName.
- A new cmdlet, Get-FileHash, that gets information about file hashes, has been added.
- In Windows PowerShell 4.0, if a module uses the DefaultCommandPrefix key in ist manifest, or if the user imports a module with the Prefix parameter, the ExportedCommands property of the module shows the commands in the module with the prefix. When you run the commands by using the module-qualified syntax, ModuleName\CommandName, the command names must include the prefix.
- The value of $PSVersionTable.PSVersion has been updated to 4.0.