/// <summary> /// Invokes a PowerShell command. /// </summary> /// <param name="cmdlet">The name of the cmdlet to invoke.</param> /// <param name="parameters">An anonymous object containing the parameters for the cmdlet.</param> /// <param name="switches">A collection of switches for the cmdlet.</param> public void InvokeCommand(string cmdlet, object parameters = null, params string[] switches) { InvokeCommand(PSUtils.CreateCommand(cmdlet, parameters, switches)); }
/// <summary> /// Invokes a PowerShell command. /// </summary> /// <typeparam name="T">The type of results to return from the output stream.</typeparam> /// <param name="cmdlet">The name of the cmdlet to invoke.</param> /// <param name="parameters">An anonymous object containing the parameters for the cmdlet.</param> /// <param name="switches">A collection of switches for the cmdlet.</param> public ICollection <T> InvokeCommand <T>(string cmdlet, object parameters = null, params string[] switches) { return(InvokeCommand <T>(PSUtils.CreateCommand(cmdlet, parameters, switches))); }