Execute sd_acmd.exe in a powershell script
search cancel

Execute sd_acmd.exe in a powershell script

book

Article ID: 368824

calendar_today

Updated On:

Products

CA Client Automation - IT Client Manager CA Client Automation

Issue/Introduction

How to execute a command sd_acmd addinstallrecord in a powershell script ?

Environment

Client Automation - All Versions

Resolution

Here is an example of powershell script to execute command :
sd_acmd.exe addinstallrecord "Test_Package" "1.0" "Install" current current "ca://usd/distributor" "Added using sd_acmd"

$InstallDir=(Get-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\ComputerAssociates\Unicenter ITRM" -Name "InstallDirProduct").InstallDirProduct
if ($InstallDir -notmatch "\\$")
{
   $InstallDir += "\"
}
$InstallDir +="bin"
$sd_acmd =$InstallDir+"\sd_acmd.exe"

$process=Start-Process -WindowStyle hidden -FilePath $sd_acmd -wait -PassThru -ArgumentList "addinstallrecord `"Test_Package`" `"1.0`" `"Install`" current current `"ca://usd/distributor`" `"Added using sd_acmd`""

 

$process.ExitCode contains the exit code of the command.