js file version

This topic contains 1 reply, has 2 voices, and was last updated by  Matt Bloomfield 3 weeks, 4 days ago.

  • Author
    Posts
  • #82876

    Arik Cher
    Participant

    Hi

    I need a way to get the version from a js file
    for Json , I use
    Get-Content -Path D:\package.json | Out-String | ConvertFrom-Json |Select-Object version
    is there something similar for js files ?

  • #82891

    Matt Bloomfield
    Participant

    If you're looking to do this for $random website then there's no consistent way of doing it – you're going to be hugely dependant on whether or not the developer has included version information.

    If this is for a site you control where you know the version number consistently appears in .js files you could use a regular expression to extract it.

You must be logged in to reply to this topic.