Although not a developer, I've been finding answers to problems via StackOverflow for a while now, and feel like I owe a lot of y'all a cold beer or two.
I've run into an issue that I can't seem to wrap my head around.
I would like to be able to run the following, to convert a group of jpg files to Base64 for submission to a regulatory agency that requires this format:
[Convert]::ToBase64String((Get-Content C:\temp\168211_wheels.jpg -Encoding Byte)) >> c:\temp\Pictest.txt
I will run this against a group of jpg files, all in the same directory.
My first, fairly tragic, attempt was this:
Get-ChildItem -Path ' C:\testimages\*' -Include '*.jpg' | ForEach-Object {
[Convert]::ToBase64String((Get-Content C:\testimages\*.jpg -Encoding Byte)) >> } c:\temp\Pictest.txt
I receive the following Error Message:
**At line:1 char:152
+ ... e64String((Get-Content C:\testimages\*.jpg -Encoding Byte))>>}c:\temp ...
+ ~
Missing file specification after redirection operator.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : MissingFileSpecification**
Any guidance or suggestions are very welcomed, as this is only my second attempt at working in Powershell.
Regards,
Darren