System.Management.Automation.SessionStateUnauthorizedAccessException.CreateVariableCannotBeMadeConstantError C# (CSharp) Method

CreateVariableCannotBeMadeConstantError() static private method

static private CreateVariableCannotBeMadeConstantError ( PSVariable variable ) : Exception
variable PSVariable
return System.Exception
        internal static Exception CreateVariableCannotBeMadeConstantError(PSVariable variable)
        {
            string message = String.Format("Existing variable {0} cannot be made constant. Variables can be made constant only at creation time.", variable.Name);
            return CreateError(variable, message, "VariableCannotBeMadeConstant");
        }