September 11th, 2019

PowerTip: Identify if you are running on PowerShell Core

Doctor Scripto
Scripter

Summary: Pulling up the properties of $PSVersionTable to identify your PowerShell edition

A picture containing scissors

Description automatically generated

Hey, Doctor Scripto! I want to write my modules and scripts to be more portable. How can I tell if I am executing on PowerShell Core?

Just use the $PSVersionTable object and examine the PSEdition value. If it returns ‘Core’ you are running on PowerShell core.

$PSVersionTable.PSEdition

PowerShell, Doctor Scripto, PowerTip, Sean Kearney

 

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.

Feedback