I have a script to update the component name, credentials, commandLine properties of a Linux Script monitor. However, I need to update the script body as well.
The script body is similar for all components. Unfortunately, it seems I can't copy the value from another component using the same scriptbody number.
Here's an example:
$Scriptproperties = @{
ScriptBody = '12725'
}
Set-SwisObject -SwisConnection $SwisConnection -Uri $ScriptUri[$i] -Properties $Scriptproperties
Updating the component name and command line works just fine.
$Nameproperties = @{
Name = $processlist[$count0]
}
Set-SwisObject -SwisConnection $SwisConnection -Uri $NameUri[$i] -Properties $Nameproperties
$CommandLineproperties = @{
Value = 'bash ${SCRIPT} ' + $processlist[$count0];
}
Set-SwisObject -SwisConnection $SwisConnection -Uri $CommandLineUri[$i] -Properties $CommandLineproperties