#PSTip New PowerShell Commands in Windows 10 Anniversary Update

Windows 10 Anniversary Update was made generally available on August 2, 2016.

Included in the update is a new version of Windows Management Framework, which has now reached version 5.1. By using the Get-PSVersion function in the PSVersion module I released earlier this year, we can determine that the build number is now 5.1.14393.0:

By using Get-PSVersion -ListVersion we can also see the full history of PowerShell 5.* RTM versions for comparison:

What might be even more interesting is to check out what commands are new between 5.1.14393.0 and the previous RTM build (5.0.10586.494). To make this process more convenient we can leverage another module I released this year, the PSVersionCompare module. Details on how to install it and perform a comparison between two PowerShell versions is available in “Comparing Commands Between PowerShell Versions” article.

Since the initial release, I have also added functions to compare automatic variables as well. This is the commands I ran to compare the XML files from computer A running version 5.0.10586.494 and computer B running version 5.1.14393.0:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
Install-Module -Name PSVersionCompare
Import-Module -Name PSVersionCompare

$PSDataPath = "~\Documents"
$OutputPath = "~\Documents"
$SourceVersion = 'Microsoft Windows 10 Enterprise_5.0.10586.494_Desktop'
$CompareVersion = 'Microsoft Windows 10 Enterprise_5.1.14393.0_Desktop'

$Computers = @('ComputerA','ComputerB')

foreach ($Computer in $Computers) {

Get-PSVersionCommand -ComputerName $Computer -Export -Verbose
Get-PSVersionVariable -ComputerName $Computer -Export -Verbose

}

Compare-PSVersionCommand -SourceVersionPath (Join-Path -Path $PSDataPath -ChildPath ($SourceVersion + '_Commands.xml')) -CompareVersionPath (Join-Path -Path $PSDataPath -ChildPath ($CompareVersion + '_Commands.xml')) 6>&1  | Out-File -FilePath (Join-Path -Path $OutputPath -ChildPath ($SourceVersion + '_' + $CompareVersion + '_Commands.txt'))

Compare-PSVersionVariable -SourceVersionPath (Join-Path -Path $PSDataPath -ChildPath ($SourceVersion + '_Variables.xml')) -CompareVersionPath (Join-Path -Path $PSDataPath -ChildPath ($CompareVersion + '_Variables.xml')) 6>&1  | Out-File -FilePath (Join-Path -Path $OutputPath -ChildPath ($SourceVersion + '_' + $CompareVersion + '_Variables.txt'))

There is a lot of changes, which you can review in the following files generated by the above commands:

Some highlights to notice:

  • Four new modules: AppvClient, Microsoft.PowerShell.LocalAccounts, Microsoft.PowerShell.Operation.Validation and UEV
  • Three new cmdlets in module Microsoft.PowerShell.Management: Get-ComputerInfo, Get-TimeZone, and Set-TimeZone
  • Test-Connection has new parameters to support both DCOM and WSMan protocols.
  • Test-NetConnection has new parameters for constraining to an Interface or Source address.
  • The PackageManagement and PowerShellGet modules have new parameters for proxy support.
  • PSReadLine now has ViMode support.
  • A large number of changes in the Storage module.
  • A new automatic variable: PSEdition. The purpose of this variable is to make it possible to distinguish between Desktop edition (“regular” PowerShell based on the full .NET Framework) and Core edition (used on Nano Server, based on .NET Core). A couple of other side notes on this topic: PSEdition is also a new property in the $PSVersionTable automatic variable, and Update-ModuleManifest now has a CompatiblePSEditions parameter in order to specify which PowerShell Edition a module supports.

Of course there are many other enhancements in Windows Management Framework 5.1 which we did not discover by using the PSVersionCompare module. Be sure to check out the WMF 5.1 Release notes to find out more.

Share on: