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

            return(commandMetadata.GetDynamicParamBlock());
        }