js file version

Welcome Forums General PowerShell Q&A js file version

This topic contains 1 reply, has 2 voices, and was last updated by

 
Participant
1 year ago.

  • Author
    Posts
  • #82876

    Participant
    Points: 1
    Rank: Member

    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

    Participant
    Points: 4
    Rank: Member

    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.

The topic ‘js file version’ is closed to new replies.