/// <summary> /// This method constructs a string representing the end block of the command /// specified by <paramref name="commandMetadata"/>. The returned string only contains the /// script, it is not enclosed in "end { }". /// </summary> /// <param name="commandMetadata"> /// An instance of CommandMetadata representing a command. /// </param> /// <returns> /// A string representing the end block of the command. /// </returns> /// <exception cref="ArgumentNullException"> /// commandMetadata is null. /// </exception> public static string GetEnd(CommandMetadata commandMetadata) { if (commandMetadata == null) { throw PSTraceSource.NewArgumentNullException("commandMetaData"); } return(commandMetadata.GetEndBlock()); }