How to execute a command sd_acmd addinstallrecord in a powershell script ?
Client Automation - All Versions
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.