public static bool LocalUserExists(string userName)
{
if ((object)userName == null)
throw new ArgumentNullException(nameof(userName));
// Remove any irrelevant white space
userName = userName.Trim();
if (userName.Length == 0)
throw new ArgumentException("No user name was specified.", nameof(userName));
if (Common.IsPosixEnvironment)
return UnixUserInfo.LocalUserExists(userName);
return WindowsUserInfo.LocalUserExists(userName);
}