My precedent is for what I need: the goal I want to achieve is the ability to silently deploy PowerShell 5 only on workstations through automation, I should be able to prevent my deployment from deploying from servers so that I don't force the world to spontaneously collapse itself by oneself.
I am currently using the following code to capture a powered version of a shell
$BuildVersion = [System.Environment]::OSVersion.Version
Write-Host($BuildVersion)
and using
if ($BuildVersion.Major -le '6')
To exclude any machines that are not running at least 7, I found that I would have a problem since Windows 7 and Windows Server 2008 R2 have the same major build number.
My first thought was to change the code to only allow specific build numbers
, 7 2008 R2 6.1.7601.
, PowerShell 2.0 Windows, .
, .