|
This is a very handy thread, thanks for making it! I just started learning Powershell a bit to automate some tasks at home. After reading the OP and some of the other examples in here I'm going to make some modifications to my script and then post it for all to laugh at. Thanks for the cool info, powershell has been lots of fun to work with.
|
# ¿ Apr 6, 2011 23:44 |
|
|
# ¿ May 2, 2024 11:03 |
|
How do I properly use command-line arguments in a function? I would like to be fancy and do some error checking and whining at the user if they fail to give me the right parameters. code:
I've thrashed at this for a bit and it just doesn't seem to work like I expect. I've tried it like in the code above, calling the $arg[0] and $arg[1] right in the function call and still it acts stupid.
|
# ¿ Apr 8, 2011 08:47 |
|
Okay, that makes sense now, thank you. I was confusing where to use the parameter list and should have put that at the head of the script since I want to manipulate *those* parameters first before we ever get to the function declaration.
|
# ¿ Apr 8, 2011 21:36 |
|
Very cool! So here we go, this is designed to work with the Windows version of Handbrake to convert video files that are on the Approved list over to iPod-ready files using the m4v file extension. Feed the script a source and destination directory and then one-by-one it will chew through your files in the source directory and convert them over using the designated Handbrake profile. The Options section of code makes it easy to point the program at your install of Handbrake and change what profile you use or to update the list of approved files. I hope this is handy for someone else because it's been a lifesaver for me. I've got tons of shows in AVI format that I want to watch on my iPod but don't want to point and click my way through each series. Now I just let my machine grind away all night on the files without me having to bother with a GUI. Extra features: - builds the destination directory if it doesn't exist. - checks for existing files and skips them so you can safely run this against a directory that you download new content into and it will only process new files. - spawns one process at a time and documents what file it's working on so that you can see what it's doing in the Powershell window. code:
|
# ¿ Apr 8, 2011 22:07 |
|
adaz posted:
Thanks for the tips!
|
# ¿ Apr 8, 2011 22:58 |
|
|
# ¿ May 2, 2024 11:03 |
|
I want to rewrite my powershell handbrake script in C# so I can slap a big dumb gui on it but look at that code up above. Just look at it. Oh powershell, you're so pretty.
|
# ¿ May 5, 2011 04:47 |