2022-11-13 16:28:08 +00:00
|
|
|
# This powershell script will create a text file for each files in the folder
|
|
|
|
#
|
|
|
|
# Usefull to create base caption that will be augmented on a per image basis
|
|
|
|
|
2022-11-19 13:49:42 +00:00
|
|
|
$folder = "D:\some\folder\location\"
|
2022-11-13 16:28:08 +00:00
|
|
|
$file_pattern="*.*"
|
2022-11-19 13:49:42 +00:00
|
|
|
$caption_text="some caption text"
|
2022-11-13 16:28:08 +00:00
|
|
|
|
2022-11-19 13:49:42 +00:00
|
|
|
$files = Get-ChildItem $folder$file_pattern -Include *.png,*.jpg,*.webp -File
|
|
|
|
foreach ($file in $files)
|
|
|
|
{
|
|
|
|
New-Item -ItemType file -Path $folder -Name "$($file.BaseName).txt" -Value $caption_text
|
|
|
|
}
|