Repository: PowerShell/PowerShell
File: src/System.Management.Automation/singleshell/config/MshSnapinInfo.cs (C#)

Code before:

        internal PSSnapInInfo Clone()
        {
            PSSnapInInfo cloned = new PSSnapInInfo(
                Name,
                IsDefault,
                ApplicationBase,
                AssemblyName,
                ModuleName,
                PSVersion,
                Version,
                new Collection<string>(Types),
                new Collection<string>(Formats),
                _description,
                _descriptionFallback,
                _descriptionIndirect,
                 _vendor,
                 _vendorFallback,
                 _vendorIndirect);

            return cloned;
        }

        /// <summary>
        /// Returns true if the PSSnapIn Id is valid. A PSSnapIn is valid
        /// if-and-only-if it contains only /// "Alpha Numeric","-","_","."
        /// characters.
        /// </summary>
        /// <param name="psSnapinId">PSSnapIn Id to validate.</param>
        internal static bool IsPSSnapinIdValid(string psSnapinId)
        {
            if (string.IsNullOrEmpty(psSnapinId))
            {
                return false;
            }

            return Regex.IsMatch(psSnapinId, "^[A-Za-z0-9-_\x2E]*$");
        }

        /// <summary>
        /// Validates the PSSnapIn Id. A PSSnapIn is valid if-and-only-if it
        /// contains only "Alpha Numeric","-","_","." characters.
        /// </summary>
        /// <param name="psSnapinId">PSSnapIn Id to validate.</param>
        /// <exception cref="PSArgumentException">
        /// 1. Specified PSSnapIn is not valid
        /// </exception>
        internal static void VerifyPSSnapInFormatThrowIfError(string psSnapinId)
        {
            // PSSnapIn do not conform to the naming convention..so throw
            // argument exception

Review comment (suggestion):
```suggestion
        /// if-and-only-if it contains only "Alpha Numeric","-","_","."
```

Code after:

        internal PSSnapInInfo Clone()
        {
            PSSnapInInfo cloned = new PSSnapInInfo(
                Name,
                IsDefault,
                ApplicationBase,
                AssemblyName,
                ModuleName,
                PSVersion,
                Version,
                new Collection<string>(Types),
                new Collection<string>(Formats),
                _description,
                _descriptionFallback,
                _descriptionIndirect,
                 _vendor,
                 _vendorFallback,
                 _vendorIndirect);

            return cloned;
        }

        /// <summary>
        /// Returns true if the PSSnapIn Id is valid. A PSSnapIn is valid
        /// if-and-only-if it contains only "Alpha Numeric","-","_","."
        /// characters.
        /// </summary>
        /// <param name="psSnapinId">PSSnapIn Id to validate.</param>
        internal static bool IsPSSnapinIdValid(string psSnapinId)
        {
            if (string.IsNullOrEmpty(psSnapinId))
            {
                return false;
            }

            return Regex.IsMatch(psSnapinId, "^[A-Za-z0-9-_\x2E]*$");
        }

        /// <summary>
        /// Validates the PSSnapIn Id. A PSSnapIn is valid if-and-only-if it
        /// contains only "Alpha Numeric","-","_","." characters.
        /// </summary>
        /// <param name="psSnapinId">PSSnapIn Id to validate.</param>
        /// <exception cref="PSArgumentException">
        /// 1. Specified PSSnapIn is not valid
        /// </exception>
        internal static void VerifyPSSnapInFormatThrowIfError(string psSnapinId)
        {
            // PSSnapIn do not conform to the naming convention..so throw
            // argument exception