We are trying to use a PowerShell script to create Dependencies in Solarwinds and getting the below errors:
We tried to use both the If logics (Snippet1 and Snippet 2), but no luck.
It seems that the CreateDependency
the verb is not available in the Orion.Container
the entity in SolarWinds.
Unfortunately, the CreateDependency
the verb is not directly available through the SolarWinds API.
Snippet 1:
if ($edgeGroup -and $networkGroup) {
# Create the group dependency
$dependencyProps = @{
ParentContainerID = $networkGroup.ContainerID
ChildContainerID = $edgeGroup.ContainerID
DependencyType = "Member"
}
$dependencyResult = Invoke-SwisVerb $swis -Entity "Orion.Container" -Verb "CreateDependency" -Parameters $dependencyProps
A line having Error:
$dependencyResult = Invoke-SwisVerb $swis -Entity "Orion.Container" -Verb "CreateDependency" -Parameters $dependencyProps
Error :
Invoke-SwisVerb : A parameter cannot be found that matches parameter name 'Parameters'.
At line:23 char:103
+ ... Entity "Orion.Container" -Verb "CreateDependency" -Parameters $depend ...
+ ~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Invoke-SwisVerb], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,SwisPowerShell.InvokeSwisVerb
Snippet 2:
if ($edgeGroup -and $networkGroup) {
# Create the group dependency
$dependencyResult = Invoke-SwisVerb -Entity "Orion.ContainerMember" -Verb "CreateDependency" -Arguments @{
ParentContainerID = $networkGroup.ContainerID
ChildContainerID = $edgeGroup.ContainerID
DependencyType = "Member"
} -SwisConnection $swis
Error:
Invoke-SwisVerb : Verb Orion.ContainerMember.CreateDependency: Not found
At line:18 char:29
+ ... ncyResult = Invoke-SwisVerb -Entity "Orion.ContainerMember" -Verb "Cr ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Invoke-SwisVerb], FaultException`1
+ FullyQualifiedErrorId : SwisError,SwisPowerShell.InvokeSwisVerb