title: How to get Windows version from command prompt or from PowerShell
body: <p><a href="https://i.stack.imgur.com/cOqHt.png" rel="noreferrer"><img src="https://i.stack.imgur.com/cOqHt.png" alt="Windows version."></a></p>
  
  <p>But is there a way to get the exact version string using command line output similar to the one mentioned in the image?</p>
  
  <p>The attached is the output of "winver" command from run. PS: I am looking for a batch or PowerShell command.</p>
  
  <p>There are some alternates available to get the Windows version like this PowerShell command:</p>
  
  <pre><code>[System.Environment]::OSVersion
  </code></pre>