Generate MOD ID list from Steam Mod Collection URL

This script enables you to generate a simple list of all MOD IDs contained in a Mod Collection for use in Server Managers for Steam Games.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#=========================================================================
# Generate MOD ID List from a Steam Mod Collection URL
# Created by Archi
# Last modified 2018-04-04
# Version 1.1
#=========================================================================
cls
#Set URL of your Mod Collection for your server
#SE archicraft v2
$WorkshopCollectionURL = 'http://steamcommunity.com/sharedfiles/filedetails/?id=1157100543'
#Set Output Path and Filename of file which will contain MOD ID list
#Note: List will also display on screen
$modList = 'c:\Users\Public\mods.txt'
#==============================================================================================
#End configurable options
#==============================================================================================
$getPage = Invoke-WebRequest –Uri $WorkshopCollectionURL
$modIDCollection = @()
$links = $getPage.Links
foreach ($link in $links){
    if ($link.innerHTML -like "*workshopItemTitle*" ){
        $modID = $link.href.Replace('http://steamcommunity.com/sharedfiles/filedetails/?id=','')
        if($modIDCollection -notcontains $modID){
            $desc = $link.innerText
            Write-Host "Found Mod: $desc"
            $modIDCollection += $modID
        }
    }
}
if (Test-Path $modList) {del $modList}
Set-Content -Path $modList $modIDCollection
Write-Host "Your mod list is at: $modList"
$modIDCollection
start $modList

Leave a Reply

Your email address will not be published. Required fields are marked *