kerbo_

fs22mods.ps1

May 14th, 2022 (edited)
352
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $SaveGameFolder = [Environment]::GetFolderPath("MyDocuments") + "\My Games\FarmingSimulator2022"
  2.  
  3. If ($($args[0]) -gt 0) {
  4.     $SaveGameNumber = $($args[0])
  5.     $xmlFile = $SaveGameFolder + "\savegame" + $SaveGameNumber + "\careerSavegame.xml"
  6.     [xml]$doc = Get-Content $xmlFile
  7.     $doc.careerSavegame.mod | Sort-Object -Property modName | % { $_.modName + " | " + $_.title }
  8. } else {
  9.     echo "Found these save games in $SaveGameFolder :"
  10.  
  11.     Get-ChildItem $SaveGameFolder -Filter savegame? |
  12.     Foreach-Object {
  13.         echo $_.BaseName
  14.     }
  15.  
  16.     echo "Call script with a savegame number to view mods"
  17.     echo "Example: ./fs17mods.ps1 1"
  18. }
Add Comment
Please, Sign In to add comment