I receive a set of files daily that I have to decrypt. I do this by running a PowerShell script, inputting the password and file name each time. I would like to automate this, but every time I run it, the file name gets inputted with extra data. How can I write this to only pass the file name? The two files I get end with pwd.enc and tar.enc and runs with OpenSSL:
$pwd = Get-ChildItem D:\FILES\Claims\TEST -Filter "*.pwd.enc*" |
Select-Object Name
$tar = Get-ChildItem D:\FILES\Claims\TEST -Filter "*.tar.enc*" |
Select-Object Name
$file = Get-ChildItem D:\FILES\Claims\TEST -Filter "*.tar.enc*" |
Select-Object BaseName
dec_utility.exe rsa_key_123456.pri D:\FILES\Claims\TEST\$pwd D:\FILES\Claims\TEST\$tar D:\FILES\Claims\TEST\$file