Unknown failure in task - script runs successfully outside of task

I am having a task failure and cannot figure out why. Posting the section of Action Script here, hopeful for some assistance. If I run the powershell script referenced by “encryptionScriptSingleArgFile” it runs successfully on its own and creates the referenced file “fileWithEncryptedHash”. However in the task it fails on the verification, because the file is not getting created. Any ideas? Please let me know if additional info is needed. Thank you!

Completed parameter "fileWithEncryptedHash" = "C:\App\JumpMind\work\fullyEncryptedJasypt.txt" 
Completed // # DELETE THE OLDER FILE WITH THE ENCRYPTED PASSWORD 
Completed if {exists file (parameter "fileWithEncryptedHash")} 
Completed delete {parameter "fileWithEncryptedHash"} 
Completed endif 
Completed // # RUN THE POWERSHELL TO REGENERATE THE FILE WITH THE FRESHLY ENCRYPTED PASSWORD 
Completed parameter "keyToUseForDecryption" = "xxxxxxxxx" 
Completed // # This is to add for Private Key 
Completed waithidden powershell.exe -noninteractive -nologo -command . {parameter "encryptionScriptSingleArgFile"} "{parameter "synchPriKeyPlainTextFile"}" "{parameter "keyToUseForDecryption"}" 
Completed dos timeout /T 2 
Failed continue if {exists file (parameter "fileWithEncryptedHash")} 

Could be a few things.
In your PowerShell script, is it hard-coded where the file output should go? Is the script hardcoded with ‘C:\App\JumpMind\work\fullyEncryptedJasypt.txt’ because I don’t see that as a command-line argument; is it possible the script works when you do it manually, only because you start in the right working directory?

Oh! There’s also “the usual” - if you don’t add
action uses wow64 redirection false
to your script, anywhere before the ‘waithidden’ command, by default it would run the 32-bit version of PowerShell and you may lack some crypto module in 32-bit mode.

Yes. It is hardcoded in the script.

Oh! Let me try that and see how it goes. Thanks for the tip. I’ll have results shortly.

Still the same result, exit code 1. Same failure. However I am following a different trail of breadcrumbs now, I may smell a permissions issue. I’ll keep you posted!