So Im creating an array of all the versions of a particular pkg in a directory What I want to do is strip out all the characters except the version numbers The first array has info such as
GoogleChrome.45.45.34.nupkg GoogleChrome.34.28.34.nupkg
So the output I need is 45.45.34 34.28.34
$dirList = Get-ChildItem $sourceDir -Recurse -Include "*.nupkg" -Exclude
$pkgExclude |
Foreach-Object {$_.Name}
$reg = '.*[0-9]*.nupkg'
$appName ='GoogleChrome'
$ouText = $dirList | Select-String $appName$reg -AllMatches | % {
$_.Matches.Value }
$ouText
$verReg='(\d+)(.)(?!nupkg)'
The last regex matches the pattern of what I want to keep but I cant figure out how to extract what I dont need.
Select-String '(?<=GoogleChrome\.)\d+(?:\.\d+)+' -AllMatches