A program has multiple facets / sub-programs but it has no system to integrate those together; so it’s up to the user to make multiple commands when desiring to do a task with more than 1 sub-program. I could create files then delete them, but I’m wondering if there’s a way to create a script which those separate task could be put into a temporary file and link those sub-programs through those temporary files. For example:
create temporary file T1, T2;
[1st command] $T1;
echo "1st command size: ", filesize ($T1);
[2nd command part 1] $T2 [2nd command part 2];
echo "2nd command size: ", filesize ($T2);
[3rd command part 1] $T1 [3rd command part 2] $T2 [3rd command part 3] output.ext;
In the above the only regular file created is output.ext.
Do you see the blockquote in the OP? I never created a powershell script before, I need to figure out how to do commands, as in Windows command prompt, with it before I can use the temporary file.
I think I’ll be able to using Batch convert videos using ffmpeg and powershell · GitHub as an example. However, I I run “ffmpeg --version” in a command prompt it will give me an earlier version than I recently downloaded. How can I set the path of ffmpeg in the example? Something like ffmpeg.setpath([path]).
This is a PowerShell forum. I don’t know nothing about ffmpeg. But from a scripting point of view I’d recommend to use the full path instead if you want to use a particular version.
You must provide a value expression following the ‘-f’ operator.
At PATH_BEGINNING\Documents\African_senegal_parrot_talking-Alex_African_Grey_Parrot_talking_to_a_Persian_cat.p
s1:7 char:20
1
When you post code, sample data, console output or error messages please format it as code using the preformatted text button ( </> ). Simply place your cursor on an empty line, click the button and paste your code.
2
Learn the basics of PowerShell. That includes how to read and understand error messages!
3
As you can read in the error message -f is a PowerShell operator. When you run an external tool using the same name as a command line argument you have to tell PowerShell not to parse it as PowerShell operator. You could use the stop parsing operator (--%). But you have to make sure you place it after all other things you want PowerShell to parse.
I don’t know if that works but you could try this:
Please always read the help for the cmdlets you’re about to use completely including the examples.
At the moment you actually not using any PowerShell functionality. If it’s easier for you you may keep using batch/cmd files instead of PowerShell scripts.
WHAT TEXT FILE??? Are you talking about a script? A text file cannot run nothing because it’s just text.