title: Executing cmdlet Get-ClusterGroup from C#
body: <p>Hi I'm trying to execute the Get-ClusterGroup cmdlet from C# 4.0. I've used the following code</p>
  
  <pre><code>InitialSessionState iss = InitialSessionState.CreateDefault();
  iss.ImportPSModule(new string[] { "failoverclusters"});
  
  Runspace myRunSpace = RunspaceFactory.CreateRunspace(iss);
  myRunSpace.Open();
  
  Pipeline pipeLine = myRunSpace.CreatePipeline();
  
  Command myCommand = new Command("Get-ClusterGroup");
  pipeLine.Commands.Add(myCommand);
  
  Console.WriteLine("Invoking Command");
  Collection commandResult = pipeLine.Invoke();
  
  foreach (PSObject resultObject in commandResult)
  {
  Console.WriteLine(resultObject.ToString());
  }
  myRunSpace.Close();
  </code></pre>
  
  <p>But getting the following error</p>
  
  <p>The term 'Get-ClusterGroup' is not recognized as the name of a cmdlet, function,
  script file, or operable program. Check the spelling of the name, or if a path
  was included, verify that the path is correct and try again.</p>
  
  <p>It will be great if someone can show me the where I'm missing the logic or where is the problem in my code</p>