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

CreateVariableNotRemovableError() static private method

static private CreateVariableNotRemovableError ( PSVariable variable ) : SessionStateUnauthorizedAccessException
variable PSVariable
return SessionStateUnauthorizedAccessException
        internal static SessionStateUnauthorizedAccessException CreateVariableNotRemovableError(PSVariable variable)
        {
            string message = String.Format("Cannot remove variable {0} because it is constant or read-only. If the variable is read-only, try the operation again specifying the Force option.", variable.Name);
            return CreateError(variable, message, "VariableNotRemovable");
        }