我正在尝试在 PowerShell 脚本中执行以下命令
C:\PATH TO GPG\gpg.exe --output OUTPUTFILE.csv --batch --passphrase-fd 0 --decrypt C:\PATH TO INPUT\INPUTFILE.txt < C:\PATH TO PASS\Passphrase.txt
当我将命令的各个部分分配给变量然后将它们组合在命令变量中并尝试按如下方式执行它时:
$decryptCommand = "${gpg} --output ${dateStamp}.csv --batch --passphrase-fd 0 --decrypt ${fileName} < ${passphraseFile}"
&$decryptCommand
我收到以下错误:
The term 'XXXX' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
我试图用单引号和双引号将命令的各个部分括起来,但我尝试过的任何方法似乎都不起作用。
我应该做些什么来从 PowerShell 脚本执行这个命令吗?