What PS Version is needed to run my script?

I was running into a similar issue.

I was using ConvertTo-JSON to export my PS queries about my remote servers, and realized it stopped working once I went from running the script on my Windows 10 machine to a 2008 R2 server. I google searched ConvertTo-JSON along with the error code and it pointed me to some resources saying what versions of PS were compatible with ConvertTo-JSON.

At any rate, the 2008 R2 server I ran the script on had an older version of PS that it wasn't suppose to have.

Use this chart to find out what is the highest version of PS is compatible on your OS:

PowerShell Version Release Date Default Windows Versions Available Windows Versions
PowerShell 1.0 November 2006 Windows Server 2008 Windows XP SP2 
Windows XP SP3Windows Server 2003 SP1Windows Server 2003 SP2Windows Server 2003 R2Windows VistaWindows Vista SP2
PowerShell 2.0 October 2009 Windows 7 
Windows Server 2008 R2 Windows XP SP3 
Windows Server 2003 SP2Windows Vista SP1Windows Vista SP2Windows Server 2008 SP1Windows Server 2008 SP2
PowerShell 3.0 September 2012 Windows 8 
Windows Server 2012 Windows 7 SP1 
Windows Server 2008 SP2Windows Server 2008 R2 SP1
PowerShell 4.0 October 2013 Windows 8.1 
Windows Server 2012 R2 Windows 7 SP1 
Windows Server 2008 R2 SP1Windows Server 2012
PowerShell 5.0 April 2014 Windows 10 Windows 8.1 
Windows Server 2012 R2
/r/PowerShell Thread