Deltas/Get-NAVObjectVersion.ps1
function Get-NAVObjectVersion { Param( [Parameter(Mandatory=$true)] [string]$ObjectFilePath, [Parameter(Mandatory=$false)] [string]$VersionPrefix = '' ) [string]$ObjectContent = Get-Content -Path $ObjectFilePath -Raw [int]$VersionListIndex = $ObjectContent.IndexOf("Version List=") [string]$VersionList = $ObjectContent.Substring($VersionListIndex + 13,$ObjectContent.IndexOf(";",$VersionListIndex) - ($VersionListIndex + 13)) if ($VersionPrefix -eq '') { $VersionList } else { $VersionLists = @() $VersionLists = $VersionList.Split(',') $VersionLists = $VersionLists -like ('{0}*' -f $VersionPrefix) if ($VersionLists.Length -gt 0) { $VersionLists.Item(0) } } } Export-ModuleMember -Function Get-NAVObjectVersion |