摘要:
The present mechanism allows commands entered on a command line in a command line operating environment the ability to execute in a first execution mode or an alternate execution mode. The command is executed in the alternate execution mode if the command includes an instruction to execute in the alternate execution mode. The alternate execution mode is provided by the operating environment and provides extended functionality to the command. The alternate execution mode may visually display results of executing the command, visually display simulated results of executing the command, prompt for verification before executing the command, may perform a security check to determine whether a user requesting the execution has sufficient privileges to execute the command, and the like.
摘要:
The present invention is directed at a reflection-based shell that provides reflection-based processing of input parameters for a command. The reflection-based processing includes parsing, data generation, data validation, object encoding, object processing, documentation, and the like. The reflection-based shell provides a mechanism for specifying a grammar for the input parameters using a class. The method includes receiving a parsable stream that includes a command and at least one parameter. Retrieving definitional information that describes an expected parameter for the command. Using the definitional information to create an object for storing the at least one parameter in a format in accordance with the description of the expected parameters. Passing the object to the command.
摘要:
The present comparison technique operates on objects having the same type, similar types, or different types. Multiple comparison objects may be compared against one or more reference objects. The comparison objects may be obtained from a prior cmdlet in a pipeline of cmdlets operating in an object-based environment. The reference object and comparison object may be compared in an order-based manner or in a key-based manner. In addition, specific properties may be specified which will identify which properties of the reference object and the comparison object to compare during the comparison. The comparison may generate an output that identifies the difference and/or similarities. The output may be pipelined to another cmdlet for further processing.
摘要:
The Techniques and Mechanisms Described Herein are Directed to an Extensible security architecture that provides a security mechanism for minimizing security problems within interpretive environments. The extensible security architecture comprises a script engine configured to process a script and a security manager configured to monitor the processing of the script based on a security policy. The security manager determines whether to open an assembly associated with a command within the script, whether to process the command, whether to allow certain input to the command, and the like. The security policy may be implemented by overriding one or more methods of a base security class that are called when processing the script. The input may be an object passed via an object-based pipeline.
摘要:
In an administrative tool environment, user input is supplied to an administrative tool framework for processing. The administrative tool framework maps user input to cmdlet objects. The cmdlet objects describe a grammar for parsing the user input and input objects to obtain expected input parameters. The input objects are emitted by one cmdlet and are available as input to another cmdlet. The input objects may be any precisely parseable input, such as .NET objects, plain strings, XML documents, and the like. The input objects are not live objects. The cmdlets may operate within the same process. Alternatively, one cmdlet may operate locally while another cmdlet operates remotely. The cmdlets may be provided by the administrative tool framework or may be provided by third party developers. The user input may be supplied to the framework via a host cmdlet.
摘要:
The techniques and mechanisms described herein are directed to a scripting security mechanism that minimizes security risks associated with interpreting a script written with a scripting language. An interpreter recognizes the scripting-language syntax within the script and processes each line that is designated within a data block using a restrictive set of operations. The restrictive set of operations are a subset of the total operations available for processing. If one of the lines within the data block attempts to perform an operation that is not within the restrictive set of operations, the interpreter provides an indication, such as an exception or message explaining the illegal operation. The interpreter also recognizes a list of export variables associated with the data block and exports only the variables identified in the list to an external environment if the export variable meets a constraint identified for it, if any.
摘要:
The techniques and mechanisms described herein are directed at converting text into objects based on a template that describes the format of the text. The objects then being available for further processing. The conversion mechanism converts the text into an object having at least one method that is directly invocable and that is specific to a data type specified for the live object. The template comprises an object header indicator and a corresponding object header pattern. A new object is created whenever the object header pattern is identified within the text. In addition, the template comprises one or more field indicators each having a corresponding field pattern. The field pattern is in a format of a regular expression. A new field is created for the new object whenever a field pattern is identified within the text.
摘要:
The present mechanism provides a grammar for specifying required prerequisites (e.g., number and type of input parameters) that an object must possess in order for processing to occur on the object. The mechanism allows programmers and non-programmers to easily specify these prerequisites. The prerequisites may be associated directly or indirectly with a data structure. For a direct specification, the data structure comprises a parameter declaration for each expected input parameter. For an indirect specification, the data structure comprises a parameter definition that references an external description, such as in an XML document. The data structure also providing a mechanism that identifies a corresponding parameter within an input source for each expected input parameter based on its declaration. The mechanism further populates each expected input parameter with information associated with the corresponding parameter when the data structure becomes instantiated into an object. The mechanism may be provided by a runtime environment.
摘要:
The techniques and mechanisms described herein are directed to a taint mechanism. An object-based command declares a taint directive for a parameter within a command declaration. The taint directive is then associated with that parameter in a manner such that when an engine processes the command, the engine determines whether to process the command based on the taint directive and input for the parameter. The taint directive may specify that the input may be tainted or untainted. The command declaration may also include a taint parameter that specifies a taint characteristic for output from the command. The taint characteristic may be tainted, untainted, or propagated. Any type of object may become tainted. An untaint process may be applied to tainted data to obtain untainted data if an authorization check performed by the engine is successful.
摘要:
The present mechanism obtains constraints within an interactive environment, associates these constraints with constructs, and then applies these constraints to the constructs when encountering the constructs. The constraints may be saved in metadata associated with the respective construct. The constraints may specify a data type for the construct, a predicate directive, a documentation directive, a parsing directive, a data generation directive, a data validation directive, or an object processing and encoding directive. The constraints are extendable to support other directives. The mechanism allows interactive users to easily specify constraints interactively.