Closed paul-alt-delete closed 4 years ago
@paul-alt-delete Hello Paul,
Thank you for trying to make MicrosoftDocs a better place.
This is very confusing indeed. I think it is some kind of a glitch in cmdlet behaviour. I did some tests as well and the logical thing is:
This example could explain it:
Get-ClusterResource TestService | Add-ClusterResourceDependency -Resource TestIP2 -Provider TestIP
Here the Resource parameter is ignored and only the resource specified in the Provider parameter is added as dependency.
I will fix the example and escalate the other part as bug.
The current example for Add-ClusterResourceDependency is incorrect:
The generic
-Cluster
parameter indicates what cluster to connect to, not the resource to add the new dependency to.When I checked the parameter descriptions to find the correct usage, I found that some parameters seem mutually exclusive (like
-InputObject
and-Resource
). But this isn't called out, and the command doesn't use parameter sets to enforce that. I tried testing different parameter combinations on a 2012 R2 test cluster, and found three valid combinations. So ideally, the documentation should be updated to show those three usage options:Example 2 and 3 show how the -Resource parameter can mean different things depending on how the command is run. Based on context,
-Resource
can mean opposite things, eitherI found that surprising and unintuitive, and I'd suspect that others will be confused by it as well. I haven't seen any other PowerShell commands from Microsoft with behavior like that, so it's probably worth explicitly calling out. I'm assuming that the behavior is unintentional, but is kept for backwards compatibility.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.