PowerTip: Use PowerShell to Find Versions of SQL Server


Summary: Use Windows PowerShell to find versions of SQL Server.

Hey, Scripting Guy! Question How can I use Windows PowerShell to see all the versions of SQL Server I have installed?

Hey, Scripting Guy! Answer Use the provider and a list of instances to look them up as if they were files in a directory:

$instances = @(‘KIRK’,’SPOCK’,’PICARD’,’RIKER’)

$instances | ForEach-Object {Get-Item “SQLSERVER:\SQL\$_\DEFAULT”} | Select-Object Name,VersionString

Image of command output

Comments (0)

Skip to main content