I have the device ID of my drives captured into a text file and I am able to read each ID and pass into a command as a variable, but not able to pass it as $variable.bin file. I have a software, which needs certain inputs to generate the log.
Let me give an example:
Text File content: (random serial numbers)
abc123124324, abc234543543, abc354354354, . .
I want to pass the above serial numbers into a command, so I used the following loop:
foreach ($line in Get-Content $filePath ) {
Write-Host "Generating info for $line"
C:\Users\Administrator\Desktop\software.exe -K -o sup -f **${line}.bin** -n $line
}
=== I need to pass each serial number as serialnumber.bin, but its giving an error as its not able to add .bin
Note: For another command (which does not require the use of .bin) the below code works fine:
C:\Users\Administrator\Desktop\software.exe -K ${line}_log.zip -n $line
Not sure how to add a .bin extension. Please help!!