How to Identify Version of PowerShell Installed on Server Using TSQL Script
More and more DBAs are now move towards using PowerShell to perform routine Database Maintenance Tasks on SQL Server. In this article we will go through the quick steps to determine which version of PowerShell is installed on the Server where SQL Server is hosted using TSQL Script.
TSQL Script to Identify Version of PowerShell Installed on SQL Server Host Machine
Execute the below mentioned TSQL script to identify version of PowerShell which is installed on SQL Server using xp_regread undocumented extended stored procedure.
EXEC master.dbo.xp_regread @rootkey= N'HKEY_LOCAL_MACHINE', @key= N'SOFTWARE\Microsoft\PowerShell\1\PowerShellEngine', @value_name= N'PowerShellVersion' GO
Identify Version of PowerShell Installed on SQL Server Host Machine Using PowerShell
Lets verify the version of PowerShell Installed on SQL Server using SQL Server PowerShell.
1. Connect to SQL Server Instance Using SQL Server
3. Once SQL Server PowerShell opens up type $PSVersionTable.PSVersion and press enter to get the results.
4. Finally type Exit to close the PowerShell window.
Last Updated On: Aug 10, 2015
Please leave your Valuable Comment or Let us know how this article helped you: