Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Automatic Eldewrito banlist update from Google Drive doc
- # Created by Wyvern
- #
- # Downloading text file and naming it
- $download = "https://docs.google.com/document/d/11rkTBGuSxSjm5Mz_YQD3cx68KEYlDQycg0H6b3ofmAY/export?format=txt"
- $output = "$PSScriptRoot\sbl.txt"
- Invoke-WebRequest -Uri $download -OutFile $output
- # Loading text files and seeing if the list exists already.
- $sbl = Get-Content $PSScriptRoot\sbl.txt -Raw
- $banlist = Get-Content $PSScriptRoot\banlist.txt -Raw
- $containsWord = $banlist | %{$_ -match "#####"} #This will look for exactly 5 # in a row.
- if ($containsWord -contains $True) { # If the shared ban list has already been downloaded before, replace it.
- $banlist -replace "(?s)(?<=#####).*(?######)","`n$sbl`n"|Out-File $PSScriptRoot\banlist.txt
- }
- if ($containsWord -contains $false) { # If the banlist has never been appended, add it.
- Add-Content $PSScriptRoot\banlist.txt $sbl
- }
Advertisement
Add Comment
Please, Sign In to add comment