Tag Archives: Microsoft

Secret Management Preview 2 Release

This post was originally published on this site

We are excited to release a second preview of the Secret Management Module. Thanks to the tremendous feedback we received from the first preview release of this module, you will notice a number of breaking changes to the module. This release is still a preview release meaning that it is not feature complete, future releases will face breaking changes, and we are still iterating based on your feedback. It is important to also note that this version of the module is still Windows only as we are currently implementing Linux support which we hope to make available in the next preview release (and MacOS support after). Please note that because of the breaking changes this release requires a complete replacement of the Secret Management module and any extension modules. Additionally, any existing built in local vault secret can no longer be retrieved and must be re-saved.

How to Install Secret Management Preview 2

If you did not install our first preview release, open any PowerShell console and run:

Install-Module Microsoft.PowerShell.SecretManagement -AllowPrerelease

If you installed our first preview release you will want to first remove any secrets from the LocalDefaultVault. Based on feedback we changed the naming convention for secrets stored in CredMan, therefore previous secrets stored in the local vault will no longer be visible after the new version of the module is installed. (Although the user can still view/remove the old secrets via CredMan UI.) Next you will want to run Uninstall-Module Microsoft.PowerShell.SecretsManagement, this extra step is a result of the change we made to the name of the module. Finally you can run the above command Install-Module Microsoft.PowerShell.SecretManagement -AllowPrerelease to install the latest preview release of the module.

Changes in Secret Management Preview 2

New Module Name

We have removed the plurality in the module name to Mirosoft.PowerShell.SecretManagement in order to be consistent with the cmdlet name and to align with PowerShell naming conventions.

New Cmdlet Names

In addition to renaming the module, we have also removed plurality in the cmdlets. The available cmdlets in the module are now:

# Registering extension vaults

Register-SecretVault
Get-SecretVault
Unregister-SecretVault
Test-Vault # new cmdlet in this release

# Accessing secrets

Set-Secret # this cmdlet replaces Add-Secret
Get-Secret
Get-SecretInfo
Remove-Secret

You will notice we renamed the Add-Secret cmdlet to be Set-Secret. This change was based on user feedback that this name better conveyed the intention of the cmldet.

You will also notice that we have added a Test-Vault cmdlet, this change allows vault extension owners to check that the vault is properly configured at registration time.

Other Changes

  • Set-Secret now has a default parameter set that takes SecureString secret input type. This way Set-Secret will always prompt safely for a SecureString. String secret types can still be passed via parameter or pipeline, but default will be SecureString.
PS> Set-Secret -Name MyStringToken

cmdlet Set-Secret at command pipeline position 1
Supply values for the following parameters:
SecureStringSecret: **********

# Set string secret directly
Set-Secret -Name MyStringToken -Secret $token
Set-Secret -Name MyStringToken -Secret 'MyToken'

# Set string secret via pipeline
$token | Set-Secret -Name MyStringToken -NoClobber

  • Added SecretInformation class used to return information from Get-SecretInfo in a uniform way.
  • Changed CredMan naming prefix to ps:SecretName.
  • Added vaultName to all vault extension functions.
  • Fixed additionalParameters parameter in SecretManagementExtension abstract classes.
  • Fixed return byte[] bug in example test script extension.

In coordination with these changes we have also updated our tests and example scripts.

Next Steps

As we move towards a GA release later this year, we are using a GitHub Milestone to track issues we plan to fix. The two major work items that we are currently working toward are:

  • Linux Support (via keyring)
  • MacOS Support (via keychain)

Support and Feedback

For support on the module, feedback, or reporting a bug, please open an issue in the PowerShell/modules repo with “(Secrets Management)” specified in the issue title.

Sydney Smith, PowerShell Team

 

 

The post Secret Management Preview 2 Release appeared first on PowerShell.

Visual Studio Code for PowerShell 7

This post was originally published on this site

We are excited to announce that we have released a major update to the PowerShell extension for Visual Studio Code. This release contains months of architectural work that first shipped in our PowerShell Preview extension in November of 2019, along with incremental bug fixes in the intervening months. If you are new to Visual Studio Code this article is helpful for getting started. If you already use Visual Studio Code with the PowerShell extension, read on to find out what is new.

What’s new

ISE Compatibility Module

We took the documentation from our “How to replicate the ISE experience in Visual Studio Code” doc and turned it into a switch to make the process of using Visual Studio code more familiar for Windows PowerShell ISE users.

Secrets Management Development Release

This post was originally published on this site

Secrets Management Development Release

At Ignite 2019 we gave a preview of our PowerShell Secrets Management Module. This Secrets Management module, first proposed in RFC #234, creates an extensible abstraction layer in PowerShell for interacting with Secrets and Secrets Vaults. We are excited to publish a development release of this module to the PowerShell Gallery to get feedback on the cmdlet interface and to enable an iterative development experience. While the current release of this module is Windows only, we plan to support Linux, and eventually MacOS, in coming releases. We made the decision to publish our first preview of this module without cross-platform support to allow you to develop alongside us–check out this blog post for an overview of developing vault extensions.

What is Secrets Management?

The Secrets Management module helps users manage secrets by providing a set of cmdlets that let you store secrets locally, using a local vault provider, and access secrets from remote vaults. This module supports an extensible model where local and remote vaults can be registered and unregistered on the local machine, per user, for use in accessing and retrieving secrets.
The module leverages existing secrets vaults, for example it uses Credential Manager (Cred Man),
to provide the default local vault experience on Windows. This module focuses on retrieving/using secrets from existing vaults, leaving the advanced secret/vault management to the existing vaults. While this module will eventually be cross-platform this alpha version of the module currently works only on Windows platforms. For a more detailed explanation of the goals of Secrets Management watch this session from Ignite 2019.

How can I start using this module?

The module has been published to the PowerShell Gallery, to install the module using PowerShellGet, open a PowerShell console and run the following
Install-Module -Name Microsoft.PowerShell.SecretsManagement -AllowPrerelease.

Once you have the module installed you can begin using the seven cmdlets implemented by the module:

Add-Secret
Get-Secret
Get-SecretInfo
Get-SecretsVault
Register-SecretsVault
Remove-Secret
Unregister-SecretsVault

For example you may want to add a secret to your local vault, and then use that secret to invoke a rest method.

If you run Get-SecretsVault you will notice that your default vault is already registered.

To add your secret you can run Add-Secret -Name MyApiKey -Secret "This is my API key"

If you then run Get-SecretInfo -Name MyApiKey you will see that it has been added to your local vault,
and if you run Get-Secret -Name MyTestSecret you will notice that it has been saved as a secure string.
We automatically convert all strings to secure strings to avoid plain text passwords accidently being exposed in the console.

To use the secret, as a string, in order to invoke a rest method you can run

Publish-Module -Path C:ModulesPublishMyNewModule -NuGetApiKey (Get-Secret MyApiKey -AsPlainText)

 

By using the -AsPlainText switch the secret is returned as an ordinary string.

What is a “Development Release”?

A development release simply means that the module is still actively being developed. In other words, the module is not feature complete, we are not committing to not making breaking changes, and we do not recommend using the module in production environments. The goal of this development release is to get it in the hands of potential users so that we can get feedback to make the best possible decisions as we continue to develop it.

When will this module be production-ready?

Right now we do not have a committed date to publishing this module as “Generally Available”, instead we are committed to getting this module right, and feature complete so that it can be dependably used. We are targeting late spring/early summer 2020 for our GA release of this module, but will share more information on this as we progress closer to a production-ready module.

How can I give feedback on this module?

There are a few ways to provide feedback on this module. We have created a survey to target specific questions we are interested in answering in regards to this module. For feedback on the design of the module the best place to provide feedback is to comment on the RFC (the design specification).
For support on the module, or reporting a bug, please open an issue in the PowerShell/modules repo with “(Secrets Management)” specified in the issue title.

Will “x” Vault be available? How can I develop vault extensions?

A large part of the value of the module comes from vault ecosystem, and while we want to encourage development of vault extensions through the design of our module, we (the PowerShell Team) do not have the expertise or capacity to manage various vault extensions. Therefore, we are leaving it up to the vault owners/users to help us build out that ecosystem. While we have tried to ensure that the design of our module makes for a simple and straightforward development process for vault extension owners we cannot be sure of that without feedback from developers. We have published a blog on vault extension development, along with example extensions for more information on how to start developing. If you have any questions about vault extension development please open an issue in our repository PowerShell/modules repo.

Sydney Smith
Program Manager, PowerShell Team

The post Secrets Management Development Release appeared first on PowerShell.

Improvements in Windows PowerShell Container Images

This post was originally published on this site

Beginning with Windows Server 20H1 Insider builds, Windows Server Core Insider images have been reduced in size from ~2.1 GBs to ~1.1 GBs.

How did the Server Core images get over 40% smaller?

Traditionally, Windows 10 and Windows Server have always included a set of .NET native binaries that were pre-compiled using the Native Image Generator tool (Ngen.exe). This native pre-compilation makes these binaries faster on default installations of the OS, but it also makes the image size grow: managed/IL .NET binaries are typically smaller and slower initially (until JIT compilation happens) than their native counterparts (with another tradeoff being that the latter are not portable between platforms and architectures).

For more details, check out corresponding blogs published by the .NET team and the Windows Server team.

What does this mean for me as a PowerShell user?

If you depend on Windows Server container images for usage of Windows PowerShell, and you value performance, you should switch from the windows/servercore images to the dotnet/framework/runtime images. The latter are specifically optimized for .NET Framework workloads like Windows PowerShell.

And in fact, switching to the new dotnet/framework/runtime images will actually provide a greater benefit to startup performance even over the old windows/servercore images. When running Measure-Command { docker run --rm <image> powershell -c "echo 1" } on a Windows box, observe the following differences:

windows/servercore:1903 windows/servercore/insider:10.0.19023.1 dotnet/framework/runtime:4.8-20191008-windowsservercore-1903 dotnet/framework/runtime:4.8-windowsservercore-2004
7.34 sec 5.41 sec 6.8 sec 3.76 sec

 

What if I’m using PowerShell Core instead of Windows PowerShell in my containers?

If have already moved your workloads from Windows PowerShell to PowerShell Core, you should continue to use the windowsservercore images from microsoft/powershell, and when the Windows Server reductions graduate from Insiders you’ll simply enjoy the benefit of smaller image sizes.

That’s it!

Thanks to everyone leveraging PowerShell in Docker containers! And make sure to file any issues you have in our powershell-docker repository.

Thanks,
Joey Aiello
Program Manager, PowerShell

PowerShell 7 Preview 6

This post was originally published on this site

Today we shipped PowerShell 7 Preview.6! This release contains a number of new features and many bug fixes from both the community as well as the PowerShell team. See the Release Notes for all the details of what is included in this release.

This will be the last preview release as we head towards a Release Candidate in December. For the Release Candidate, there will be no more new features although small changes to cmdlets may still be accepted depending on risk of the change. Bug fixes will still be accepted but also accessed for their risk of causing a regression. Finally, we expect General Availability of PowerShell 7 in January as our first Long Term Servicing release.

New Features in Preview 6

This release has a number of new features from both the community as well as the PowerShell team. Remember that preview releases of PowerShell are installed side-by-side with stable versions so you can use both and provide us feedback on previews for bugs and also on experimental features.

You can read about new features in previous preview releases:

There were new features in Preview 1 and Preview 2, but I didn’t blog about them… sorry!

Skip Error Check for Web Cmdlets

Great addition by community member Vincent Damewood to allow skipping the internal HTTP response error check within the web cmdlets. This means that you can now handle the web error yourself including getting the response object as well as the HTTP response headers whereas previously you would have to get it from the resulting error object.

Null Conditional Member Property and Method Access

This is a new language feature that allows you to skip checking if a variable is $null before indexing into the variable, calling a method, or accessing a property. For properties, PowerShell will already allow accesing properties of $null, but this new syntax makes it more clear the intent in the script. Note that because PowerShell allows variable names to end with a question mark, you must use braces around the variable name

Extended Unix Filesystem Information

For users of PowerShell on Linux and macOS, they may miss some of the additional information of the filesystem provided by ls -l (long form of a directory listing). This new feature makes that information available using Get-ChildItem so you are no longer missing any useful information.

Windows PowerShell Compatibility in Preview 6

This release also improves the compatibility of PowerShell 7 with Windows PowerShell 5.1. We’ve brought back many existing cmdlets from Windows PowerShell 5.1 thanks to .NET Core 3! In addition, we have a new feature included with PowerShell 7 that encapsulates the Windows Compatibility Module (more on that below!).

Clipboard Cmdlets

Get-Clipboard and Set-Clipboard are back! Not only are they available again, but they are cross platform compatible which means you can use them on Linux (requires xclip to be installed) and macOS. Note that only text is supported at this time even on Windows.

Performance Counter Cmdlets

Get-Counter is back allowing you to get Windows performance counter information. Note that Import-Counter and Export-Counter cmdlets are not supported in PowerShell 7.

Graphical Tools Cmdlets

With .NET Core 3.0 bringing back WPF support on Windows, we’ve been able to bring back some popular graphical tools. Out-GridView gives a dynamic table view of results in a pipeline with sorting and filtering capabilities and when used with -PassThru can be used interactively within a pipeline to select objects to send back to the pipeline. Show-Command gives a graphical view of a command including parameter sets, parameters, switches, etc… Finally, Get-Help -ShowWindow works again to give a graphical view of PowerShell help content.

Update-List, Out-Printer, and Clear-RecycleBin cmdlets

Update-List allows adding/removing items from a property value that contains a collection of objects within a pipeline. This cmdlet is cross-platform compatible.

Out-Printer sends a PowerShell object to the printer. This cmdlet is only supported on Windows currently.

Clear-RecycleBin empties the recycle bin and is currently only supported on Windows.

Test-Connection Improvements

The original implementation of Test-Connection in Windows PowerShell relied on WMI which made it not cross-platform compatible.

Community member and PowerShell repo maintainer Ilya Sazonov ported the cmdlet to work against .NET Core APIs in PowerShell Core 6 making it work cross-platform. However, this also changed the user experience.

For PowerShell 7, Joel Sallow, another community member made improvements to this cmdlet and also getting back to similar experience as the original cmdlet in Windows PowerShell.

Import Windows PowerShell Modules in PS7

For PowerShell Core 6, we introduced the Windows Compatibility Module to allow importing Windows PowerShell modules that were not compatible with PowerShell Core 6 leveraging WinRM and implicit remoting.

In PowerShell 7, we have included this functionality into Import-Module directly without relying on WinRM, but does rely on Windows PowerShell 5.1 (it won’t work if Windows PowerShell 5.1 is not available).

Basically, for modules in the System32 folder, if the module manifest doesn’t indicate that module is compatible with Core then that module will be loaded in a Windows PowerShell process and using implicit remoting reflected into your PowerShell 7 session.

More details of this feature along with other information regarding Windows PowerShell compatibility in general coming in a separate blog post.

Closing

These are the last of the big changes coming in PowerShell 7 as we heads toward a Release Candidate next month. Please try out this preview and report issues in our GitHub repo as we still have opportunity to fix existing bugs as well as new bugs introduced by these features.

Thanks!

Steve Lee
PowerShell Team

The post PowerShell 7 Preview 6 appeared first on PowerShell.

PowerShell Editor Services Roadmap

This post was originally published on this site

Over the last year we have committed to making the PowerShell editing experience in Visual Studio Code a rich and productive cross-platform alternative for the PowerShell ISE. To that end, we have focused on two primary areas: bringing the PSReadLine experience to the Integrated Console, and improving the stability of the extension while editing and debugging. The goal of this blog post is to walk through how we have made efforts in these key areas, and what our next steps are to follow through on these efforts.

Investments in the reliability of PowerShell in Visual Studio Code

Our number one user request for the PowerShell editing experience in Visual Studio Code is to improve the stability of the editor and debugger. Long-standing constraints in the original design of the PowerShell extension made it difficult to improve its robustness through incremental changes. Instead, over the last six months we prioritized work to re-architect the extension with an emphasis on stability.

Using the Omnisharp Project’s Common Language Server Protocol

Based on the maturity of OmniSharp we took advantage of the project’s common language server protocol implementation which is a .NET library. It is important to note that Omnisharp’s common LSP server library is distinct from Omnisharp which is largely synonymous with the C# LSP backend. While we do hope this Omnisharp port will improve your editing experience, do not expect it to provide additional .NET completions. Omnisharp’s architecture is more robust meaning that bugs that might once have been crashes will now be caught and logged. By leveraging this library we were able to greatly simplify our code and are now more compliant with language server protocol.
Ultimately, we believe that these changes will significantly reduce the number crashes of the extension and improve the performance overall. These changes shipped in the November 2019 release of the PowerShell Preview extension and will ship with the January 2020 release of the PowerShell extension.

Other features of the Omnisharp Port

  • Asynchronous message handling for increase in performance
  • CodeLens requests no longer depend on running PowerShell so IntelliSense hangs should reduce
  • Formatting is now handled directly by the language server

Hosted PSScriptAnalyzer

PSScriptAnalyser (PSSA) is a static code checker for PowerShell modules and scripts, which provides services like script diagnostics and formatting in the PowerShell extension. In our analysis of the PowerShell extension we found that PSScriptAnalyzer had a major impact on the performance of the extension overall so we have been investing in changes to how PSSA integrates with the PowerShell extension.
In the current architecture, the PowerShell extension must interface with PSSA through its cmdlets, which re-instantiate the PSSA engine on every invocation. Further, because we must use PowerShell cmdlet invocation for this, the PowerShell extension is forced to manage the overhead of PowerShell runspace management and command resolution to run PSSA. In scenarios like real-time diagnostics and formatting, this overhead has become a significant bottleneck for the extension. Instead, since PSSA is .NET code at heart, we are moving toward a model allowing direct hosting of PSSA in .NET, with management and invocation of the PSSA engine performed through a set of suitable public .NET APIs. Work on these APIs has entered into a validation and integration phase and we expect this improvement to ship with the January 2020 release of the PowerShell extension.

PSReadLine support in the Integrated Console

Full PSReadLine support has long been at the top of our list for feature requests. It has also been among our most difficult problems to solve because at its core it also required architectural changes in how the PowerShell extension manages threading and runspaces.
The additional challenge of trying to support both legacy versions of PowerShell and a range of platform distributions has caused this problem to continually be delayed. In January of 2019 we released a Preview version of the PowerShell extension which was built on .NET Standard thereby enabling us to support PSReadLine in the integrated console for Windows users on PowerShell Version 5.1 and above.

With PowerShell 7 delivering a fix in .NET Core 3.0 for the way POSIX terminal APIs are handled when starting new processes, we are finally able to move the PSReadLine support currently available in the PowerShell Preview extension into the stable PowerShell extension with support across platform distributions. We expect to ship this update in the same time frame as PowerShell 7 (targeted for January 2020).

Dropping support for PowerShell Versions 3 and 4

Support for PSReadLine in the PowerShell extension Integrated Console depends on changes made in PSReadLine since it moved to version 2.0, where it dropped support for PowerShell versions 3 and 4. In turn, we also made the difficult decision to no longer support PowerShell 3 and 4 in future updates of the extension. In making this decision we analyzed the use of these PowerShell versions and found that approximately 1% of PowerShell session in VSCode use one of these versions. In order to accommodate these use cases we will ship a final stable version of the extension with PowerShell version 3 and 4 support which can continue to be used. To use this version of the extension the user will still install the PowerShell extension through the VSCode marketplace. They will then need to use the extension settings to select their desired version.

DSC Resource Kit Release October 2019

This post was originally published on this site

DSC Resource Kit Release

We just released the DSC Resource Kit!

This release includes updates to 9 DSC resource modules. In the past 6 weeks, 91 pull requests have been merged and 41 issues have been closed, all thanks to our amazing community!

Special thanks to everyone who contributed to the Hacktoberfest effort to update xWebAdministration!!! This accounted for 26 of the pull requests closed this month.

The modules updated in this release are:

  • ActiveDirectoryDsc 4.2.0.0
  • ComputerManagementDsc 7.1.0.0
  • SharePointDsc 3.7.0.0
  • StorageDsc 4.9.0.0
  • xDnsServer .16.0.0
  • xDscResourceDesigner .13.0.0
  • xExchange .30.0.0
  • xHyper-V .17.0.0
  • xWebAdministration 3.0.0.0

For a detailed list of the resource modules and fixes in this release, see the Included in this Release section below.

Our latest community call for the DSC Resource Kit was last Wednesday, October 23. A recording of the call is posted on the PowerShell YouTube channel. You can join us for the next call at 12PM (Pacific time) on August 28th to ask questions and give feedback about your experience with the DSC Resource Kit.

Following this resource kit release, maintainers will begin publishing as soon as they are ready rather than holding 6 weeks to do a group release. In the next community call we will discuss progress and whether we need to do a November release or not. Be sure to follow the DSC Community on Twitter for live updates as modules release.

You can find more information about our progress as a community on the DSC Community page.

We strongly encourage you to update to the newest version of all modules using the PowerShell Gallery, and don’t forget to give us your feedback in the comments below, on GitHub, or on Twitter (@PowerShell_Team)!

Please see our documentation here for information on the support of these resource modules.

Included in this Release

You can see a detailed summary of all changes included in this release in the table below. For past release notes, go to the README.md or CHANGELOG.md file on the GitHub repository page for a specific module (see the How to Find DSC Resource Modules on GitHub section below for details on finding the GitHub page for a specific module).

Module Name Version Release Notes
ActiveDirectoryDsc 4.2.0.0
  • Changes to ActiveDirectoryDsc
    • Resolved custom Script Analyzer rules that was added to the test framework.
    • Resolve style guideline violations for hashtables (issue 516).
  • Changes to ADReplicationSite
    • Added “Description” attribute parameter (issue 500).
    • Added Integration testing (issue 355).
    • Correct value returned for RenameDefaultFirstSiteName (issue 502).
  • Changes to ADReplicationSubnet
    • Added “Description” attribute parameter (issue 503)
    • Added Integration testing (issue 357)
  • Changes to ADReplicationSiteLink
    • Added Integration testing (issue 356).
    • Added ability to set “Options” such as Change Notification Replication (issue 504).
  • Changes to ActiveDirectoryDsc.Common
    • Fix Test-DscPropertyState Failing when Comparing $Null and Arrays. (issue 513)
ComputerManagementDsc 7.1.0.0
  • ComputerManagementDsc:
    • Update psd1 description – Fixes Issue 269.
  • Fix minor style issues with missing spaces between param statements and “(“.
  • SmbServerConfiguration:
    • New resource for configuring the SMB Server settings.
    • Added examples for SMB Server Configuration.
  • Minor corrections to CHANGELOG.MD.
  • ScheduledTask:
    • Fixed bug when description has any form of whitespace at beginning or end the resource would not go into state – Fixes Issue 258.
  • SmbShare:
    • Removal of duplicate code in Add-SmbShareAccessPermission helper function fixes Issue 226.
SharePointDsc 3.7.0.0
        • SPConfigWizard
          • Fixed issue with incorrect check for upgrade status of server
        • SPDistributedCacheService
          • Improved error message for inclusion of server name into ServerProvisionOrder parameters when Present or change to Ensure Absent
        • SPFarm
          • Removed SingleServer as ServerRole, since this is an invalid role.
          • Handle case where null or empty CentralAdministrationUrl is passed in
          • Move CentralAdministrationPort validation into parameter definition to work with ReverseDsc
          • Add NotNullOrEmpty parameter validation to CentralAdministrationUrl
          • Fixed error when changing developer dashboard display level.
          • Add support for updating Central Admin Authentication Method
        • SPFarmSolution
          • Fix for Web Application scoped solutions.
        • SPInstall
          • Fixes a terminating error for sources in weird file shares
          • Corrected issue with incorrectly detecting SharePoint after it has been uninstalled
          • Corrected issue with detecting a paused installation
        • SPInstallLanguagePack
          • Fixes a terminating error for sources in weird file shares
        • SPInstallPrereqs
          • Fixes a terminating error for sources in weird file shares
        • SPProductUpdate
          • Fixes a terminating error for sources in weird file shares
          • Corrected incorrect farm detection, added in earlier bugfix
        • SPSite
          • Fixed issue with incorrectly updating site OwnerAlias and SecondaryOwnerAlias
        • SPWebAppAuthentication
          • Fixes issue where Test method return false on NON-US OS.
StorageDsc 4.9.0.0
  • Disk:
    • Added Location as a possible value for DiskIdType. This will select the disk based on the Location property returned by Get-Disk
    • Maximum size calculation now uses workaround so that Test-TargetResource works properly – workaround for Issue 181.
  • DiskAccessPath:
    • Added Location as a possible value for DiskIdType. This will select the disk based on the Location property returned by Get-Disk
  • WaitForDisk:
    • Added Location as a possible value for DiskIdType. This will select the disk based on the Location property returned by Get-Disk
xDnsServer 1.16.0.0
  • Changes to XDnsServerADZone
    • Raise an exception if DirectoryPartitionName is specified and ReplicationScope is not Custom. (issue 110).
    • Enforce the ReplicationScope parameter being passed to Set-DnsServerPrimaryZone if DirectoryPartitionName has changed.
  • xDnsServer:
    • OptIn to the following Dsc Resource Meta Tests:
      • Common Tests – Relative Path Length
      • Common Tests – Validate Markdown Links
      • Common Tests – Custom Script Analyzer Rules
      • Common Tests – Required Script Analyzer Rules
      • Common Tests – Flagged Script Analyzer Rules
xDscResourceDesigner 1.13.0.0
  • Fix Parameter Blocks to conform to Dsc Style Guidlelines issue 79.
  • Fix README.md MarkDownLint Errors and Formatting Issues
xExchange 1.30.0.0
  • Resolved custom Script Analyzer rules that was added to the test framework.
  • Added xExchAcceptedDomain resource
  • Resolved hashtable styling issues
  • Added xExchRemoteDomain resource
xHyper-V 3.17.0.0
  • MSFT_xVMNetworkAdapter:
    • Added NetworkSettings to be able to statically set IPAddress.
    • Added option for Vlan tagging. You can now setup a Network Adapeter as an access switch on a specific Vlan.
xWebAdministration 3.0.0.0
  • Changes to xWebAdministration
    • Changes to PULL_REQUEST_TEMPLATE.md
      • Improving descriptive text around the CHANGELOG.md entry.
      • Adding note that entry in CHANGELOG.md is mandatory for all PRs.
    • Resolved custom Script Analyzer rules that was added to the test framework.
    • Moved change log from README.md to a separate CHANGELOG.md (issue 446).
    • Remove example “Creating the default website using configuration data” from README.md (issue 488).
    • Removed examples README.md as it was obsolete (issue 482).
    • Updated Ensure property description for xIisHandler resource to match schema.mof
    • Moved examples from Readme.md to respective /Examples/Resources/ folders (issue 486).
    • Created new folder structure for examples so that examples will be placed in /Examples/Resources/$resourceName (issue 483).
    • Added a table of contents for the resource list (issue 450).
    • Alphabetized the resource list in the README.md (issue 449).
    • Optimized exporting in the module manifest for best performance (issue 448).
    • Updated hashtables in the repo to adhere to the style guidelines described at https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.mdcorrect-format-for-hashtables-or-objects (issue 524)
    • Moved example Sample_EndToEndxWebAdministration from readme.md to a separate .ps1 in /examples/ (issue 491)
    • Removed example “Create and configure an application pool” from README.md (issue 489).
  • Changes to xIisHandler
    • Updated schema.mof to include descriptions for each property (issue 453).
    • Moved MSFT_xIisHandler localization strings to strings.psd1 (issue 463).
  • Changes to xWebSite
    • Fix Get-TargetResource so that LogFlags are returned as expected array of strings (one for each flag) rather than an array containing a single comma-separated string of flags” (issue 332).
    • Moved localization strings to strings.psd1 file (issue 475)
    • Updated schema.mof so that each property has an appropriate description (issue 456).
    • Updated schema.mof and README so that SourceType and SourceName properties for MSFT_xLogCustomFieldInformation are associated with the appropriate descriptions and valuemaps/values (issue 456).
    • Move examples from README.md to resource examples folder (issue 487).
    • Fix case of resource name from xWebsite to xWebSite (issue 535).
  • Changes to xIISLogging
    • Fix Get-TargetResource so that LogFlags are returned as expected array of strings (one for each flag) rather than an array containing a single comma-separated string of flags (issue 332).
    • Moved MSFT_xIisLogging localization strings to strings.psd1 (issue 464).
  • Changes to xSslSettings
    • Updated casing of xSslSettings in all file names, folder names, schema, and documentation (issue 461).
    • Updated casing of xSslSettings in all file names, folder names, schema, and documentation (issue 536).
    • Moved MSFT_xSslSettings localization strings to strings.psd1 (issue 467).
  • Changes to xWebConfigKeyValue
    • Updated schema.mof to include a description for the Ensure property (issue 455).
    • Move localization strings to strings.psd1 file (issue 472).
  • Changes to xWebAppPoolDefaults
    • Move localization strings to strings.psd1 file (issue 470).
    • BREAKING CHANGE: Changed ApplyTo key parameter to IsSingleInstance to bring the resource into compliance with published best practices (issue 462).
  • Changes to xWebApplication
    • Move localization strings to strings.psd1 file (issue 468)
    • Add description on class MSFT_xWebApplicationAuthenticationInformation (issue 454).
  • Changes to xIisModule entry
    • Moved xIisModule localization strings to strings.psd1 (issue 466).
  • Changes to xIisMimeTypeMapping
    • Moved MSFT_xIisMimeTypeMapping localization strings to strings.psd1 (issue 465).
  • Changes to xWebVirtualDirectory
    • Moved MSFT_xWebVirtualDirectory localization strings to strings.psd1 (issue 477).
  • Changes to xWebSiteDefaults
    • Move localization strings to strings.psd1 file (issue 475).
    • BREAKING CHANGE: Changed ApplyTo key parameter to IsSingleInstance to bring the resource into compliance with published best practices (issue 457).
    • Fix case of resource name from xWebsiteDefaults to xWebSiteDefaults (issue 535).
  • Changes to xWebConfigProperty
    • Move localization strings to strings.psd1 file (issue 473).
  • Changes to xWebConfigPropertyCollection
    • Move localization strings to strings.psd1 file (issue 474).
  • Changes to xIisFeatureDelegation
    • Moved MSFT_xIisFeatureDelegation localization strings to strings.psd1 (issue 459).
  • Changes to xWebAppPool
    • Moved MSFT_xWebAppPool localization strings to strings.psd1 (issue 469).

How to Find Released DSC Resource Modules

To see a list of all released DSC Resource Kit modules, go to the PowerShell Gallery and display all modules tagged as DSCResourceKit. You can also enter a module’s name in the search box in the upper right corner of the PowerShell Gallery to find a specific module.

Of course, you can also always use PowerShellGet (available starting in WMF 5.0) to find modules with DSC Resources:

# To list all modules that tagged as DSCResourceKit
Find-Module -Tag DSCResourceKit 
# To list all DSC resources from all sources 
Find-DscResource

Please note only those modules released by the PowerShell Team are currently considered part of the ‘DSC Resource Kit’ regardless of the presence of the ‘DSC Resource Kit’ tag in the PowerShell Gallery.

To find a specific module, go directly to its URL on the PowerShell Gallery:
http://www.powershellgallery.com/packages/< module name >
For example:
http://www.powershellgallery.com/packages/xWebAdministration

How to Install DSC Resource Modules From the PowerShell Gallery

We recommend that you use PowerShellGet to install DSC resource modules:

Install-Module -Name < module name >

For example:

Install-Module -Name xWebAdministration

To update all previously installed modules at once, open an elevated PowerShell prompt and use this command:

Update-Module

After installing modules, you can discover all DSC resources available to your local system with this command:

Get-DscResource

How to Find DSC Resource Modules on GitHub

All resource modules in the DSC Resource Kit are available open-source on GitHub.
You can see the most recent state of a resource module by visiting its GitHub page at:
https://github.com/PowerShell/< module name >
For example, for the CertificateDsc module, go to:
https://github.com/PowerShell/CertificateDsc.

All DSC modules are also listed as submodules of the DscResources repository in the DscResources folder and the xDscResources folder.

How to Contribute

You are more than welcome to contribute to the development of the DSC Resource Kit! There are several different ways you can help. You can create new DSC resources or modules, add test automation, improve documentation, fix existing issues, or open new ones.
See our contributing guide for more info on how to become a DSC Resource Kit contributor.

If you would like to help, please take a look at the list of open issues for the DscResources repository.
You can also check issues for specific resource modules by going to:
https://github.com/PowerShell/< module name >/issues
For example:
https://github.com/PowerShell/xPSDesiredStateConfiguration/issues

Your help in developing the DSC Resource Kit is invaluable to us!

Questions, comments?

If you’re looking into using PowerShell DSC, have questions or issues with a current resource, or would like a new resource, let us know in the comments below, on Twitter (@PowerShell_Team), or by creating an issue on GitHub.

Michael Greene
Principal Program Manager
PowerShell DSC Team
@migreene (Twitter)
@mgreenegit (GitHub)

The post DSC Resource Kit Release October 2019 appeared first on PowerShell.

PowerShell 7 Preview 5

This post was originally published on this site

Today we shipped PowerShell 7 Preview5! This release contains a number of new features and many bug fixes from both the community as well as the PowerShell team. See the Release Notes for all the details of what is included in this release.

We are still on track to have one more preview release next month in November. Then, barring any quality concerns, a Release Candidate in December aligned with the .NET Core 3.1 final release. Finally, we expect General Availability of PowerShell 7 in January as our first Long Term Servicing release.

Between the Release Candidate and General Availability, we will only accept critical bug fixes and no new features will be included. For that release, some Experimental Features will be considered design stable and no longer be Experimental. This means that any future design changes for those features will be considered a breaking change.

New Features in Preview 5

This release has a number of new features from both the community as well as the PowerShell team. Remember that preview releases of PowerShell are installed side-by-side with stable versions so you can use both and provide us feedback on previews for bugs and also on experimental features.

You can read about new features in previous preview releases:

There were new features in Preview 1 and Preview 2, but I didn’t blog about them… sorry!

Chain operators

The new Pipeline Chain Operators allow conditional execution of commands depending on whether the previous command succeeded for failed. This works with both native commands as well as PowerShell cmdlets or functions. Prior to this feature, you could already do this by use of if statements along with checking if $? indicated that the last statement succeeded or failed. This new operator makes this simpler and consistent with other shells.

img

Null conditional operators for coalescing and assignment

Often in your scripts, you may need to check if a variable is $null or if a property is $null before using it. The new Null conditional operators makes this simpler.

The new ?? null coalescing operator removes the need for if and else statements if you want to get the value of a statement if it’s not $null or return something else if it is $null. Note that this doesn’t replace the check for a boolean value of true or false, it’s only checking if it’s $null.

The new ??= null conditional assignment operator makes it easy to assign a variable a value only if it’s not $null.

img

New PowerShell version notification

Our telemetry available in our PowerBI Dashboard indicates some set of users are still using older versions (sometimes older previews of released stable versions!). This new feature will inform you on startup if a new preview version is available (if you are using a preview version) or if a new stable version is available to keep you up-to-date on the latest servicing release which may contain security fixes. Because this is new, you won’t see this in action until Preview 6 comes out.

More details of this feature including how to disable it in the Notification on Version Update RFC

img

Tab completion for variable assignment

This new feature will allow you to use tab completion on variable assignment and get allowed values for enums or variables with type constraints like [ValidateSet()]. This makes it easy to change $ErrorActionPreference or the new $ErrorView (detailed below) to valid values without having to type them out.

img

Format-Hex improved formatting

This improvement comes from Joel Sallow making Format-Hex more useful when viewing different types of objects in a pipeline as well as supporting viewing more types of objects.

img

Get-HotFix is back

The Get-HotFix cmdlet only works on Windows and will query the system on what patches have been installed. This was previously unavailable in PowerShell Core 6 because it depended on System.Management namespace which wasn’t available on .NET Core 2.x which PowerShell Core 6.x is built on. However, .NET Core 3.0 which PowerShell 7 is built on brought back this namespace (for Windows only) so we re-enabled this cmdlet.

There is a delay getting results in this example due to the number of patches I have on my Windows 7 VM.

img

Select-String adds emphasis

This was a HackIllinois project by Derek Xia that uses inverse colored text to highlight the text in a string that matches the selection criteria. There is an optional -NoEmphasis switch to suppress the emphasis.

img

ConciseView for errors

Some user feedback we’ve consistently received is about the amount of red text you get when you encounter an error in PowerShell.

The $ErrorView preference variable allows you to change the formatting of errors. Previously, it supported NormalView (the default) as well as a more terse CategoryView. This feature adds a ConciseView where most commands return just the relevant error message. In cases where there is additional contextual information in a script file or the location in a script block, you get the line number, the line of text in question, and a pointer to where the error occurred.

This new view is part of the Update Error View RFC so please provide feedback there!

img

Get-Error cmdlet

While ConciseView gives you more precise, but limited information on errors, we added a new cmdlet Get-Error to get much richer information on errors.

By default, just running Get-Error shows a formatted view of the most recent error including showing specific nested types like Exceptions and ErrorRecords making it easier to diagnose what went wrong.

This new cmdlet is part of the Update Error View RFC so please provide feedback there!

img

Closing

We have one more preview planned for November with a few more features coming from the PowerShell team as well as the PowerShell community!

Steve Lee
PowerShell Team

The post PowerShell 7 Preview 5 appeared first on PowerShell.

DSC Resource Kit Release September 2019

This post was originally published on this site

We just released the DSC Resource Kit!

This release includes updates to 15 DSC resource modules. In the past 6 weeks, 160 pull requests have been merged and 68 issues have been closed, all thanks to our amazing community!

The modules updated in this release are:

  • ActiveDirectoryCSDsc 4.1.0.0
  • ActiveDirectoryDsc 4.1.0.0
  • ComputerManagementDsc 7.0.0.0
  • DFSDsc 4.4.0.0
  • NetworkingDsc 7.4.0.0
  • SecurityPolicyDsc 2.10.0.0
  • SqlServerDsc 13.2.0.0
  • xDnsServer 1.15.0.0
  • xExchange 1.29.0.0
  • xFailOverCluster 1.13.0.0
  • xPSDesiredStateConfiguration 8.10.0.0
  • xRemoteDesktopSessionHost 1.9.0.0
  • xSCSMA 2.1.0.0
  • xWebAdministration 2.8.0.0

For a detailed list of the resource modules and fixes in this release, see the Included in this Release section below.

Our latest community call for the DSC Resource Kit was last Wednesday, September 11. A recording of the call is posted on the PowerShell YouTube channel. You can join us for the next call at 12PM (Pacific time) on August 28th to ask questions and give feedback about your experience with the DSC Resource Kit.

The next DSC Resource Kit release will be on Wednesday, October 9.

We strongly encourage you to update to the newest version of all modules using the PowerShell Gallery, and don’t forget to give us your feedback in the comments below, on GitHub, or on Twitter (@PowerShell_Team)!

Please see our documentation here for information on the support of these resource modules.

Included in this Release

You can see a detailed summary of all changes included in this release in the table below. For past release notes, go to the README.md or CHANGELOG.md file on the GitHub repository page for a specific module (see the How to Find DSC Resource Modules on GitHub section below for details on finding the GitHub page for a specific module).

Module Name Version Release Notes
ActiveDirectoryCSDsc 4.1.0.0
  • AdcsCertificationAuthoritySettings:
    • Fix grammar in the resource README.md.
  • Fix minor style issues in statement case.
ActiveDirectoryDsc 4.1.0.0
    • We could not add the change log to the release notes due to the length of the change log. What have change in this release can be found here

https://github.com/PowerShell/ActiveDirectoryDsc/blob/dev/CHANGELOG.md#4100

    .
ComputerManagementDsc 7.0.0.0
  • ScheduledTask:
    • Better compatibility with Group LogonType when passing BuiltIn groups through ExecuteAsCredential
      • Primary use case is “BUILTINUsers”
      • Use the ExecuteAsCredential property to pass the username The PSCredential needs a non-null that is ignored
    • Delay property not handled properly on AtLogon and AtStartup trigger – Fixes Issue 230
    • Changed Get-ScheduledTask calls to ScheduledTasksGet-ScheduledTask to avoid name clash with Carbon module. Fixes Issue 248
    • Cast MultipleInstances value returned by Get-TargetResource to string – fixes Issue 255
  • PendingReboot:
    • Migrated xPendingReboot from xPendingReboot and renamed to PendingReboot.
    • Converted to meet HQRM guidelines – Fixes Issue 12.
    • Changed SkipCcmClientSDK parameter to default to $true – Fixes Issue 13.
    • Fixed Test-TargetResource so that if ConfigMgr requires a reboot then the pending reboot will be set – Fixes Issue 26.
    • Refactored Test-TargetResource to reduce code duplication and move to a data driven design.
    • Refactored Get-TargetResource by adding a new function Get-PendingRebootState so that Test-TargetResource no longer needed to use Get-TargetResource. This eliminated the need to include write parameters in Get-TargetResource.
    • Converted the call to Invoke-WmiMethod to Invoke-CimMethod.
    • Deleted the code that removes the regRebootLocations variable at the end of the resource as it appears to serve no purpose.
  • Correct all tests to meet Pester 4.0 standards.
  • RemoteDesktopAdmin:
    • New resource for configuring Remote Desktop for Administration – fixes Issue 224.
  • Updated common function Test-DscParameterState to support ordered comparison of arrays by copying function and tests from NetworkingDsc – fixes Issue 250.
  • BREAKING CHANGE: ScheduledTask:
    • Correct output type of DaysInterval,StartTime,WeeksDaysOfWeek, and WeeksInterval parameters from Get-TargetResource to match MOF.
    • Refactored Get-TargetResource to remove parameters that are not key or required – fixes Issue 249.
    • Added function Test-DateStringContainsTimeZone to determine if a string containing a date time includes a time zone.
    • Enable verbose preference to be passed through to Test-DscParameterState.
    • Changed Test-TargetResource so that StartTime is only compared for trigger types Daily,Weekly or Once.
  • Fix minor style issues in statement case.
DFSDsc 4.4.0.0
  • Fix example publish to PowerShell Gallery by adding gallery_api environment variable to AppVeyor.yml – fixes Issue 91.
  • Fix minor style issues in statement case.
NetworkingDsc 7.4.0.0
  • Added Comment Based Help for New-NotImplementedException common function – fixes Issue 411.
  • Added common function “Format-Win32NetworkADapterFilterByNetConnectionID” to properly accept wild cards for Win32_NetworkAdapter filters.
  • Updated MSFT_Netbios to use “Format-Win32NetworkADapterFilterByNetConnectionID”
  • Corrected minor style and consistency issues in NetworkingDsc.Common.tests.ps1 and NetworkingDsc.Common.ps1.
  • Changed verbose messages in Test-DscParameterState to include full type name.
  • Fixed bug in Test-DscParameterState that causes it to return true when both the current array and desired array is empty.
  • Fix minor style issues in statement case.
SecurityPolicyDsc 2.10.0.0
  • Changes to SecurityPolicyDsc
    • Opt-in to the following DSC Resource Common Meta Tests:
      • Common Tests – Validate Module Files
      • Common Tests – Validate Script Files
      • Common Tests – Validate Markdown Files
      • Common Tests – Required Script Analyzer Rules
      • Common Tests – Flagged Script Analyzer Rules
      • Common Tests – New Error-Level Script Analyzer Rules
      • Common Tests – Custom Script Analyzer Rules
      • Common Tests – Validate Markdown Links
      • Common Tests – Relative Path Length
      • Common Tests – Validate Example Files
      • Common Tests – Validate Example Files To Be Published
    • Fix keywords to lower-case to align with guideline.
SqlServerDsc 13.2.0.0
  • Changes to SqlServerDsc
    • Fix keywords to lower-case to align with guideline.
    • Fix keywords to have space before a parenthesis to align with guideline.
xDnsServer 1.15.0.0
xExchange 1.29.0.0
  • Enable Script Analyzer default rules
  • Fixed keywords in upper case
xFailOverCluster 1.13.0.0
  • Updated the xCluster test method to return true if a node is joined to the cluster but is in a Paused state.
xPSDesiredStateConfiguration 8.10.0.0
  • Changes to xPSDesiredStateConfiguration
    • Fix keywords to lower-case to align with guideline.
  • Added SMB PullServer support for publishing.
xRemoteDesktopSessionHost 1.9.0.0
  • Changes to xRDRemoteApp
    • Fixing typo in parameter name when calling the function ValidateCustomModeParameters (issue 50).
  • Changes to xRDSessionDeployment
    • When RDMS service does not exist the Get-TargetResource will no longer throw an error (issue 47).
  • Rename Tests/Unit folder to use upper case on first letter.
  • Update appveyor.yml to use the default template.
  • Added default template files .codecov.yml, .gitattributes, and .gitignore, and .vscode folder.
  • xRDSessionCollectionConfiguration:
    • Changed CollectionName variable validation max length to 256
  • xRDSessionCollection
    • Changed CollectionName variable validation max length to 256
  • xRDRemoteApp
    • Changed CollectionName variable validation max length to 256
xSCSMA 2.1.0.0
  • Update appveyor.yml to use the default template.
  • Added default template files .codecov.yml, .gitattributes, and .gitignore, and .vscode folder.
  • Closed issue 29 – Web bindings fail due to hardcoded WSE
  • Switched from Get-WmiObject Win32_Product to Get-ItemProperty for identifer number
xWebAdministration 2.8.0.0
  • Fix multiple HTTPS bindings on one xWebsite receiving the first binding”s certificate 332
    • Added unit regression test
  • Changes to xWebsite
    • Added ServerAutoStart (controls website autostart) and changed documentation for ServiceAutoStartEnabled (controls application auto-initialization). Fixes 325.
    • Fix multiple HTTPS bindings on one xWebsite receiving the first binding”s certificate 332
      • Added unit regression test
    • Changes to xWebAppPool
      • Fix false Test-TargetResource failure for logEventOnRecycle if items in the Configuration property are specified in a different order than IIS natively stores them 434
    • Changes to xIisModule
      • Fixed the parameters specification for the internal Get-IISHandler and Remove-IISHandler function

How to Find Released DSC Resource Modules

To see a list of all released DSC Resource Kit modules, go to the PowerShell Gallery and display all modules tagged as DSCResourceKit. You can also enter a module’s name in the search box in the upper right corner of the PowerShell Gallery to find a specific module.

Of course, you can also always use PowerShellGet (available starting in WMF 5.0) to find modules with DSC Resources:

# To list all modules that tagged as DSCResourceKit
Find-Module -Tag DSCResourceKit 
# To list all DSC resources from all sources 
Find-DscResource

Please note only those modules released by the PowerShell Team are currently considered part of the ‘DSC Resource Kit’ regardless of the presence of the ‘DSC Resource Kit’ tag in the PowerShell Gallery.

To find a specific module, go directly to its URL on the PowerShell Gallery:
http://www.powershellgallery.com/packages/< module name >
For example:
http://www.powershellgallery.com/packages/xWebAdministration

How to Install DSC Resource Modules From the PowerShell Gallery

We recommend that you use PowerShellGet to install DSC resource modules:

Install-Module -Name < module name >

For example:

Install-Module -Name xWebAdministration

To update all previously installed modules at once, open an elevated PowerShell prompt and use this command:

Update-Module

After installing modules, you can discover all DSC resources available to your local system with this command:

Get-DscResource

How to Find DSC Resource Modules on GitHub

All resource modules in the DSC Resource Kit are available open-source on GitHub.
You can see the most recent state of a resource module by visiting its GitHub page at:
https://github.com/PowerShell/< module name >
For example, for the CertificateDsc module, go to:
https://github.com/PowerShell/CertificateDsc.

All DSC modules are also listed as submodules of the DscResources repository in the DscResources folder and the xDscResources folder.

How to Contribute

You are more than welcome to contribute to the development of the DSC Resource Kit! There are several different ways you can help. You can create new DSC resources or modules, add test automation, improve documentation, fix existing issues, or open new ones.
See our contributing guide for more info on how to become a DSC Resource Kit contributor.

If you would like to help, please take a look at the list of open issues for the DscResources repository.
You can also check issues for specific resource modules by going to:
https://github.com/PowerShell/< module name >/issues
For example:
https://github.com/PowerShell/xPSDesiredStateConfiguration/issues

Your help in developing the DSC Resource Kit is invaluable to us!

Questions, comments?

If you’re looking into using PowerShell DSC, have questions or issues with a current resource, or would like a new resource, let us know in the comments below, on Twitter (@PowerShell_Team), or by creating an issue on GitHub.

Michael Greene
Principal Program Manager
PowerShell DSC Team
@migreene (Twitter)
@mgreenegit (GitHub)

The post DSC Resource Kit Release September 2019 appeared first on PowerShell.

PowerShell 7 Preview 4

This post was originally published on this site

We continue to make progress towards our PowerShell 7 release which currently is targeting December 2019 for a Release Candidate and January 2020 for General Availability and will be our first LTS (Long Term Servicing) release!

Please see the previous blog post on Preview 3 for more details about LTS and also Windows PowerShell compatibility.

Preview 4 contains a number of bug fixes, but also new features which I’ll cover in this blog post.

New Features in Preview 4

This is just a small part of the entire changelog. New experimental features in this preview from the community and also the PowerShell team:

Ternary Operator

The ternary operator is popular among C# developers due to its terseness which can improve readability if you are familiar with this operator.

This operator is completely opt-in so if you prefer to use if..else instead, you can certainly continue to do that.

gif

Start-Job -WorkingDirectory

Those of you familiar with the Start-Job cmdlet will have encountered that the new PowerShell process started to handle the job will have different working directory on Windows PowerShell and PowerShell Core and it can sometimes be not what you expected. This parameter was added to allow you to specify the working directory of the new job process before your script block runs!

gif

$ErrorActionPreference = “Break”

This feature comes from a well known PowerShell MVP Kirk Munro. Basically, if you set $ErrorActionPreference to Break, then when there is an error it will drop you into the debugger immediately!

gif

Invoke-DscResource

With this change, you can now leverage DSC Resources while by-passing the LCM (Local Configuration Manager). This means that you can author your own LCM or simply leverage existing DSC Resources within your scripts and this also works cross platform!

Note that binary DSC Resources are not supported!

gif

DSC Configuration Compilation

Previously if you authored a DSC Configuration script, you would need to use a Windows machine to compile it to a mof file to deploy onto your managed node. Starting with Preview4, you can now perform DSC compilation on non-Windows systems.

Note that this is work in progress with some known issues.

gif

Testing the MSIX package

Recently, we started publishing a MSIX package for Windows. This will eventually allow us to publish PowerShell 7 to the Windows Store. For now, if you wish to try out this package, you must be in Developer Mode and use Add-AppxPackage to install it. Double clicking it from the Windows Shell will not allow you to install the developer signed package.

Closing

Although this blog post focuses on new features, this release also contains many bug fixes as well as targeted performance improvements.

You can always get the latest version of PowerShell from https://aka.ms/get-powershell.

Expect more new features from the community and the PowerShell team in future Preview releases!

Steve Lee
PowerShell Team

The post PowerShell 7 Preview 4 appeared first on PowerShell.