Created
November 7, 2023 23:35
-
-
Save bitsycore/8ec105ebd81bb0cfcf4b98486c854e82 to your computer and use it in GitHub Desktop.
use BLPConverter.exe from https://github.com/PatrickCyr/BLPConverter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param ( | |
[string]$folderPath, | |
[string]$destinationPath = $folderPath, | |
[string]$BLPConverter = "BLPConverter.exe" | |
) | |
# Check if folderPath is provided | |
if ([string]::IsNullOrEmpty($folderPath)) { | |
Write-Error "Error: folderPath must be provided." | |
Write-Host "Usage: script.ps1 -folderPath <FolderPath> [-destinationPath <DestinationPath>] [-BLPConverter <ConverterPath>]" | |
exit 1 | |
} | |
# Check if BLPConverter exists | |
if (-not (Test-Path -Path $BLPConverter)) { | |
Write-Error "Error: BLPConverter not found at the specified path: $BLPConverter" | |
exit 1 | |
} | |
$blpFiles = Get-ChildItem -Path $folderPath -Filter *.blp | |
foreach ($blpFile in $blpFiles) { | |
$blpFilePath = $blpFile.FullName | |
$destinationFileName = [System.IO.Path]::ChangeExtension($blpFile.Name, "png") | |
$destinationFilePath = Join-Path -Path $destinationPath -ChildPath $destinationFileName | |
& $BLPConverter $blpFilePath $destinationFilePath | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment