{"id":85958,"date":"2015-10-29T08:09:23","date_gmt":"2015-10-29T16:09:23","guid":{"rendered":"http:\/\/devblogs.microsoft.com\/scripting\/?p=85958"},"modified":"2019-06-05T08:24:37","modified_gmt":"2019-06-05T16:24:37","slug":"powertip-use-powershell-to-find-versions-of-sql-server-2","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/powertip-use-powershell-to-find-versions-of-sql-server-2\/","title":{"rendered":"PowerTip: Use PowerShell to Find Versions of SQL Server"},"content":{"rendered":"<p><b style=\"font-size:12px;\">Summary<\/b><span style=\"font-size:12px;\">: Use Windows PowerShell to find versions of SQL Server.<\/span><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" alt=\"Hey, Scripting Guy! Question\" \/>&nbsp;How can I use Windows PowerShell to see all the versions of SQL Server I have installed?<\/p>\n<p style=\"margin-left:30px;\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" alt=\"Hey, Scripting Guy! Answer\" \/>&nbsp;Use the provider and a list of instances to look them up as if they were files in a directory:<\/p>\n<p style=\"margin-left:90px;\">$instances = @(&lsquo;KIRK&rsquo;,&rsquo;SPOCK&rsquo;,&rsquo;PICARD&rsquo;,&rsquo;RIKER&rsquo;)<\/p>\n<p style=\"margin-left:90px;\">$instances | ForEach-Object {Get-Item &ldquo;SQLSERVER:\\SQL\\$_\\DEFAULT&rdquo;} | Select-Object Name,VersionString<\/p>\n<p style=\"margin-left:60px;\"><a href=\"http:\/\/devblogs.microsoft.com\/scripting\/wp-content\/uploads\/sites\/29\/2015\/10\/tip.png\"><img decoding=\"async\" src=\"http:\/\/devblogs.microsoft.com\/scripting\/wp-content\/uploads\/sites\/29\/2015\/10\/tip.png\" alt=\"power tip\" width=\"583\" height=\"133\" class=\"aligncenter size-full wp-image-85960\" srcset=\"https:\/\/devblogs.microsoft.com\/scripting\/wp-content\/uploads\/sites\/29\/2015\/10\/tip.png 583w, https:\/\/devblogs.microsoft.com\/scripting\/wp-content\/uploads\/sites\/29\/2015\/10\/tip-300x68.png 300w\" sizes=\"(max-width: 583px) 100vw, 583px\" \/><\/a><\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary: Use Windows PowerShell to find versions of SQL Server. &nbsp;How can I use Windows PowerShell to see all the versions of SQL Server I have installed? &nbsp;Use the provider and a list of instances to look them up as if they were files in a directory: $instances = @(&lsquo;KIRK&rsquo;,&rsquo;SPOCK&rsquo;,&rsquo;PICARD&rsquo;,&rsquo;RIKER&rsquo;) $instances | ForEach-Object {Get-Item &ldquo;SQLSERVER:\\SQL\\$_\\DEFAULT&rdquo;} [&hellip;]<\/p>\n","protected":false},"author":596,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-85958","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting"],"acf":[],"blog_post_summary":"<p>Summary: Use Windows PowerShell to find versions of SQL Server. &nbsp;How can I use Windows PowerShell to see all the versions of SQL Server I have installed? &nbsp;Use the provider and a list of instances to look them up as if they were files in a directory: $instances = @(&lsquo;KIRK&rsquo;,&rsquo;SPOCK&rsquo;,&rsquo;PICARD&rsquo;,&rsquo;RIKER&rsquo;) $instances | ForEach-Object {Get-Item &ldquo;SQLSERVER:\\SQL\\$_\\DEFAULT&rdquo;} [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/85958","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/596"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=85958"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/85958\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=85958"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=85958"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=85958"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}