#powershell v6.0 RTM GA Generally Available and Supported

PowerShell Core 6.0.0

  • a new edition of PowerShell #PsCore6
  • built on top of .NET Core “CoreCLR”
  • cross-platform support from Windows, macOS to Linux (direct download)
  • community driven (GitHub) and open-source
  • built for heterogeneous environments and the hybrid cloud
  • works side-by-side with Windows PowerShell[1] (3.0 and later)
  • $PSVersionTable.PSEdition is set to Core
  • process runs as pwsh(.exe) c.f. Windows Powershell = powershell(.exe)
  • default installation path %programfiles%\PowerShell\
  • starts as Administrator in %programfiles%\PowerShell\6.0.0
  • new user profile path $profile = %userprofile%\Documents\PowerShell
  • different $env:PSModulePath
  • not available features – workflow, WMI[2],  Windows Presentation Foundation/Windows Forms, PowerShell ISE[3]
  • Update-Help -force -UICulture “en-us” (help system independent of Windows Powershell)
  • Windows PowerShell 5.10
    = “maintenance” mode
    =  last Windows client/server version i.e.  no new version planned

[1] built on top of .NET Framework 4.x “FullCLR”
[2] use the equivalent *-CIM* cmdlets
[3] use Visual Studio Code + PowerShell plugin


  1. PowerShell Core 6.0: Generally Available (GA) and Supported!
  2. PowerShell 6.0 Roadmap: CoreCLR, Backwards Compatibility, and More!
  3. Angel Calvo (Twitter): Announcing the GA & Enterprise supported version of #PowerShell Core 6!
  4. Announcing PowerShell for Visual Studio Code 1.0!
  5. What’s New in PowerShell Core 6.0
  6. PowerShell Core Support Lifecycle
  7. PowerShell documentation (en-us)

Zurich Kurs/Course: Windows Server 2016 Basics – Definitiv Start (ab Do. 18. Jan 2018)

Der erste, beliebte Windows Server 2016 Basics Kurs (IS36.18.11) dieses Jahres wird am Do. 18. Jan 2018 für insgesamt 6 Abende* in Zürich West, Technopark planmässig beginnen.

Sichern Sie Ihre Plätze zu diesem praxisnahen Microsoft Training für effizientes Betrieb Ihrer On-premise, Hybrid oder Cloud Datacentrelösungen heute noch!

Mehr Information und Anmeldung finden Sie hier.

Donnerstag 18.01.2018 18:00-21:30
Donnerstag 25.01.2018 18:00-21:30
Donnerstag 01.02.2018 18:00-21:30
Donnerstag 08.02.2018 18:00-21:30
Donnerstag 15.02.2018 Sportsferien
Donnerstag 22.02.2018 Sportsferien
Donnerstag 01.03.2018 18:00-21:30
Donnerstag 08.03.2018 18:00-21:30

#skype4b #powershell Get Registrar Pool Names from Cluster Id (msRTCSIP-PrimaryHomeServer)

Instead of legible plain text is a long string describing the distinguished name of the Skype for Business Front-End Server pool in the msRTCSIP-PrimaryHomeServer Active Directory user attribute. This can become difficult to identify and manage if several registrar pools exist in your environment whether they are located in the same or different sites.

To decipher the DN (pool cluster Id) into the fully qualified distinguished name of the corresponding #skype4b pools, Read more “#skype4b #powershell Get Registrar Pool Names from Cluster Id (msRTCSIP-PrimaryHomeServer)”

#powershell Get-Date v.s. [datetime] Format and System Locale III

On a non-US system locale Windows machine[1], running this statement in a #powershell script will fail:

[datetime]$dt1 = (Get-Date).DateTime
Cannont convert value “Dienstag, 12. Dezember 2017 22:20:20” to type “System.DateTime”. Error: “The string was not recognized as a valid DateTime. There is an unknown word starting at index 0.”
At line:1 char:1
+[datetime]$dt1 = (Get-Date).DateTime
+ CategoryInfo : MetadataError: (:) [], ArgumentTransformationMetadataException
+ FullyQualifiedErrorId : RuntimeException

To resolve this, Read more “#powershell Get-Date v.s. [datetime] Format and System Locale III”

#powershell Get a List of Windows Update Hotfixes & Patches

To retrieve a comprehensive list of installed quick fix engineering hotfixes and patches[1] in Windows Update, you export into a format such as CSV with the help of the perennial $env:windir\Windows\System32\Wbem\WMIC.exe tool:

$file = “qfe.csv”
wmic qfe list full /format:csv > $file
#optionally run in MS-DOS
#wmic qfe list full /format:”%windir%\system32\wbem\en-us\csv.xsl” > “qfe.csv”

Subsequently, you can import the Comma Separated Variable file and… Read more “#powershell Get a List of Windows Update Hotfixes & Patches”

#powershell Get-EventLog <-> Get-WinEvent

Inspecting the Event Log (eventvwr.exe) can provide clues to the startup (Event ID 6005*) and shutdown (Event ID 6006) date/time of a Windows machine. To do this, one common approach is with Get-EventLog:

#requires -version 3.0
Get-EventLog -LogName system -ComputerName FS01 | ? EventId -eq 6006

Instead, a more efficient way without the #powershell pipeline can be achieved using Get-WinEvent:

Get-WinEvent -ComputerName FS01 -FilterHashtable @{ LogName=’system’; Id=6006 }

Look out for Event ID 6008 which records the date/time of unexpected system shutdown.

* Event ID: 12 Provider (Source): Kernel-General contains actual operating system start time.

#powershell -version is not recognized

Note that powershell.exe /? shows the syntax to execute PowerShell from a command prompt. Nevertheless, running

C:\> powershell -noprofile -version 2.0
-version : The term ‘-version’ is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ -version 2.0
+ ~~~~~~~~
+ CategoryInfo : ObjectNotFound: (-version:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

fails … Read more “#powershell -version is not recognized”

#powershell Select-Object -ExcludeProperty

The ExcludeProperty parameter in Select-Object must always be used together with the Property parameter as illustrated:

gsv | Select-Object -ExcludeProperty status -first 1 | select s*

ServiceName : AJRouter
ServicesDependedOn : {}
ServiceHandle : SafeServiceHandle
Status : Stopped
ServiceType : Win32ShareProcess
StartType : Manual
Site :

gsv | Select-Object -ExcludeProperty status -Property s* -first 1 | select s*

ServiceName : AJRouter
ServicesDependedOn : {}
ServiceHandle : SafeServiceHandle
ServiceType : Win32ShareProcess
StartType : Manual
Site :

#powershell Get-Date v.s. [datetime] Format and System Locale II

Irrespective of the Windows system language and locale, a non-US datetime format text string imported from a file into PowerShell may still need to be formated with Get-Date or cast through [datetime] prior to use.

However, date/time operations may fail silently if the conversion or re-formatting did not succeed. Read more “#powershell Get-Date v.s. [datetime] Format and System Locale II”

#powershell Temporary Files

Introduced in PowerShell 5.0, the New-TemporaryFile cmdlet creates a single ‘scratch’ file with the tmp file extension in a user’s $env:temp directory. For previous #powershell versions, you can do this directly with .NET Framework:

$tempfile = [system.io.path]::GetTempFileName()

Likewise, this has the tmp file extension and is automatically placed in $env:temp. Assigning to a variable permits quick access.

Alternatively, you can create a unique file name for temporary usage by taking advantage of your system date/time as depicted:

$d = Get-Date
$d1 = $d.date.ToShortDateString() -replace “:|/|-|\.”
$d2 = $d.TimeOfDay.ToString() -replace “:|\|-|\.”
$tempfile = “$env:temp\” + $d1 + $d2 + “.tmp”