I am trying to get my script finished for checking powershell versions on remote machines, and I am now down to one last part, I am getting a version number of the file back from powershell but I am looking for a way to turn 6.2.1200.XXX to Version 3, my script thus far is
Foreach ($Computer in $Computers)
{
Try
{
Write-Host "Checking Computer $Computer"
$path = "\\$Computer\C$\windows\System32\WindowsPowerShell\v1.0\powershell.exe"
if (test-path $path)
{
Write-host "Powershell is installed::"
[bool](ls $path).VersionInfo
Write-host " "
Write-host "Powershell Remoting Enabled::"
[bool](Test-WSMan -ComputerName $Computer -ErrorAction SilentlyContinue)
}
else
{
Write-Host "Powershell isn't installed" -ForegroundColor 'Red'
}
Write-Host "Finished Checking Computer $Computer"
}