Getting plugin version from PowerShell?
Hi,

I have an issue that I cannot check the version number in the plugin which has been downloaded.
When I open the plugin I see the version number but I need to extract the version number with powershell so I can do a webrequest to check if the plugin is out-of-date. Anyone know a solution how to do this?
I'm not exactly sure which you are wanting to do...

Are you wanting to check the plugin file or the plugin listing on our site for the version number?
I want to check the plugin version that is installed to the plugin version on the site in order to check if the plugin is up-to-date
You'd have to parse the version in the file using regex or similar method most likely (Google has various tutorials on that via PowerShell).

For the site, you can read the JSON provided from pages such as https://umod.org/plugins/vanish.json
Hi Wulf,

I got the part working where I can extract the version number of the json file. shall have a look at regex looks difficult.

Merged post

Any1 know how to parse the following line from a file in powershell, where i need the third value(in this case 3.3.0) :
[Info("Whitelist", "Wulf/lukespragg", "3.3.0", ResourceId = 1932)]

I am breaking my neck over this.
Probably won't be the best, but give me a moment.

\[Info\(.*([0-9.]+)\)\]​
Thanks Wulf I will check it out!

Merged post

Hi Wulf,

I got this:
PS C:\WINDOWS\system32> $string2 =$content |Select-string -Pattern "\[Info\(.*([0-9.]+)\)\]"
PS C:\WINDOWS\system32> $string2

[Info("Whitelist", "Wulf/lukespragg", "3.3.0", ResourceId = 1932)]

Which is good but, how can I get the third value which is "3.3.0"?

Merged post

Also noticed:
PS C:\WINDOWS\system32> $plugins = Get-ChildItem -Path $serverpath
PS C:\WINDOWS\system32> foreach($plugin in $plugins) {
>> $pluginname = $serverpath + $plugin
>> $content = Get-Content -Path $pluginname
>> $string = $content |Select-string -Pattern "\[Info\(.*([0-9.]+)\)\]"
>> $string
>>
>> }

[Info("Advert Messages", "LaserHydra", "3.0.2", ResourceId = 1510)]
[Info("Godmode", "Wulf/lukespragg/Arainrr", "4.2.7", ResourceId = 673)]
[Info("GUIAnnouncements", "JoeSheep", "1.23.88", ResourceId = 1222)]
[Info("Admin / Player Inventory Cleaner", "TheDoc - Uprising Servers", "1.5.1", ResourceId = 973)]
[Info("Kits", "Reneb", "3.2.93", ResourceId = 668)]
[Info("Loading Messages", "CosaNostra/VVoid", "1.0.5", ResourceId = 2763)]
[Info("MagicLoot", "Norn / Kunazai", "0.1.24", ResourceId = 2212)]
[Info("PermissionsManager", "Steenamaroo", "2.0.3", ResourceId = 0)]
[Info("PlayerList", "Wulf/lukespragg", "0.3.2", ResourceId = 2126)]
[Info("PlayerRanks", "Steenamaroo", "2.0.4", ResourceId = 0)]
[Info("Remover Tool", "Reneb/Fuji/Arainrr", "4.3.14", ResourceId = 651)]
[Info("Rules GUI", "PaiN", "1.5.3", ResourceId = 1247)]
[Info("ServerInfo", "FastBurst", "0.5.4", ResourceId = 1317)]
[Info("Sign Artist", "Whispers88", "1.1.9", ResourceId = 992)]
[Info("Stack Size Controller", "Canopy Sheep", "2.0.3", ResourceId = 2320)]
[Info("VIP Trial", "Maik8", "1.3.5", ResourceId = 2563)]
[Info("VoteRewards", "k1lly0u", "2.1.0", ResourceId = 752)]
[Info("Whitelist", "Wulf/lukespragg", "3.3.0", ResourceId = 1932)]

I got 58 plugins in my plugin folder. Something is up. checked one of the plugins the text is there.
Regex isn't my specialty, so it'd probably take about as much work for you as it would for me to figure that one out. :P
Mine neither I dont know how to use it. Powershell ok but regex cant get my head around it.
slaapzak
Mine neither I dont know how to use it. Powershell ok but regex cant get my head around it.
Well i dont know what you are looking for, but i have a plugin that cheks all plugins for outdated one. If you will message me in discord i can give it to you, since i can't post it here for several reasons
Hi Orange,

Can you pm your discord ?
slaapzak
Hi Orange,

Can you pm your discord ?

Orange#0900