How to transfer data from an array in a script?

What they do:
Create a list of files to create variables to pass to openssl and symmetric encryption.
The script below working but it only works if hard to define the variables in and out, indicating what string should be used.
Question:
How to make the entire array in the variables was handled automatically.
$src = Get-ChildItem -r B:\backup\ -include *.xls | Where-Object {$_.LastWriteTime -ge [datetime]::Today.AddHours(-24)}
$in = Get-ChildItem $src | % { $_.fullname } 
$out = Get-ChildItem $src | % { $_.Name }
cd r:\test
$key = "l:\key\key.bin"
& 'C:\Program Files (x86)\OpenSSL\bin\openssl.exe' enc -e-aes-256-cbc-kfile $key -in $in.getvalue(0) -out $out.GetValue(0)

$in:
B:\backup\ Файл1.xls
B:\backup\ Файл2.xls
B:\backup\ Файл3.xls
B:\backup\ Файл4.xls
$out:
Файл1.xls
Файл2.xls
Файл3.xls
Файл4.xls
April 3rd 20 at 18:33
2 answers
April 3rd 20 at 18:35
Solution
I think here:
$in = Get-ChildItem $src | % { $_.fullname } 
$out = Get-ChildItem $src | % { $_.Name }

do not need get-childitem.

next. try this:

$src = Get-ChildItem -r B:\backup\ -include *.xls | Where-Object {$_.LastWriteTime -ge [datetime]::Today.AddHours(-24)}
cd r:\test
$key = "l:\key\key.bin"
foreach($item in $src){
& 'C:\Program Files (x86)\OpenSSL\bin\openssl.exe' enc -e-aes-256-cbc-kfile $key -in $item.fullname -out $item.name
}
Thank you, it worked. - Edison_Zieme commented on April 3rd 20 at 18:38
April 3rd 20 at 18:37
Thank you for the direction, partly made.
Problem:
Foreach can only process 1 ($in in $ins), you also need to change the second variable $out, but forceach does not support the pipeline...
ForEach ($ins In $in) {& 'R:\test\OpenSSL\bin\openssl.exe' enc -e-aes-256-cbc-kfile $key -in $ins -out $out}

Find more questions by tags PowerShell