I am trying to sort version numbers descendingly, however versions like "W2018.1.10" are below versions like "W2018.1.2" despite 10 being bigger than 2.
$request = 'place from where I pull the version list'
$content = Invoke-RestMethod -Uri $request -Method GET
$versionarray = $content.versionlist[0].Versionen -split ", "
$sortedArray = $versionArray + "W2018.2.10.1" | sort -Descending
Write-Output $sortedArray
The current array looks like this:
W2019.2.8.7
W2019.2.8.6
W2019.2.8.5
W2019.2.8.3
W2018.2.10.1
It's supposed to look like this:
W2018.2.10.1
W2019.2.8.7
W2019.2.8.6
W2019.2.8.5
W2019.2.8.3