PGP输出到日志文件

问题描述

好吧,我一直被困在创建的PowerShell脚本中,该脚本使用PGP加密自动加密/解密文件。我测试了每行代码都可以运行,但是不能单独运行,所以我试图查看如何将gpg输出到日志文件,以期确定问题所在。

我尝试了--log-file,-logger-fd,但是什么也没有...

    $DestPath = "\\some UNC path"
$files = Get-ChildItem $DestPath -File
ForEach($file in $files)
{
    try
    {
        $outfile = $file.BaseName
        Write-Output "PGP Procesing: Input=$DestPath\$file,Output=$DestPath\$outfile"
        start-process -wait -FilePath "C:\Program Files (x86)\GnuPG\bin\gpg.exe" -WorkingDirectory "$DestPath" -ArgumentList "--pinentry-mode=loopback --passphrase "some pwd" --logger-fd "C:\Logs\GPG.txt" -o $DestPath\$outfile $DestPath\$file"

    }
    catch
    {
        Write-Output "Error during PGP decryption of: $file"
    }
}

任何帮助将不胜感激!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)