Author Posts

October 25, 2017 at 3:12 pm

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 ?

October 25, 2017 at 5:46 pm

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.