Bryan
Bryan

Reputation: 5471

Update PowerShell version in Visual Studio 2017

I ran the following in the Visual Studio 2017 Package Manager Console -

PM> $PSVersionTable.PSVersion

 Major  Minor  Build  Revision
 -----  -----  -----  -------- 
 2      0      -1     -1

When I run the same command from a PowerShell window I get -

PS C:\>  $PSVersionTable.PSVersion

Major  Minor  Build  Revision
-----  -----  -----  --------
4      0      -1     -1

This is causing me a problem because I want to run something in the package manager that requires PowerShell 3 or above.

Upvotes: 5

Views: 7299

Answers (2)

Bryan
Bryan

Reputation: 5471

I finally got it working. I updated Visual Studio 2017 to 15.3.3 (there was no update available when I posted the question), and I also installed a few Windows updates.

Here the two windows updates -

https://support.microsoft.com/en-us/help/3134760/windows-management-framework-5-0-rtm-on-windows-7-sp1-and-windows-serv

https://www.microsoft.com/en-us/download/details.aspx?id=40855

Upvotes: 1

Collin Chaffin
Collin Chaffin

Reputation: 942

You are not using the latest version of the tools. The latest version per this page:

https://marketplace.visualstudio.com/items?itemName=AdamRDriscoll.PowerShellToolsforVisualStudio2017-18561

Lists the version/update as:

3.0.585 updated 7/6/2017, 9:04:51 AM.

Upvotes: 0

Related Questions