Hi,
We could try to embed Start-Transcript/Stop-Transcript in the script to create a record of PowerShell Sessions or enable PowerShell Logging.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I am trying to execute a powershell script in Orchestrator. It runs just fine in the Runbook tester but fails to execute properly when running at the runbook servers.
$timestamp = (get-date).AddDays(-1).tostring("MMddyyyyHHmm")
$file = "\\dhqdeveamsql11\EAM\alchemy.dat"
if (-not(Test-Path -Path $file -PathType Leaf)) {
$p= start-process "C:\Program Files (x86)\GnuPG\bin\gpg.exe" -ArgumentList "--output \\Server1\EAM\alchemy.dat --decrypt \\Server1\EAM\pgp\alchemy.dat.pgp" -PassThru -wait
$Exitcode = $p.ExitCode
}else
# If the file already exists, Move to archive.
{
$newfile = "\\Server1\EAM\Archive\alchemy" +$timestamp +".dat"
mv $file $newfile
$p= start-process "C:\Program Files (x86)\GnuPG\bin\gpg.exe" -ArgumentList "--output \\Server1\EAM\alchemy.dat --decrypt \\Server1\EAM\pgp\alchemy.dat.pgp" -PassThru -wait
$Exitcode = $p.ExitCode
}
When the code is run in Orchestrator, it fails to run the gpg.exe process successfully. I have confirmed that permissions to the folder and the gpg.exe file are correct. When executed as the Orch srv account, when executed locally on either runbook server, or when executed in the runbook tester, the script completes without error and performs as expected. However when run as a checked in runbook, it executes without error but does not place the decrypted file the remote share.
Hi,
We could try to embed Start-Transcript/Stop-Transcript in the script to create a record of PowerShell Sessions or enable PowerShell Logging.