Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #
- # Edit this variable:
- $starfieldPath = "D:\Games\steamapps\common\Starfield"
- # You shouldn't need to edit this
- $pluginsTxtPath = "~/AppData/Local/Starfield/Plugins.txt"
- #
- # Don't edit anything below this line
- #
- $starfieldPathData = "$starfieldPath\Data"
- # Check if $starfieldPath exists
- if (-not (Test-Path $starfieldPathData)) {
- Write-Host "Error: Cannot find 'Data' folder at '$starfieldPathData'!"
- Write-Host "Press any key to continue"
- [Console]::ReadKey() | Out-Null
- exit
- }
- # Check if $pluginsTxtPath exists, if not create it
- if (-not (Test-Path $pluginsTxtPath)) {
- Write-Host "Creating $pluginsTxtPath"
- New-Item -Path $pluginsTxtPath -ItemType File -Force | Out-Null
- }
- Write-Host "`n== Plugins.txt old contents =="
- Get-Content $pluginsTxtPath
- Write-Host "==============================`n"
- # Get all .esp and .esm files in the Data folder
- $plugins = Get-ChildItem $starfieldPathData -Include *.esp, *.esm -Exclude "Starfield.esm" -Recurse -File | ForEach-Object { $_.Name }
- $firstLine = "# This file is used by Starfield to keep track of your downloaded content. (You HAVE to keep a # on the first line here)"
- # Write $firstLine to $pluginsTxtPath,
- # then append each $plugin to $pluginsTxtPath, formatted as "*$plugin"
- $firstLine | Out-File $pluginsTxtPath
- $plugins | ForEach-Object { "*$_" | Out-File $pluginsTxtPath -Append }
- Write-Host "== Plugins.txt new contents =="
- Get-Content $pluginsTxtPath
- Write-Host "==============================`n"
- Write-Host "Plugins.txt updated"
- Write-Host "Press any key to continue"
- [Console]::ReadKey() | Out-Null
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement