set-ClusterResourceDependency and multiple dependencies

Welcome Forums General PowerShell Q&A set-ClusterResourceDependency and multiple dependencies

This topic contains 1 reply, has 2 voices, and was last updated by

6 years ago.

  • Author
  • #9001

    Topics: 1
    Replies: 0
    Points: 0
    Rank: Member

    I have a script that creates a powershell command. The below command is not working correctly. I cannot find much if any documentation on how to set multiple dependencies in powershell. All of my other dependencies set without a problem, just this one with multiples.

    Set-ClusterResourceDependency -cluster cluster_name -resource "SQL Server (SQL_GROUP)" -Dependency "[E_Drive] and [E_Drive_log01]"
    Set-ClusterResourceDependency : An error occurred while setting the dependency relationship for the resource 'SQL Serve
    r (SQL_GROUP)'.
    The parameter is incorrect
    At line:1 char:30
    + Set-ClusterResourceDependency <<<< -cluster cluster_name -resource "SQL Server (SQL_GROUP)" -Dependency "[E_Drive] and [E_Drive_log01]" + CategoryInfo : NotSpecified: (:) [Set-ClusterResourceDependency], ClusterCmdletException + FullyQualifiedErrorId : Set-ClusterResourceDependency,Microsoft.FailoverClusters.PowerShell.SetClusterResourceDependencyCommand

  • #9089

    Topics: 13
    Replies: 4872
    Points: 1,843
    Helping HandTeam Member
    Rank: Community Hero

    Well, since -Dependency only takes a single string, and since what you're doing isn't working, what about running the command twice and setting one dependency each time? I haven't used the clustering commands much myself. The documentation states that you can use "or" when you don't want a dependency on BOTH items – which implies that the default IS to be dependent on both items.

    The docs suggest you CAN use an AND operator, but they sorta enclose it in square brackets-ish. See, although it looks typo-ish to me.

    But you can DEFINITELY use SET to create the first dependency, and then use the Add- cmdlets to AND on another one. Try that?

The topic ‘set-ClusterResourceDependency and multiple dependencies’ is closed to new replies.