System.Management.Automation Exposes the Children noun of the Cmdlet Providers to the Cmdlet base class. The methods of this class use the providers to perform operations. Hide the default constructor since we always require an instance of SessionState Constructs a facade over the "real" session state API An instance of the cmdlet that this class is acting as a facade for. Constructs a facade over the "real" session state API An instance of the "real" session state. If is null. Gets the child items of the container at the given path. The path to the item to retrieve. It may be a drive or provider-qualified path and may include glob characters. If true, gets all the children in all the sub-containers of the specified container. If false, only gets the immediate children of the specified container. The children of the container at the specified path. The type of the objects returned are determined by the provider that supports the given path. If or is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the child items of the container at the given path(s). The path(s) to the item(s) to retrieve. They may be drive or provider-qualified paths and may include glob characters. If true, gets all the children in all the sub-containers of the specified container. If false, only gets the immediate children of the specified container. Passed on to providers to force operations. If true, globbing is not done on paths. The children of the container at the specified path. The type of the objects returned are determined by the provider that supports the given path. If or is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the child items of the container at the given path. The path to the item to retrieve. It may be a drive or provider-qualified path and may include glob characters. If true, gets all the children in all the sub-containers of the specified container. If false, only gets the immediate children of the specified container. The context under which the command is running. Nothing. The children of the container at the specified path are written to the context. If or is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the dynamic parameters for the get-childitem cmdlet. The path to the item if it was specified on the command line. If true, gets all the children in all the sub-containers of the specified container. If false, only gets the immediate children of the specified container. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the child names of the container at the given path. The path to the item to retrieve. It may be a drive or provider-qualified path and may include glob characters. Determines if all containers should be returned or only those containers that match the filter(s). If true, gets all the relative paths of all the children in all the sub-containers of the specified container. If false, only gets the immediate child names of the specified container. The children of the container at the specified path. The type of the objects returned are determined by the provider that supports the given path. If or is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the child names of the container at the given path. The path(s) to the item(s) to retrieve. They may be drive or provider-qualified paths and may include glob characters. Determines if all containers should be returned or only those containers that match the filter(s). If true, gets all the relative paths of all the children in all the sub-containers of the specified container. If false, only gets the immediate child names of the specified container. Passed on to providers to force operations. If true, globbing is not done on paths. The children of the container at the specified path. The type of the objects returned are determined by the provider that supports the given path. If or is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the child names of the container at the given path. The path to the item to retrieve. It may be a drive or provider-qualified path and may include glob characters. Determines if all containers should be returned or only those containers that match the filter(s). If true, gets all the relative paths of all the children in all the sub-containers of the specified container. If false, only gets the immediate child names of the specified container. The context under which the command is running. Nothing. The names of the children of the specified container are written to the context. If or is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the dynamic parameters for the get-childitem -name cmdlet. The path to the item if it was specified on the command line. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Determines if an item at the given path has children. The path to the item to determine if it has children. It may be a drive or provider-qualified path and may include glob characters. True if the item at the specified path has children. False otherwise. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Determines if an item at the given path has children. The path to the item to determine if it has children. It may be a drive or provider-qualified path and may include glob characters. Passed on to providers to force operations. If true, globbing is not done on paths. True if the item at the specified path has children. False otherwise. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Determines if an item at the given path has children. The path to the item to determine if it has children. It may be a drive or provider-qualified path and may include glob characters. The context under which the command is running. True if the item at the specified path has children. False otherwise. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. This enum determines which types of containers are returned from some of the provider methods. Only containers that match the filter(s) are returned. All containers are returned even if they don't match the filter(s). Exposes the Cmdlet Family Providers to the Cmdlet base class. The methods of this class use the providers to perform operations. Hide the default constructor since we always require an instance of SessionState Constructs a facade over the "real" session state API An instance of the cmdlet. If is null. Constructs a facade over the "real" session state API An instance of the cmdlet. Gets the object that exposes the verbs for the item noun for Cmdlet Providers Gets the object that exposes the verbs for the childItem noun for Cmdlet Providers Gets the object that exposes the verbs for the content noun for Cmdlet Providers Gets the object that exposes the verbs for the property noun for Cmdlet Providers Gets the object that exposes the verbs for the SecurityDescriptor noun for Cmdlet Providers An interface that a or must implement to indicate that it has dynamic parameters. Dynamic parameters allow a or to define additional parameters based on the value of the formal arguments. For example, the parameters of "set-itemproperty" for the file system provider vary depending on whether the target object is a file or directory. Returns an instance of an object that defines the dynamic parameters for this or . This method should return an object that has properties and fields decorated with parameter attributes similar to a or . These attributes include , , argument transformation and validation attributes, etc. Alternately, it can return a instead. The or should hold on to a reference to the object which it returns from this method, since the argument values for the dynamic parameters specified by that object will be set in that object. This method will be called after all formal (command-line) parameters are set, but before is called and before any incoming pipeline objects are read. Therefore, parameters which allow input from the pipeline may not be set at the time this method is called, even if the parameters are mandatory. Type used to define a parameter on a cmdlet script of function that can only be used as a switch. Implicit cast operator for casting SwitchParameter to bool. The SwitchParameter object to convert to bool The corresponding boolean value. Implicit cast operator for casting bool to SwitchParameter. The bool to convert to SwitchParameter The corresponding boolean value. Explicit method to convert a SwitchParameter to a boolean value. The boolean equivalent of the SwitchParameter Construct a SwitchParameter instance with a particular value. If true, it indicates that the switch is present, flase otherwise. Compare this switch parameter to another object. An object to compare against True if the objects are the same value. Returns the hash code for this switch parameter. The hash code for this cobject. Implement the == operator for switch parameters objects. first object to compare second object to compare True if they are the same Implement the != operator for switch parameters first object to compare second object to compare True if they are different Implement the == operator for switch parameters and booleans. first object to compare second object to compare True if they are the same Implement the != operator for switch parameters and booleans. first object to compare second object to compare True if they are different Implement the == operator for bool and switch parameters first object to compare second object to compare True if they are the same Implement the != operator for bool and switch parameters first object to compare second object to compare True if they are different Returns the string representation for this object The string for this object. Returns true if the parameter was specified on the command line, false otherwise. True if the parameter was specified, false otherwise Static method that returns a instance of SwitchParameter that indicates that it is present. An instance of a switch parameter that will convert to true in a boolean context Interfaces that cmdlets can use to build script blocks and execute scripts. Returns a string with all of the variable and expression substitutions done. The string to expand. The expanded string. Thrown if a parse exception occurred during subexpression substitution. Returns the CmdletInfo object that corresponds to the name argument The name of the cmdlet to look for The cmdletInfo object if found, null otherwise Returns the CmdletInfo object that corresponds to the name argument The name of the cmdlet to look for The execution context instance to use for lookup The cmdletInfo object if found, null otherwise Get the cmdlet info using the name of the cmdlet's implementing type. This bypasses session state and retrieves the command directly. Note that the help file and snapin/module info will both be null on returned object. the type name of the class implementing this cmdlet CmdletInfo for the cmdlet if found, null otherwise Returns a list of all cmdlets... Returns all cmdlets whose names match the pattern... A list of CmdletInfo objects... Searches for PowerShell commands, optionally using wildcard patterns and optionally return the full path to applications and scripts rather than the simple command name. The name of the command to use If true treat the name as a pattern to search for If true, return the full path to scripts and applications A list of command names... Searches for PowerShell commands, optionally using wildcard patterns The name of the command to use Type of commands to support If true treat the name as a pattern to search for Collection of command names... Executes a piece of text as a script synchronously. The script text to evaluate A collection of MshCobjects generated by the script. Thrown if there was a parsing error in the script. Represents a script-level exception Executes a piece of text as a script synchronously. The script text to evaluate The arguments to the script A collection of MshCobjects generated by the script. Thrown if there was a parsing error in the script. Represents a script-level exception Invoke a scriptblock in the current runspace, controlling if it gets a new scope. If true, a new scope will be created The scriptblock to execute Optionall input to the command Arguments to pass to the scriptblock The result of the evaluation Executes a piece of text as a script synchronously using the options provided. The script to evaluate. If true, evaluate the script in its own scope. If false, the script will be evaluated in the current scope i.e. it will be "dotted" If set to Output, all output will be streamed to the output pipe of the calling cmdlet. If set to None, the result will be returned to the caller as a collection of PSObjects. No other flags are supported at this time and will result in an exception if used. The list of objects to use as input to the script. The array of arguments to the command. A collection of MshCobjects generated by the script. This will be empty if output was redirected. Thrown if there was a parsing error in the script. Represents a script-level exception Thrown if any redirect other than output is attempted Compile a string into a script block. The source text to compile The compiled script block If an error occurred while executing the cmdlet, this will be set to true. This event handler is called when a command is not found. If should have a single string parameter that is the name of the command and should return a CommandInfo object or null. By default it will search the module path looking for a module that exports the desired command. This event handler is called before the command lookup is done. If should have a single string parameter that is the name of the command and should return a CommandInfo object or null. This event handler is after the command lookup is done but before the event object is returned to the caller. This allows things like interning scripts to work. If should have a single string parameter that is the name of the command and should return a CommandInfo object or null. Defines members used by Cmdlets. All Cmdlets must derive from . Do not attempt to create instances of or its subclasses. Instead, derive your own subclasses and mark them with , and when your assembly is included in a shell, the Engine will take care of instantiating your subclass. Defines members and overrides used by Cmdlets. All Cmdlets must derive from . There are two ways to create a Cmdlet: by deriving from the Cmdlet base class, and by deriving from the PSCmdlet base class. The Cmdlet base class is the primary means by which users create their own Cmdlets. Extending this class provides support for the most common functionality, including object output and record processing. If your Cmdlet requires access to the MSH Runtime (for example, variables in the session state, access to the host, or information about the current Cmdlet Providers,) then you should instead derive from the PSCmdlet base class. The public members defined by the PSCmdlet class are not designed to be overridden; instead, they provided access to different aspects of the MSH runtime. In both cases, users should first develop and implement an object model to accomplish their task, extending the Cmdlet or PSCmdlet classes only as a thin management layer. Defines members and overrides used by Cmdlets. All Cmdlets must derive from . There are two ways to create a Cmdlet: by deriving from the Cmdlet base class, and by deriving from the PSCmdlet base class. The Cmdlet base class is the primary means by which users create their own Cmdlets. Extending this class provides support for the most common functionality, including object output and record processing. If your Cmdlet requires access to the MSH Runtime (for example, variables in the session state, access to the host, or information about the current Cmdlet Providers,) then you should instead derive from the PSCmdlet base class. In both cases, users should first develop and implement an object model to accomplish their task, extending the Cmdlet or PSCmdlet classes only as a thin management layer. Defines members used by Cmdlets. All Cmdlets must derive from . Only use as a subclass of . Do not attempt to create instances of independently, or to derive other classes than from . Initializes the new instance of Cmdlet class. The only constructor is internal, so outside users cannot create an instance of this class. Represents the current pipeline object under consideration. The information about the command. When overridden in the derived class, performs initialization of command execution. Default implementation in the base class just returns. When overridden in the derived class, performs execution of the command. When overridden in the derived class, performs clean-up after the command execution. Default implementation in the base class just returns. When overridden in the derived class, interrupts currently running code within the command. It should interrupt BeginProcessing, ProcessRecord, and EndProcessing. Default implementation in the base class just returns. throws if the pipeline is stopping IDisposable implementation When the command is complete, release the associated memmbers Using InternalDispose instead of Dispose pattern because this interface was shipped in PowerShell V1 and 3rd cmdlets indirectly derive from this inerface. If we depend on Dispose() and 3rd party cmdlets do not call base.Dispose (which is the case), we will still end up having this leak. Allows you to access the calling token for this command invocation... Return the invocation data object for this command. The invocation object for this command. Gets or sets the current pipeline object under consideration Internal helper. Interface that should be used for interaction with host. Internal helper to get to SessionState Internal helper. Indicates whether stop has been requested on this command. Gets or sets the command information for the command. Gets or sets the execution context. may not be set to null This property tells you if you were being invoked inside the runspace or if it was an external request. Sets the parameter set The name of the valid parameter set. When overridden in the derived class, performs initialization of command execution. Default implementation in the base class just returns. This method is overridden in the implementation of individual cmdlets, and can throw literally any exception. When overridden in the derived class, performs execution of the command. This method is overridden in the implementation of individual cmdlets, and can throw literally any exception. When overridden in the derived class, performs clean-up after the command execution. Default implementation in the base class just returns. This method is overridden in the implementation of individual cmdlets, and can throw literally any exception. When overridden in the derived class, interrupts currently running code within the command. It should interrupt BeginProcessing, ProcessRecord, and EndProcessing. Default implementation in the base class just returns. This method is overridden in the implementation of individual cmdlets, and can throw literally any exception. Initializes the new instance of Cmdlet class. Only subclasses of can be created. Gets the resource string corresponding to baseName and resourceId from the current assembly. You should override this if you require a different behavior. the base resource name the resource id the resource string corresponding to baseName and resourceId Invalid or , or string not found in resources This behavior may be used when the Cmdlet specifies HelpMessageBaseName and HelpMessageResourceId when defining , or when it uses the constructor variants which take baseName and resourceId. Internal variant: Writes the specified error to the error pipe. Do not call WriteError(e.ErrorRecord). The ErrorRecord contained in the ErrorRecord property of an exception which implements IContainsErrorRecord should not be passed directly to WriteError, since it contains a rather than the real exception. error Not permitted at this time or from this thread The pipeline has already been terminated, or was terminated during the execution of this method. The Cmdlet should generally just allow PipelineStoppedException to percolate up to the caller of ProcessRecord etc. terminates the command, where allows the command to continue. If the pipeline is terminated due to ActionPreference.Stop or ActionPreference.Inquire, this method will throw , but the command failure will ultimately be , Writes the object to the output pipe. The object that needs to be written. This will be written as a single object, even if it is an enumeration. The pipeline has already been terminated, or was terminated during the execution of this method. The Cmdlet should generally just allow PipelineStoppedException to percolate up to the caller of ProcessRecord etc. Not permitted at this time or from this thread. WriteObject may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread. Writes one or more objects to the output pipe. If the object is a collection and the enumerateCollection flag is true, the objects in the collection will be written individually. The object that needs to be written to the pipeline. true if the collection should be enumerated The pipeline has already been terminated, or was terminated during the execution of this method. The Cmdlet should generally just allow PipelineStoppedException to percolate up to the caller of ProcessRecord etc. Not permitted at this time or from this thread. WriteObject may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread. Display verbose information verbose output The pipeline has already been terminated, or was terminated during the execution of this method. The Cmdlet should generally just allow PipelineStoppedException to percolate up to the caller of ProcessRecord etc. Not permitted at this time or from this thread. WriteVerbose may only be called during a call to this Cmdlets's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread. Use WriteVerbose to display more detailed information about the activity of your Cmdlet. By default, verbose output will not be displayed, although this can be configured with the VerbosePreference shell variable or the -Verbose and -Debug command-line options. Display warning information warning output The pipeline has already been terminated, or was terminated during the execution of this method. The Cmdlet should generally just allow PipelineStoppedException to percolate up to the caller of ProcessRecord etc. Not permitted at this time or from this thread. WriteWarning may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread. Use WriteWarning to display warnings about the activity of your Cmdlet. By default, warning output will be displayed, although this can be configured with the WarningPreference shell variable or the -Verbose and -Debug command-line options. Write text into pipeline execution log. text to be written to log The pipeline has already been terminated, or was terminated during the execution of this method. The Cmdlet should generally just allow PipelineStoppedException to percolate up to the caller of ProcessRecord etc. Not permitted at this time or from this thread. WriteWarning may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread. Use WriteCommandDetail to write important information about cmdlet execution to pipeline execution log. If LogPipelineExecutionDetail is turned on, this information will be written to monad log under log category "Pipeline execution detail" Display progress information progress information The pipeline has already been terminated, or was terminated during the execution of this method. The Cmdlet should generally just allow PipelineStoppedException to percolate up to the caller of ProcessRecord etc. Not permitted at this time or from this thread. WriteProgress may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread. Use WriteProgress to display progress information about the activity of your Cmdlet, when the operation of your Cmdlet could potentially take a long time. By default, progress output will be displayed, although this can be configured with the ProgressPreference shell variable. Displays progress output if enabled Identifies which command is reporting progress Progress status to be displayed The pipeline has already been terminated, or was terminated during the execution of this method. The Cmdlet should generally just allow PipelineStoppedException to percolate up to the caller of ProcessRecord etc. If the pipeline is terminated due to ActionPreference.Stop or ActionPreference.Inquire, this method will throw , but the command failure will ultimately be , Display debug information debug output The pipeline has already been terminated, or was terminated during the execution of this method. The Cmdlet should generally just allow PipelineStoppedException to percolate up to the caller of ProcessRecord etc. Not permitted at this time or from this thread. WriteDebug may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread. Use WriteDebug to display debug information on the inner workings of your Cmdlet. By default, debug output will not be displayed, although this can be configured with the DebugPreference shell variable or the -Debug command-line option. If the pipeline is terminated due to ActionPreference.Stop or ActionPreference.Inquire, this method will throw , but the command failure will ultimately be , Confirm the operation with the user. Cmdlets which make changes (e.g. delete files, stop services etc.) should call ShouldProcess to give the user the opportunity to confirm that the operation should actually be performed. Name of the target resource being acted upon. This will potentially be displayed to the user. The pipeline has already been terminated, or was terminated during the execution of this method. The Cmdlet should generally just allow PipelineStoppedException to percolate up to the caller of ProcessRecord etc. Not permitted at this time or from this thread. ShouldProcess may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread. If ShouldProcess returns true, the operation should be performed. If ShouldProcess returns false, the operation should not be performed, and the Cmdlet should move on to the next target resource. A Cmdlet should declare [Cmdlet( SupportsShouldProcess = true )] if-and-only-if it calls ShouldProcess before making changes. ShouldProcess may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread. ShouldProcess will take into account command-line settings and preference variables in determining what it should return and whether it should prompt the user. If the pipeline is terminated due to ActionPreference.Stop or ActionPreference.Inquire, will throw , but the command failure will ultimately be , namespace Microsoft.Samples.MSH.Cmdlet { [Cmdlet(VerbsCommon.Remove,"myobjecttype1")] public class RemoveMyObjectType1 : Cmdlet { [Parameter( Mandatory = true )] public string Filename { get { return filename; } set { filename = value; } } private string filename; public override void ProcessRecord() { if (ShouldProcess(filename)) { // delete the object } } } } Confirm the operation with the user. Cmdlets which make changes (e.g. delete files, stop services etc.) should call ShouldProcess to give the user the opportunity to confirm that the operation should actually be performed. This variant allows the caller to specify text for both the target resource and the action. Name of the target resource being acted upon. This will potentially be displayed to the user. Name of the action which is being performed. This will potentially be displayed to the user. (default is Cmdlet name) The pipeline has already been terminated, or was terminated during the execution of this method. The Cmdlet should generally just allow PipelineStoppedException to percolate up to the caller of ProcessRecord etc. Not permitted at this time or from this thread. ShouldProcess may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread. If ShouldProcess returns true, the operation should be performed. If ShouldProcess returns false, the operation should not be performed, and the Cmdlet should move on to the next target resource. A Cmdlet should declare [Cmdlet( SupportsShouldProcess = true )] if-and-only-if it calls ShouldProcess before making changes. ShouldProcess may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread. ShouldProcess will take into account command-line settings and preference variables in determining what it should return and whether it should prompt the user. If the pipeline is terminated due to ActionPreference.Stop or ActionPreference.Inquire, this method will throw , but the command failure will ultimately be , namespace Microsoft.Samples.MSH.Cmdlet { [Cmdlet(VerbsCommon.Remove,"myobjecttype2")] public class RemoveMyObjectType2 : Cmdlet { [Parameter( Mandatory = true )] public string Filename { get { return filename; } set { filename = value; } } private string filename; public override void ProcessRecord() { if (ShouldProcess(filename, "delete")) { // delete the object } } } } Confirm the operation with the user. Cmdlets which make changes (e.g. delete files, stop services etc.) should call ShouldProcess to give the user the opportunity to confirm that the operation should actually be performed. This variant allows the caller to specify the complete text describing the operation, rather than just the name and action. Textual description of the action to be performed. This is what will be displayed to the user for ActionPreference.Continue. Textual query of whether the action should be performed, usually in the form of a question. This is what will be displayed to the user for ActionPreference.Inquire. Caption of the window which may be displayed if the user is prompted whether or not to perform the action. may be displayed by some hosts, but not all. The pipeline has already been terminated, or was terminated during the execution of this method. The Cmdlet should generally just allow PipelineStoppedException to percolate up to the caller of ProcessRecord etc. Not permitted at this time or from this thread. ShouldProcess may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread. If ShouldProcess returns true, the operation should be performed. If ShouldProcess returns false, the operation should not be performed, and the Cmdlet should move on to the next target resource. A Cmdlet should declare [Cmdlet( SupportsShouldProcess = true )] if-and-only-if it calls ShouldProcess before making changes. ShouldProcess may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread. ShouldProcess will take into account command-line settings and preference variables in determining what it should return and whether it should prompt the user. If the pipeline is terminated due to ActionPreference.Stop or ActionPreference.Inquire, this method will throw , but the command failure will ultimately be , namespace Microsoft.Samples.MSH.Cmdlet { [Cmdlet(VerbsCommon.Remove,"myobjecttype3")] public class RemoveMyObjectType3 : Cmdlet { [Parameter( Mandatory = true )] public string Filename { get { return filename; } set { filename = value; } } private string filename; public override void ProcessRecord() { if (ShouldProcess( String.Format("Deleting file {0}",filename), String.Format("Are you sure you want to delete file {0}?", filename), "Delete file")) { // delete the object } } } } Confirm the operation with the user. Cmdlets which make changes (e.g. delete files, stop services etc.) should call ShouldProcess to give the user the opportunity to confirm that the operation should actually be performed. This variant allows the caller to specify the complete text describing the operation, rather than just the name and action. Textual description of the action to be performed. This is what will be displayed to the user for ActionPreference.Continue. Textual query of whether the action should be performed, usually in the form of a question. This is what will be displayed to the user for ActionPreference.Inquire. Caption of the window which may be displayed if the user is prompted whether or not to perform the action. may be displayed by some hosts, but not all. Indicates the reason(s) why ShouldProcess returned what it returned. Only the reasons enumerated in are returned. The pipeline has already been terminated, or was terminated during the execution of this method. The Cmdlet should generally just allow PipelineStoppedException to percolate up to the caller of ProcessRecord etc. Not permitted at this time or from this thread. ShouldProcess may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread. If ShouldProcess returns true, the operation should be performed. If ShouldProcess returns false, the operation should not be performed, and the Cmdlet should move on to the next target resource. A Cmdlet should declare [Cmdlet( SupportsShouldProcess = true )] if-and-only-if it calls ShouldProcess before making changes. ShouldProcess may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread. ShouldProcess will take into account command-line settings and preference variables in determining what it should return and whether it should prompt the user. If the pipeline is terminated due to ActionPreference.Stop or ActionPreference.Inquire, this method will throw , but the command failure will ultimately be , namespace Microsoft.Samples.MSH.Cmdlet { [Cmdlet(VerbsCommon.Remove,"myobjecttype3")] public class RemoveMyObjectType3 : Cmdlet { [Parameter( Mandatory = true )] public string Filename { get { return filename; } set { filename = value; } } private string filename; public override void ProcessRecord() { ShouldProcessReason shouldProcessReason; if (ShouldProcess( String.Format("Deleting file {0}",filename), String.Format("Are you sure you want to delete file {0}?", filename), "Delete file", out shouldProcessReason)) { // delete the object } } } } Confirm an operation or grouping of operations with the user. This differs from ShouldProcess in that it is not affected by preference settings or command-line parameters, it always does the query. This variant only offers Yes/No, not YesToAll/NoToAll. Textual query of whether the action should be performed, usually in the form of a question. Caption of the window which may be displayed when the user is prompted whether or not to perform the action. It may be displayed by some hosts, but not all. The pipeline has already been terminated, or was terminated during the execution of this method. The Cmdlet should generally just allow PipelineStoppedException to percolate up to the caller of ProcessRecord etc. Not permitted at this time or from this thread. ShouldContinue may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread. If ShouldContinue returns true, the operation should be performed. If ShouldContinue returns false, the operation should not be performed, and the Cmdlet should move on to the next target resource. Cmdlets using ShouldContinue should also offer a "bool Force" parameter which bypasses the calls to ShouldContinue and ShouldProcess. If this is not done, it will be difficult to use the Cmdlet from scripts and non-interactive hosts. Cmdlets using ShouldContinue must still verify operations which will make changes using ShouldProcess. This will assure that settings such as -WhatIf work properly. You may call ShouldContinue either before or after ShouldProcess. ShouldContinue may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread. Cmdlets may have different "classes" of confirmations. For example, "del" confirms whether files in a particular directory should be deleted, whether read-only files should be deleted, etc. Cmdlets can use ShouldContinue to store YesToAll/NoToAll members for each such "class" to keep track of whether the user has confirmed "delete all read-only files" etc. ShouldProcess offers YesToAll/NoToAll automatically, but answering YesToAll or NoToAll applies to all subsequent calls to ShouldProcess for the Cmdlet instance. namespace Microsoft.Samples.MSH.Cmdlet { [Cmdlet(VerbsCommon.Remove,"myobjecttype4")] public class RemoveMyObjectType4 : Cmdlet { [Parameter( Mandatory = true )] public string Filename { get { return filename; } set { filename = value; } } private string filename; [Parameter] public SwitchParameter Force { get { return force; } set { force = value; } } private bool force; public override void ProcessRecord() { if (ShouldProcess( String.Format("Deleting file {0}",filename), String.Format("Are you sure you want to delete file {0}", filename), "Delete file")) { if (IsReadOnly(filename)) { if (!Force && !ShouldContinue( String.Format("File {0} is read-only. Are you sure you want to delete read-only file {0}?", filename), "Delete file")) ) { return; } } // delete the object } } } } Confirm an operation or grouping of operations with the user. This differs from ShouldProcess in that it is not affected by preference settings or command-line parameters, it always does the query. This variant offers Yes, No, YesToAll and NoToAll. Textual query of whether the action should be performed, usually in the form of a question. Caption of the window which may be displayed when the user is prompted whether or not to perform the action. It may be displayed by some hosts, but not all. true iff user selects YesToAll. If this is already true, ShouldContinue will bypass the prompt and return true. true iff user selects NoToAll. If this is already true, ShouldContinue will bypass the prompt and return false. The pipeline has already been terminated, or was terminated during the execution of this method. The Cmdlet should generally just allow PipelineStoppedException to percolate up to the caller of ProcessRecord etc. Not permitted at this time or from this thread. ShouldContinue may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread. If ShouldContinue returns true, the operation should be performed. If ShouldContinue returns false, the operation should not be performed, and the Cmdlet should move on to the next target resource. Cmdlets using ShouldContinue should also offer a "bool Force" parameter which bypasses the calls to ShouldContinue and ShouldProcess. If this is not done, it will be difficult to use the Cmdlet from scripts and non-interactive hosts. Cmdlets using ShouldContinue must still verify operations which will make changes using ShouldProcess. This will assure that settings such as -WhatIf work properly. You may call ShouldContinue either before or after ShouldProcess. ShouldContinue may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread. Cmdlets may have different "classes" of confirmations. For example, "del" confirms whether files in a particular directory should be deleted, whether read-only files should be deleted, etc. Cmdlets can use ShouldContinue to store YesToAll/NoToAll members for each such "class" to keep track of whether the user has confirmed "delete all read-only files" etc. ShouldProcess offers YesToAll/NoToAll automatically, but answering YesToAll or NoToAll applies to all subsequent calls to ShouldProcess for the Cmdlet instance. namespace Microsoft.Samples.MSH.Cmdlet { [Cmdlet(VerbsCommon.Remove,"myobjecttype4")] public class RemoveMyObjectType5 : Cmdlet { [Parameter( Mandatory = true )] public string Filename { get { return filename; } set { filename = value; } } private string filename; [Parameter] public SwitchParameter Force { get { return force; } set { force = value; } } private bool force; private bool yesToAll; private bool noToAll; public override void ProcessRecord() { if (ShouldProcess( String.Format("Deleting file {0}",filename), String.Format("Are you sure you want to delete file {0}", filename), "Delete file")) { if (IsReadOnly(filename)) { if (!Force && !ShouldContinue( String.Format("File {0} is read-only. Are you sure you want to delete read-only file {0}?", filename), "Delete file"), ref yesToAll, ref noToAll ) { return; } } // delete the object } } } } Run the cmdlet and get the results as a collection. This is an internal routine that is used by Invoke to build the underlying collection of results. Returns an arraylist of results. Invoke this cmdlet object returning a collection of results. The results that were produced by this class Returns a strongly-typed enumerator for the results of this cmdlet. The type returned by the enumerator An instance of the appropriate enumerator Thrown when the object returned by the cmdlet cannot be converted to the target type Returns true if a transaction is available and active. Terminate the command and report an error The error which caused the command to be terminated always terminates the command, where allows the command to continue. The cmdlet can also terminate the command by simply throwing any exception. When the cmdlet's implementation of , or throws an exception, the Engine will always catch the exception and report it as a terminating error. However, it is preferred for the cmdlet to call , so that the additional information in is available. always throws , regardless of what error was specified in . The Cmdlet should generally just allow . to percolate up to the caller of . etc. When overridden in the derived class, performs initialization of command execution. Default implementation in the base class just returns. This method is overridden in the implementation of individual Cmdlets, and can throw literally any exception. When overridden in the derived class, performs execution of the command. This method is overridden in the implementation of individual Cmdlets, and can throw literally any exception. When overridden in the derived class, performs clean-up after the command execution. Default implementation in the base class just returns. This method is overridden in the implementation of individual Cmdlets, and can throw literally any exception. When overridden in the derived class, interrupts currently running code within the command. It should interrupt BeginProcessing, ProcessRecord, and EndProcessing. Default implementation in the base class just returns. This method is overridden in the implementation of individual Cmdlets, and can throw literally any exception. Is this command stopping? If Stopping is true, many Cmdlet methods will throw . In general, if a Cmdlet's override implementation of ProcessRecord etc. throws , the best thing to do is to shut down the operation and return to the caller. It is acceptable to not catch and allow the exception to reach ProcessRecord. The name of the parameter set in effect. the parameter set name Holds the command runtime object for this command. This object controls what actually happens when a write is called. Gets an object that surfaces the current PowerShell transaction. When this object is disposed, PowerShell resets the active transaction Initializes the new instance of PSCmdlet class. Only subclasses of can be created. The name of the parameter set in effect. the parameter set name Contains information about the identity of this cmdlet and how it was invoked. If the cmdlet declares paging support (via ), then property contains arguments of the paging parameters. Otherwise property is null. Provides access to utility routines for executing scripts and creating script blocks. Returns an object exposing the utility routines. Gets the host interaction APIs. Gets the instance of session state for the current runspace. Gets the event manager for the current runspace. Repostiory for jobs Manager for JobSourceAdapters registered. Repository for runspaces Gets the instance of the provider interface APIs for the current runspace. This describes the reason why ShouldProcess returned what it returned. Not all possible reasons are covered. none of the reasons below WhatIf behavior was requested. In the MSH host, WhatIf behavior can be requested explicitly for one cmdlet instance using the -WhatIf commandline parameter, or implicitly for all SupportsShouldProcess cmdlets with $WhatIfPreference. Other hosts may have other ways to request WhatIf behavior. Defines the Action Preference options. These options determine what will happen when a particular type of event occurs. For example, setting shell variable ErrorActionPreference to "Stop" will cause the command to stop when an otherwise non-terminating error occurs. Ignore this event and continue Stop the command Handle this event as normal and continue Ask whether to stop or continue Ignore the event completely (not even logging it to the target stream) Defines the ConfirmImpact levels. These levels describe the "destructiveness" of an action, and thus the degree of important that the user confirm the action. For example, setting the read-only flag on a file might be Low, and reformatting a disk might be High. These levels are also used in $ConfirmPreference to describe which operations should be confirmed. Operations with ConfirmImpact equal to or greater than $ConfirmPreference are confirmed. Operations with ConfirmImpact.None are never confirmed, and no operations are confirmed when $ConfirmPreference is ConfirmImpact.None (except when explicitly requested with -Confirm). There is never any need to confirm this action. This action only needs to be confirmed when the user has requested that low-impact changes must be confirmed. This action should be confirmed in most scenarios where confirmation is requested. This action is potentially highly "destructive" and should be confirmed by default unless otherwise specified. Command factory provides a generic interface to create different types of commands. Initializes the new instance of CommandFactory class. Initializes the new instance of CommandFactory class. Execution context. Creates a command object corresponing to specified name. The command processor will use global scope. Creates a command object corresponing to specified name. Location where the command was dispatched from. Created command processor object. Thrown if session state does not contain the CommandDiscovery instance. Creates a command object corresponing to specified name. Creates a command object corresponing to specified name. Location where the command was dispatched from. True if command processor should use local scope to execute the command, False otherwise. Created command processor object. Thrown if session state does not contain the CommandDiscovery instance. Creates a command object corresponing to specified name. Creates a command object corresponing to specified name. Execution Context. Location where the command was dispatched from. Created command processor object. Thrown if session state does not contain the CommandDiscovery instance. Execution context under which the command should be created. Represents a parameter to the Command. Set the argument value and extent. Create a parameter when no argument has been specified. The extent in script of the parameter. The parameter name (with no leading dash). The text of the parameter, as it did, or would, appear in script. Create a positional argument to a command. The extent of the argument value in the script. The argument value. True if the argument value is to be splatted, false otherwise. Create an named argument, where the parameter name is known. This can happen when: * The user uses the ':' syntax, as in foo -bar:val * Splatting, as in $x = @{ bar = val } ; foo @x * Via an API - when converting a CommandParameter to CommandParameterInternal. * In the parameter binder when it resolves a positional argument * Other random places that manually construct command processors and know their arguments. The extent in script of the parameter. The parameter name (with no leading dash). The text of the parameter, as it did, or would, appear in script. The extent of the argument value in the script. The argument value. Used in native commands to correctly handle -foo:bar vs. -foo: bar Gets and sets the string that represents parameter name, which does not include the '-' (dash). The text of the parameter, which typically includes the leading '-' (dash) and, if specified, the trailing ':'. The extent of the parameter, if one was specified. The extent of the optional argument, if one was specified. The value of the optional argument, if one was specified, otherwise UnboundParameter.Value. If an argument was specified and is to be splatted, returns true, otherwise false. The extent to use when reporting generic errors. The argument extent is used, if it is not empty, otherwise the parameter extent is used. Some errors may prefer the parameter extent and should not use this method. Class definition of CommandProcessor - This class provides interface to create and execute commands written in CLS compliant languages. The base class for all command processor classes. It provides abstract methods to execute a command. Default constructor Initializes the base command processor class with the command metadata The metadata about the command to run. The command runtime used for this instance of a command processor. Ensures that the provided script block is compatible with the current language mode - to be used when a script block is being dotted. The script block being dotted The current language mode The invocation info about the command The execution context used by the system. Checks if user has requested help (for example passing "-?" parameter for a cmdlet) and if yes, then returns the help target to display. help target to request help category to request true if user requested help; false otherwise Creates a command procesor for "get-help [helpTarget]" context for the command processor help target help category command processor for "get-help [helpTarget]" Tells whether pipeline input is expected or not. A bool indicating whether pipeline input is expected. This method sets the current session state scope to the execution scope for the pipeline that was stored in the pipeline manager when it was first invoked. Restores the current session state scope to the scope which was active when SetCurrentScopeToExecutionScope was called. A collection of arguments that have been added by the parser or host interfaces. These will be sent to the parameter binder controller for processing. Adds an unbound parameter. The parameter to add to the unbound arguments list Prepares the command for execution. This should be called once before ProcessRecord(). Sets the execution scope for the pipeline and then calls the Prepare abstract method which gets overridden by derived classes. Called once before ProcessRecord(). Internally it calls BeginProcessing() of the InternalCommand. a terminating error occurred, or the pipeline was otherwise stopped This calls the command. It assumes that DoPrepare() has already been called. This method sets the execution scope to the appropriate scope for the pipeline and then calls the ProcessRecord abstract method that derived command processors override. Called once after ProcessRecord(). Internally it calls EndProcessing() of the InternalCommand. a terminating error occurred, or the pipeline was otherwise stopped Calls the virtual Complete method after setting the appropriate session state scope for diagnostic purposes True if Read() has not be called, false otherwise. Entry point used by the engine to reads the input pipeline object and binds the parameters. This default implementation reads the next pipeline object and sets it as the CurrentPipelineObject in the InternalCommand. True if read succeeds. does not throw Checks whether the exception is a severe exception which should cause immediate process failure. CB says 02/23/2005: I personally would err on the side of treating OOM like an application exception, rather than a critical system failure.I think this will be easier to justify in Orcas, if we tease apart the two cases of OOM better. But even in Whidbey, how likely is it that we couldnt JIT some backout code? At that point, the process or possibly the machine is likely to stop executing soon no matter what you do in this routine. So I would just consider AccessViolationException. (I understand why you have SO here, at least temporarily). Wraps the exception which occurred during cmdlet invocation, stores that as the exception to be returned from PipelineProcessor.SynchronousExecute, and writes it to the error variable. The exception to wrap in a CmdletInvocationException or CmdletProviderInvocationException. Always returns PipelineStoppedException. The caller should throw this exception. Almost all exceptions which occur during pipeline invocation are wrapped in CmdletInvocationException before they are stored in the pipeline. However, there are several exceptions: AccessViolationException, StackOverflowException: These are considered to be such severe errors that we FailFast the process immediately. ProviderInvocationException: In this case, we assume that the cmdlet is get-item or the like, a thin wrapper around the provider API. We discard the original ProviderInvocationException and re-wrap its InnerException (the real error) in CmdletProviderInvocationException. This makes it easier to reach the real error. CmdletInvocationException, ActionPreferenceStopException: This indicates that the cmdlet itself ran a command which failed. We could go ahead and wrap the original exception in multiple layers of CmdletInvocationException, but this makes it difficult for the caller to access the root problem, plus the serialization layer might not communicate properties beyond some fixed depth. Instead, we choose to not re-wrap the exception. PipelineStoppedException: This could mean one of two things. It usually means that this pipeline has already stopped, in which case the pipeline already stores the original error. It could also mean that the cmdlet ran a command which was stopped by CTRL-C etc, in which case we choose not to re-wrap the exception as with CmdletInvocationException. Stores the exception to be returned from PipelineProcessor.SynchronousExecute, and writes it to the error variable. The exception which occurred during script execution ManageScriptException throws PipelineStoppedException if-and-only-if the exception is a RuntimeException, otherwise it returns. This allows the caller to rethrow unexpected exceptions. Sometimes we shouldn't be rethrow the exception we previously caught, such as when the exception is handled by a trap. IDisposable implementation When the command is complete, the CommandProcessorBase should be disposed. This enables cmdlets to reliably release file handles etc. without waiting for garbage collection We use the standard IDispose pattern Finalizer for class CommandProcessorBase Gets the CommandInfo for the command this command processor represents This indicates whether this command processor is created from a script file. Script command processor created from a script file is special in following two perspect, 1. New scope created needs to be a 'script' scope in the sense that it needs to handle $script: variables. For normal functions or scriptblocks, script scope variables are not supported. 2. ExitException will be handled by setting lastExitCode. For normal functions or scriptblocks, exit command will kill current powershell session. If this flag is true, the commands in this Pipeline will redirect the global error output pipe to the command's error output pipe. (see the comment in Pipeline.RedirectShellErrorOutputPipe for an explanation of why this flag is needed) Gets or sets the command object. For commands that use the scope stack, if this flag is true, don't create a new scope when running this command. Etw activity for this pipeline If you want this command to execute in other than the default session state, use this API to get and set that session state instance... Gets sets the session state scope for this command processor object Initializes the new instance of CommandProcessor class. The information about the cmdlet. PowerShell engine execution context for this command. If there was a failure creating an instance of the cmdlet type. This is the constructor for script as cmdlet. The information about the cmdlet. PowerShell engine execution context for this command. True when the script to be executed came from a file (as opposed to a function, or interactive input) Returns a CmdletParameterBinderController for the specified command The cmdlet to bind parameters to. A new instance of a CmdletParameterBinderController. if is not a Cmdlet. Binds the specified command-line parameters to the target true if encode succeeds otherwise false. If any parameters fail to bind, or If any mandatory parameters are missing. If there is an error generating the metadata for dynamic parameters. Prepares the command. Encodes the command-line parameters JonN 2003-04-02 Split from Execute() If any parameters fail to bind, or If any mandatory parameters are missing. If there is an error generating the metadata for dynamic parameters. This calls the command. It assumes that Prepare() has already been called. JonN 2003-04-02 Split from Execute() a terminating error occurred, or the pipeline was otherwise stopped Tells whether it is the first call to Read Tells whether to bail out in the next call to Read Populates the parameters specified from the pipeline. A bool indicating whether read succeeded. If a parameter fails to bind. or If a mandatory parameter is missing. The pipeline was already stopped. Writes an ErrorRecord to the commands error pipe because the specified input object was not bound to the command. The pipeline input object that was not bound. The resource ID of the error message. This is also used as the error ID of the ErrorRecord. Additional arguments to be formatted into the error message that is loaded based on the . Reads an object from an input pipeline and attempts to bind the parameters The pipeline input object to be processed. False the pipeline input object was not bound in any way to the command. If a ShouldProcess parameter is specified but the cmdlet does not support ShouldProcess. or If an error occurred trying to bind a parameter from the pipeline object. Initializes the command's request object The information about the cmdlet. If the constructor for the cmdlet threw an exception. The type referenced by refered to an abstract type or them member was invoked via a late-binding mechanism. If refers to a type that is invalid. Checks if user has requested help (for example passing "-?" parameter for a cmdlet) and if yes, then returns the help target to display. help target to request help category to request true if user requested help; false otherwise Defines the parameters that are present on all Cmdlets. Constructs an instance with the specified command instance The instance of the command that the parameters should set the user feedback properties on when the parameters get bound. If is null. Gets or sets the value of the Verbose parameter for the cmdlet. This parameter tells the command to articulate the actions it performs while executing. Gets or sets the value of the Debug parameter for the cmdlet. This parameter tells the command to provide Programmer/Support type messages to understand what is really occuring and give the user the opportunity to stop or debug the situation. Gets or sets the value of the ErrorAction parameter for the cmdlet. This parameter tells the command what to do when an error occurs. Gets or sets the value of the WarningAction parameter for the cmdlet. This parameter tells the command what to do when a warning occurs. Gets or sets the value of the ErrorVariable parameter for the cmdlet. This parameter tells the command which variable to populate with the errors. Use +varname to append to the variable rather than clearing it. Gets or sets the value of the WarningVariable parameter for the cmdlet. This parameter tells the command which variable to populate with the warnings. Use +varname to append to the variable rather than clearing it. Gets or sets the OutVariable parameter for the cmdlet. This parameter tells the command to set all success output in the specified variable. Similar to the way -errorvariable sets all errors to a variable name. Semantically this is equivalent to : command |set-var varname -passthru but it should be MUCH faster as there is no binding that takes place Gets or sets the OutBuffer parameter for the cmdlet. This parameter configures the number of objects to buffer before calling the downstream Cmdlet Serves as the base class for Validate attributes that validate parameter arguments. Argument validation attributes can be attached to and parameters to ensure that the Cmdlet or CmdletProvider will not be invoked with invalid values of the parameter. Existing validation attributes include , , , , , , , and . PSSnapins wishing to create custom argument validation attributes should derive from and override the abstract method, after which they can apply the attribute to their parameters. validates the argument as a whole. If the argument value is potentially an enumeration, you can derive from which will take care of unrolling the enumeration and validate each element individually. It is also recommended to override to return a readable string similar to the attribute declaration, for example "[ValidateRangeAttribute(5,10)]". If this attribute is applied to a string parameter, the string command argument will be validated. If this attribute is applied to a string[] parameter, the string[] command argument will be validated. Serves as the base class for Metadata attributes. PSSnapins may not create custom attributes derived directly from , since it has no public constructor. Only the public subclasses and are available. Default constructor Overridden by subclasses to implement the validation of the parameter arguments argument value to validate The engine APIs for the context under which the prerequisite is being evaluated. Validate that the value of is valid, and throw if it is invalid. should be thrown for any validation failure Method that the command processor calls for data validate processing object to validate The engine APIs for the context under which the prerequisite is being evaluated. bool true if the validate succeeded Whenever any exception occurs during data validate. All the system exceptions are wrapped in ValidationMetadataException for invalid arguments Initializes a new instance of a class derived from ValidateArgumentsAttribute Exposes the Content nouns to the Cmdlet Providers to the Cmdlet base class. The methods of this class use the providers to perform operations. Hide the default constructor since we always require an instance of SessionState Constructs a facade over the "real" session state API An instance of the cmdlet. If is null. Constructs a facade over the "real" session state API An instance of the sessionState. If is null. Gets the content reader for the item at the specified path The path to the item to get the content reader for. The IContentReader for the item(s) at the specified path. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the content reader for the item at the specified path The path(s) to the item(s) to get the content reader for. Passed on to providers to force operations. If true, globbing is not done on paths. The IContentReader for the item(s) at the specified path. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the dynamic parameters for the get-content cmdlet. The path to the item if it was specified on the command line. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the content writer for the item(s) at the specified path. The path to the item(s) to get the content writer for. The IContentWriter for the item(s) at the specified path. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the content writer for the item(s) at the specified path. The path(s) to the item(s) to get the content writer for. Passed on to providers to force operations. If true, globbing is not done on paths. The IContentWriter for the item(s) at the specified path. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the dynamic parameters for the set-content and add-content cmdlet. The path to the item if it was specified on the command line. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Clears the content from the item(s) specified by the path The path to the item(s) to clear the content from. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Clears the content from the item(s) specified by the path The path(s) to the item(s) to clear the content from. Passed on to providers to force operations. If true, globbing is not done on paths. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Clears the content from the specified item(s) The path to the item(s) to clear the content from. The context under which the command is running. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the dynamic parameters for the clear-content cmdlet. The path to the item if it was specified on the command line. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Exposes the Cmdlet Family Provider's drives to the Cmdlet base class. The methods of this class get and set provider data in session state. Hide the default constructor since we always require an instance of SessionState Constructs a Drive management facade The instance of session state that facade wraps. If is null. Creates a new MSH drive in session state The drive to be created. The ID of the scope to create the drive in. This may be one of the scope keywords like global or local, or it may be an numeric offset of the scope generation relative to the current scope. If the scopeID is null or empty the local scope is used. The drive that was created. If is null. If the drive already exists, or If .Name contains one or more invalid characters; ~ / \\ . : If the provider is not a DriveCmdletProvider. The provider for the could not be found. If the provider threw an exception or returned null. If creating the drive will overflow the MaximumDriveCount limit. Creates a new MSH drive in session state The drive to be created. The ID of the scope to create the drive in. This may be one of the scope keywords like global or local, or it may be an numeric offset of the scope generation relative to the current scope. If the scopeID is null or empty the local scope is used. The context under which this command is running. Nothing. The drive that is created is written to the context. If or is null. If the drive already exists or If .Name contains one or more invalid characters; ~ / \\ . : If the provider is not a DriveCmdletProvider. The provider for the could not be found. If the provider threw an exception or returned null. If creating the drive will overflow the MaximumDriveCount limit. Gets an object that defines the additional parameters for the NewDrive implementation for a provider. The provider ID for the drive that is being created. The context under which this method is being called. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the is not a DriveCmdletProvider. If does not exist. Removes the specified drive. The name of the drive to be removed. Determines whether drive should be forcefully removed even if there was errors. The ID of the scope to remove the drive from. This may be one of the scope keywords like global or local, or it may be an numeric offset of the scope generation relative to the current scope. If the scopeID is null or empty the local scope is used. Removes the specified drive. The name of the drive to be removed. Determines whether drive should be forcefully removed even if there was errors. The ID of the scope to remove the drive from. This may be one of the scope keywords like global or local, or it may be an numeric offset of the scope generation relative to the current scope. If the scopeID is null or empty the local scope is used. The context under which this command is running. Gets the drive information for the drive specified by name. The name of the drive to get the drive information for. The drive information that represents the drive of the specified name. If is null. If there is no drive with . Gets the drive information for the drive specified by name. The name of the drive to get the drive information for. The ID of the scope to get the drive from. This may be one of the scope keywords like global or local, or it may be an numeric offset of the scope generation relative to the current scope. If the scopeID is null or empty the local scope is used. The drive information that represents the drive of the specified name. If is null. If is less than zero, or not a number and not "script", "global", "local", or "private" If is less than zero or greater than the number of currently active scopes. Retrieves all the drives in the specified scope Retrieves all the drives in the specified scope The scope to retrieve the drives from. If null, the drives in all the scopes will be returned. If is less than zero, or not a number and not "script", "global", "local", or "private" If is less than zero or greater than the number of currently active scopes. Gets all the drives for the specified provider The name of the provider to get the drives for. All the drives in all the scopes for the given provider. Gets the drive information for the current working drive. This property is readonly. To set the current drive use the SetLocation method. Takes as input a collection of strings and builds an expression tree from the input. At the evaluation stage, it walks down the tree and evaluates the result. Construct the expression from a single string. The specified flag attribute expression string. Construct the tree from an object collection when arguments are comma seperated. If valid, all elements are OR seperated. The array of specified flag attribute subexpression strings. Evaluate a given flag enum value against the expression. The flag enum value to be evaluated. Whether the enum value satisfy the expression. Given an enum element, check if the element is present in the expression tree, which is also present in the input expression. The enum element to be examined. Whether the enum element is present in the expression. The enum value passed in should be a single enum element value, not a flag enum value with multiple bits set. Takes a string of input tokenize into a list of ordered tokens. The input argument string, could be partial input (one element from the argument collection). A generic list of tokenized input. Find the start of the next token, skipping white spaces. Input string Current offset position for the string parser. Given the start (offset) of the next token, traverse through the string to find the next token, stripping correctly enclosed quotes. Input string Current offset position for the string parser. The next token on the input string Checks syntax errors on input expression, as well as performing disambiguation for identifiers. A list of tokenized input. Takes a list of tokenized input and create the corresponding expression tree. Tokenized list of the input string. Abstract base type for other types of nodes in the tree. OR node for attributes separated by a comma. AND node for attributes separated by a plus(+) operator. NOT node for attribute preceded by an exclamation(!) operator. Leaf nodes of the expression tree. Takes a string value and converts to corresponding enum value. The string value should be checked at parsing stage prior to tree construction to ensure it is valid. Performs enum minimum disambiguation. Initialize the dictionary for special cases of minimum disambiguation. Perform disambiguation on enum names complete enum name after disambiguation Produces a string that contains all the enumerator names in an enum type. Errors reported by Monad will be in one of these categories. Do not specify ErrorCategory.NotSpecified when creating an . Choose the best match from among the other values. No error category is specified, or the error category is invalid. Do not specify ErrorCategory.NotSpecified when creating an . Choose the best match from among the other values. Object can not be found (file, directory, computer, system resource, etc.) Operation not permitted A non-Monad command reported an error to its STDERR pipe. The Engine uses this ErrorCategory when it executes a native console applications and captures the errors reported by the native application. Avoid using ErrorCategory.FromStdErr in other circumstances. Used for security exceptions The contract of a protocol is not being followed. Should not happen with well-behaved components. The operation depends on a network connection that cannot be established or maintained. Could not authenticate the user to the service. Could mean that the credentials are invalid or the authentication system is not functioning properly. Internal limits prevent the operation from being executed. Controls on the use of traffic or resources prevent the operation from being executed. The operation attempted to use functionality that is currently disabled. Contains auxiliary information about an concise text description based on concise text description GetMessage returns a concise string which categorizes the error, based on and including the other fields of as appropriate. This string is much shorter than or , since it only categorizes the error and does not contain a full description or recommended actions. The default host will display this string instead of the full message if shell variable $ErrorView is set to "CategoryView". concise text description based on Culture in which to display message concise text description GetMessage returns a concise string which categorizes the error, based on and including the other fields of as appropriate. This string is much shorter than or , since it only categorizes the error and does not contain a full description or recommended actions. The default host will display this string instead of the full message if shell variable $ErrorView is set to "CategoryView". Same as developer-readable identifier The Activity, Reason, TargetName and TargetType strings in ErrorCategoryInfo can be of unlimited length. In order to control the maximum length of the GetMessage() string, we ellipsize these strings. The current heuristic is to take strings longer than 40 characters and ellipsize them to the first and last 15 characters plus "..." in the middle. culture to retrieve template if needed original string Ellipsized version of string "Please do not make this public as ellipsize is not a word." for this error text description of the operation which encountered the error text description of the operation By default, this is the cmdlet name. The default can be overridden by calling Set with a non-empty value, for example "Delete". text description of the error text description of the error By default, this is the exception type. The default can be overridden by calling Set with a non-empty value, for example "Permission Denied". text description of the target object text description of the target object By default, this is TargetObject.ToString(), or the empty string if the target object is null. The default can be overridden by calling Set with a non-empty value, for example "John Doe". text description of the type of the target object text description of the type of the target object By default, this is TargetObject.GetType().ToString(), or the empty string if the target object is null. The default can be overridden by calling Set with a non-empty value, for example "Active Directory User". additional details about an ErrorDetails represents additional details about an , starting with a replacement Message. Clients can use ErrorDetails when they want to display a more specific Message than the one contained in a particular Exception, without having to create a new Exception or define a new Exception class. It is permitted to subclass but there is no established scenario for doing this, nor has it been tested. Creates an instance of ErrorDetails specifying a Message. It is preferred for Cmdlets to use , for CmdletProviders to use , and for other localizable code to use where possible. Creates an instance of ErrorDetails specifying a Message. This variant is used by cmdlets. cmdlet containing the template string by default, the name by default, the resourceId in the insertion parameters This variant is a shortcut to build an instance of reducing the steps which localizable code generally has to duplicate when it generates a localizable string. This variant is preferred over , since the improved information about the error may help enable future scenarios. This constructor first loads the error message template string using . The default implementation of will load a string resource from the cmdlet assembly using and ; however, specific cmdlets can override this behavior by overriding virtual method . This constructor then inserts the specified args using . Creates an instance of ErrorDetails specifying a Message. This variant is used by CmdletProviders. Resource supplier, most often an instance of . by default, the name by default, the resourceId in the insertion parameters This variant is a shortcut to build an instance of reducing the steps which localizable code generally has to duplicate when it generates a localizable string. This variant is preferred over , since the improved information about the error may help enable future scenarios. This constructor first loads a template string using . The default implementation of will load a string resource from the CmdletProvider assembly using and ; however, specific CmdletProviders can override this behavior by overriding virtual method , and it is also possible that PSSnapin custom classes which are not instances of will implement . The constructor then inserts the specified args using . Creates an instance of ErrorDetails specifying a Message. This variant is used by other code without a reference to a or instance. assembly containing the template string by default, the name by default, the resourceId in the insertion parameters This variant is a shortcut to build an instance of reducing the steps which localizable code generally has to duplicate when it generates a localizable string. This variant is preferred over , since the improved information about the error may help enable future scenarios. This constructor first loads a template string from the assembly using . The constructor then inserts the specified args using . Initializes a new instance of the ErrorDetails class using data serialized via serialization information streaming context constructed object Serializer for serialization information streaming context As developer-readable identifier Message which replaces in When an instance of contains a non-null and is non-empty, the default host will display it instead of the in . This should be a grammatically correct localized text string, as with Text describing the recommended action in the event that this error occurs. This is empty unless the code which generates the error specifies it explicitly. This should be a grammatically correct localized text string. This may be left empty. Represents an error. An ErrorRecord describes an error. It extends the usual information in with the additional information in , , , , , and . Non-terminating errors are stored as instances in shell variable $error. Some terminating errors implement which gives them an ErrorRecord property containing this additional information. In this case, ErrorRecord.Exception will be an instance of . rather than the actual exception, to avoid the mutual references. Creates an instance of ErrorRecord. This is an exception which describes the error. This argument may not be null, but it is not required that the exception have ever been thrown. This string will be used to construct the FullyQualifiedErrorId, which is a global identifier of the error condition. Pass a non-empty string which is specific to this error condition in this context. This is the ErrorCategory which best describes the error. This is the object against which the cmdlet or provider was operating when the error occurred. This is optional. Initializes a new instance of the ErrorRecord class using data serialized via serialization information streaming context constructed object ErrorRecord instances which are serialized using will only be partially reconstructed. Deserializer for serialization information streaming context isSerialized is set to true if this error record is serialized. Value for FullyQualifiedErrorId in case of serialized error record. Message overidee for CategoryInfo.GetMessage method This constructor is used by remoting code to create ErrorRecord. Various information is obtained from serialized ErrorRecord. Adds the information about this error record to PSObject as notes. Gets the value for note from mshObject PSObject from which value is fetched. name of note whose value is fetched value of note Create an ErrorRecord object from serialized ErrorRecord. serializedErrorRecord PSObject is in the format returned by ToPSObjectForRemoting method. PSObject to convert to ErrorRecord ErrorRecord convert from mshObject. Thrown if mshObject parameter is null. Copy constructor, for use when a new wrapper exception wraps an exception which already has an ErrorRecord ErrorCategoryInfo and ErrorDetails are deep-copied, other fields are not. wrapped ErrorRecord If the wrapped exception contains a ParentContainsErrorRecordException, the new ErrorRecord should have this exception as its Exception instead. Wrap the current ErrorRecord instance A derived class needs to override this method if it contains additional info that needs to be kept when it gets wrapped. If the wrapped exception contains a ParentContainsErrorRecordException, the new ErrorRecord should have this exception as its Exception instead. As developer-readable identifier Is this instance serialized. An Exception describing the error. never null The object against which the error occurred. may be null Information regarding the ErrorCategory associated with this error, and with the categorized error message for that ErrorCategory. never null String which uniquely identifies this error condition never null FullyQualifiedErrorid identifies this error condition more specifically than either the ErrorCategory or the Exception. Use FullyQualifiedErrorId to filter specific error conditions, or to associate special handling with specific error conditions. Additional information about the error. may be null In particular, ErrorDetails.Message (if present and non-empty) contains a replacement message which should be displayed instead of Exception.Message. Identifies the cmdlet, script, or other command which caused the error. may be null The script stack trace for the error. The status of the pipeline when this record was created. Whether to serizalize the InvocationInfo during remote calls Implemented by exception classes which contain additional information. MSH defines certain exception classes which implement this interface. This includes wrapper exceptions such as , and also MSH engine errors such as . Cmdlets and providers should not define this interface; instead, they should use the WriteError(ErrorRecord) or ThrowTerminatingError(ErrorRecord) methods. The ErrorRecord property will contain an ErrorRecord which contains an instance of rather than the actual exception. Do not call WriteError(e.ErrorRecord). The ErrorRecord contained in the ErrorRecord property of an exception which implements IContainsErrorRecord should not be passed directly to WriteError, since it contains a ParentContainsErrorRecordException rather than the real exception. It is permitted for PSSnapins to implement custom Exception classes which implement , but it is generally preferable for Cmdlets and CmdletProviders to communicate information using or rather than by throwing an exception which implements . Consider implementing in your custom exception only if you throw it from a context where a reference to the active or is no longer available. This is the which provides additional information about the error. The instance returned by should contain in its property an instance of rather than a reference to the root exception. This prevents a recursive reference between the exception implementing and the . Use the constructor so that the will have the same as the root exception. Objects implementing this interface can be used by implements this interface. PSSnapins can implement on their custom classes, but the only purpose would be to permit the custom class to be used in the . constructor. contains special constructor reducing the steps which localizable code generally has to duplicate when it generates a localizable string. This variant is preferred over , since the improved information about the error may help enable future scenarios. Gets the error message template string corresponding to and . If the desired behavior is simple string lookup in your assembly, you can use the constructor instead and not bother implementing . Consider implementing if you want more complex behavior. Insertions will be inserted into the string with to generate the final error message in . the base resource name the resource id the error message template string corresponding to baseName and resourceId Describes how and where this command was invoked Contructor for InvocationInfo object when the associated command object is present. Constructor for InvocationInfo object The command information the invocation info represents. The position representing the invocation, or the position representing the error. Constructor for InvocationInfo object The command information the invocation info represents. The position representing the invocation, or the position representing the error. The context in which the InvocationInfo is being created. Creates an InformationalRecord from an instance serialized as a PSObject by ToPSObjectForRemoting. Returns the full text of the script for this invocation info. Adds the information about this informational record to a PSObject as note properties. The PSObject is used to serialize the record during remote operations. InvocationInfos are usually serialized as part of another object, so we add "InvocationInfo_" to the note properties to prevent collisions with any properties set by the containing object. Provide basic information about the command may be null This member provides a dictionary of the parameters that were bound for this script or command. This member provides a list of the arguments that were not bound to any parameter The line number in the executing script that contained this cmdlet. The script line number or -1 if not executing in a script. Command's character offset in that line. If the command was executed directly through the host interfaces, this will be -1. The line offset or -1 if not executed from a text line. History ID that represents the command. If unavailable, this will be -1. The history ID or -1 if not available. The name of the script containing the cmdlet. The script name or "" if there was no script. The text of the line that contained this cmdlet invocation. Line that was entered to invoke this command Formatted message indicating where the cmdlet appeared in the line Formatted string indicating the command's position in the line This property tells you the directory from where you were being invoked This property tells you the full path to the command from where you were being invoked Command name used to invoke this string - if invoked through an alias, then this would be the alias name. The name string. How many elements are in the containing pipeline number of elements in the containing pipeline which element this command was in the containing pipeline which element this command was in the containing pipeline Is true if this command is expecting input... This property tells you if you were being invoked inside the runspace or if it was an external request. The position for the invocation or error. The position for the invocation or error. Index of the ProcessRecord iteration for each of the commands in the pipeline. All the commands in a given pipeline share the same PipelinePositionInfo. A CommandInfo that has been serialized/deserialized as part of an InvocationInfo during a remote invocation. The base class for the information about commands. Contains the basic information about the command, like name and type. Creates an instance of the CommandInfo class with the specified name and type The name of the command. The type of the command. If is null. Creates an instance of the CommandInfo class with the specified name and type The name of the command. The type of the command. The execution context for the command. If is null. This is a copy constructor, used primarily for get-command. This is a copy constructor, used primarily for get-command. Internal interface to change the type of a CommandInfo object. This is required for renaming aliases, functions, and filters The new name for the command. If is null or empty. for diagnostic purposes Set the module for this command... Constructs the MergedCommandParameterMetadata, using any arguments that may have been specified so that dynamic parameters can be determined, if any. Resolves a full, shortened, or aliased parameter name to the actual cmdlet parameter name, using PowerShell's standard parameter resolution algorithm. The name of the parameter to resolve. The parameter that matches this name Create a copy of commandInfo for GetCommandCommand so that we can generate parameter sets based on an argument list (so we can get the dynamic parameters.) Generates the parameter and parameter set info from the cmdlet metadata A collection of CommandParameterSetInfo representing the cmdlet metadata. The type name is invalid or the length of the type name exceeds 1024 characters. The caller does not have the required permission to load the assembly or create the type. If more than int.MaxValue parameter-sets are defined for the command. If a parameter defines the same parameter-set name multiple times. If the attributes could not be read from a property or field. Gets the name of the command. Gets the type of the command The execution context this command will run in. The language mode that was in effect when this alias was defined. A string representing the definition of the command. This is overridden by derived classes to return specific information for the command type. Indicates if the command is to be allowed to be executed by a request external to the runspace. Return a CommandMetadata instance that is never exposed publicly. Returns the syntax of a command The module name of this command. It will be empty for commands not imported from either a module or snapin. The module that defines this cmdlet. This will be null for commands that are not defined in the context of a module. The remoting capabilities of this cmdlet, when exposed in a context with ambient remoting. True if the command has dynamic parameters, false otherwise. Return the parameters for this command. Gets the information about the parameters and parameter sets for this command. A possibly incomplete or even incorrect list of types the command could return. Specifies whether this command was imported from a module or not. This is used in Get-Command to figure out which of the commands in module session state were imported. The prefix that was used when importing this command Gets or sets whether this CmdletInfo instance is a copy used for get-command. If true, and the cmdlet supports dynamic parameters, it means that the dynamic parameter metadata will be merged into the parameter set information. Gets or sets the command line arguments/parameters that were specified which will allow for the dynamic parameters to be retrieved and their metadata merged into the parameter set information. Creates a RemoteCommandInfo from an instance serialized as a PSObject by ToPSObjectForRemoting. Adds the information about this instance to a PSObject as note properties. The PSObject is used to serialize the CommandInfo during remote operations. CommandInfos are usually serialized as part of InvocationInfos, so we add "CommandInfo_" to the note properties to prevent collisions with any properties set by the containing object. A string representing the definition of the command. NYI Exposes the Item noun of the Cmdlet Providers to the Cmdlet base class. The methods of this class use the providers to perform operations. Hide the default constructor since we always require an instance of SessionState Constructs a facade over the "real" session state API An instance of the cmdlet. If is null. Constructs a facade over the "real" session state API An instance of the "real" session state class. If is null. Gets the item at the specified path. The path to the item to retrieve. It may be a drive or provider-qualified path and may include glob characters. The object(s) at the specified path. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the item at the specified path. The path(s) to the item(s) to retrieve. They may be a drive or provider-qualified path(s) and may include glob characters. Passed on to providers to force operations. If true, globbing is not done on paths. The object(s) at the specified path. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the item at the specified path. The path to the item to retrieve. It may be a drive or provider-qualified path and may include glob characters. The context under which the command is running. Nothing. The object(s) at the specified path are written to the context. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the dynamic parameters for the get-item cmdlet. The path to the item if it was specified on the command line. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Sets the item at the specified path. The path to the item to set. It may be a drive or provider-qualified path and may include glob characters. The new value to set the item to. The object(s) set at the specified path. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Sets the item at the specified path. The path(s) to the item(s) to set. They may be drive or provider-qualified paths and may include glob characters. The new value to set the item to. Passed on to providers to force operations. If true, globbing is not done on paths. The object(s) set at the specified path. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Sets the item at the specified path. The path to the item to set. It may be a drive or provider-qualified path and may include glob characters. The new value to set the item to. The context under which the command is running. Nothing. The object(s) set at the specified path are written to the context. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the dynamic parameters for the set-item cmdlet. The path to the item if it was specified on the command line. The new value of the item at the specified path. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Clears the item at the specified path. The path to the item to clear. It may be a drive or provider-qualified path and may include glob characters. The object(s) cleared at the specified path. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Clears the item at the specified path. The path(s) to the item to clear. It may be a drive or provider-qualified path and may include glob characters. Passed on to providers to force operations. If true, globbing is not done on paths. The object(s) cleared at the specified path. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Clears the item at the specified path. The path to the item to be cleared. It may be a drive or provider-qualified path and may include glob characters. The context under which the command is running. Nothing. The object(s) cleared at the specified path are written to the context. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the dynamic parameters for the clear-item cmdlet. The path to the item if it was specified on the command line. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Invokes the default action of the item at the specified path. The path to the item to invoke. It may be a drive or provider-qualified path and may include glob characters. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Invokes the default action of the item(s) at the specified path(s). The path(s) to the item(s) to invoke. They may be drive or provider-qualified paths and may include glob characters. If true, globbing is not done on paths. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Invokes the default action for the item at the specified path. The path to the item to be invoked. It may be a drive or provider-qualified path and may include glob characters. The context under which the command is running. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the dynamic parameters for the invoke-item cmdlet. The path to the item if it was specified on the command line. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Renames the item at the given path. The path to the item to rename. It may be a drive or provider-qualified path and may include glob characters. The new name of the item. The item(s) that were renamed. If or is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Renames the item at the given path. The path to the item to rename. It may be a drive or provider-qualified path and may include glob characters. The new name of the item. Passed on to providers to force operations. The item(s) that were renamed. If or is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Renames the item at the given path. The path to the item to rename. It may be a drive or provider-qualified path and may include glob characters. The new name of the item. The context under which the command is running. Nothing. The item(s) that get renamed are written to the context. If or is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the dynamic parameters for the rename-item cmdlet. The path to the item if it was specified on the command line. The new name of the item. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Creates a new item at the given path. The path to the container to create item in. It may be a drive or provider-qualified path and may include glob characters. The name of the new item to create. The type of the new item to create. The content of the new item to create. The item that was created. If or is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Creates a new item at the given path. The path(s) to the container to create item in. They may be drive or provider-qualified path and may include glob characters. The name of the new item to create. The type of the new item to create. The content of the new item to create. Passed on to providers to force operations. The item(s) that was created. If or is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Creates a new item at the given path. The path to the container to create item in. It may be a drive or provider-qualified path and may include glob characters. The name of the new item to create. The type of the new item to create. The content of the new item to create. The context under which the command is running. Nothing. The new item is written to the context. If or is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the dynamic parameters for the new-item cmdlet. The path to the item if it was specified on the command line. The type of the new item to create. The content of the new item to create. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Removes the items at the given path. The path to the item to remove. It may be a drive or provider-qualified path and may include glob characters. If true, removes all the children in all the sub-containers of the specified container. If false, only removes the immediate children of the specified container. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Removes the items at the given path. The path(s) to the item(s) to remove. They may be drive or provider-qualified paths and may include glob characters. If true, removes all the children in all the sub-containers of the specified container. If false, only removes the immediate children of the specified container. Passed on to providers to force operations. If true, globbing is not done on paths. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Removes the items at the given path. The path to the item to remove. It may be a drive or provider-qualified path and may include glob characters. If true, removes all the children in all the sub-containers of the specified container. If false, only removes the immediate children of the specified container. The context under which the command is running. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the dynamic parameters for the remove-item cmdlet. The path to the item if it was specified on the command line. If true, removes all the children in all the sub-containers of the specified container. If false, only removes the immediate children of the specified container. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Copy item at the specified path The path to the item to copy. It may be a drive or provider-qualified path and may include glob characters. The path to copy the item to. If true, copies all the children in all the sub-containers of the specified container. If false, only copies the specified item. Determines how the source container is used in the copy operation. The item(s) that were copied. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Copy item at the specified path The path(s) to the item(s) to copy. They may be a drive or provider-qualified path and may include glob characters. The path to copy the item to. If true, copies all the children in all the sub-containers of the specified container. If false, only copies the specified item. Determines how the source container is used in the copy operation. Passed on to providers to force operations. If true, globbing is not done on paths. The item(s) that were copied. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Copy item at the specified path The path to the item to copy. It may be a drive or provider-qualified path and may include glob characters. The path to copy the item to. If true, copies all the children in all the sub-containers of the specified container. If false, only copies the specified item. Determines how the source container is used in the copy operation. The context under which the command is running. Nothing. The item(s) that were copied are written to the context. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the dynamic parameters for the copy-item cmdlet. The path to the item if it was specified on the command line. The path to copy the item to. If true, copies all the children in all the sub-containers of the specified container. If false, only copies the specified item. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Moves the item at the specified path to the specified destination. The path to the item to move. The path to the location that the item will be moved. The item(s) that were moved. If is null. If resolves to multiple paths. or If and don't resolve to the same provider. or If resolves to multiple paths and is not a container. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Moves the item at the specified path to the specified destination. The path(s) to the item to move. The path to the location that the item will be moved. Passed on to providers to force operations. If true, globbing is not done on paths. The item(s) that were moved. If is null. If resolves to multiple paths. or If and don't resolve to the same provider. or If resolves to multiple paths and is not a container. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Moves the item at the specified path to the specified destination. The path to the item to move. The path to the location that the item will be moved. The context under which the command is running. Nothing. The object that is moved is written to the context. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the dynamic parameters for the move-item cmdlet. The path to the item if it was specified on the command line. The path to move the item to. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Determines if an item at the given path exits. The path to the item to determine if it exists. It may be a drive or provider-qualified path and may include glob characters. True if the item at the specified path exists. False otherwise. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Determines if an item at the given path exits. The path to the item to determine if it exists. It may be a drive or provider-qualified path and may include glob characters. Passed on to providers to force operations. If true, globbing is not done on paths. True if the item at the specified path exists. False otherwise. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Determines if an item at the given path exits. The path to the item to determine if it exists. It may be a drive or provider-qualified path and may include glob characters. The context under which the command is running. True if the item at the specified path exists. False otherwise. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the dynamic parameters for the test-path cmdlet. The path to the item if it was specified on the command line. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Determines if the specified path is to an item that is a container. The path to the item to determine if it is a container. True if the path is to an item that is a container. False otherwise. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Determines if the specified path is to an item that is a container. The path to the item to determine if it is a container. The context under which the command is running. True if the path is to an item that is a container. False otherwise. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Determines how the source container of a copy operation will be used. The source container is copied. The children of the source contianer are copied. Derives InternalCommand for Native Commands Implement the stop functionality for native commands... Various types of input/output supported by native commands. Most native commands only support text. Other formats are supported by minishell Different streams produced by minishell output Helper class which holds stream names and also provide conversion method An output object from the child process. If it's from the error stream isError will be true Stream to which data belongs Build an output object The data to output stream to which data belongs Get the data from this object The data Provides way to create and execute native commands. Information about application which is invoked by this instance of NativeCommandProcessor Initializes the new instance of NativeCommandProcessor class. The information about the application to run. The execution context for this command. or is null Variable which is set to true when prepare is called. Parameter Binder should only be created after Prepare method is called Parameter binder used by this command processor Gets a new instance of a ParameterBinderController using a NativeCommandParameterBinder The native command to be run. A new parameter binder controller for the specified command. Prepares the command for execution with the specified CommandParameterInternal. Executes the command. This method assumes that Prepare is already called. Process object for the invoked application This is used for writing input to the process This is used for reading input form the process Is true if this command is to be run "standalone" - that is, with no redirection. object used for synchronization between StopProcessing thread and Pipeline thread. Executes the native command once all of the input has been gathered. The pipeline is stopping The native command could not be run Utility routine to kill a process, discarding non-critial exceptions. This utility makes two passes at killing a process. In the first pass, if the process handle is invalid (as seems to be the case with an ntvdm) then we try to get a fresh handle based on the original process id. The process to kill Kills the process tree (process + associated child processes) Return true if the passed in process is a console process. Check if the passed in process is a windows application. This is set to true when StopProcessing is called Routine used to stop this processing on this node... Aggressively clean everything up... This method process the output Gets the start info for process This method calculates if input and output of the process are redirected Returns true if native command being invoked is mini-shell. If any of the argument supplied to native command is script block, we assume it is minishell. Gets the NativeCommand associated with this command processor. Gets or sets the name of the native command. Gets or sets path to the native command. Used by remote server to kill a process tree given a process id. Process class does not have ParentId property, so this wrapper uses WMI to get ParentId and wraps the original process. Helper class to handle writing input to a process. Creates an instance of ProcessInputWriter Input is collected in this list Add an object to write to process Stream to which input is written Format of input. Thread which writes the input Start writing input to process process to which input is written Stop writing input to process This method wait for writer thread to finish. Thread procedure for writing data to the child process... Formats the input objects using out-string. Output of out-string is given as input to native command processor. This method is to be called from the pipeline thread and not from the thread which writes input in to process. Count of object in inputlist This helper class reads the output from error and output streams of process. Process whose output is to be read. Path of the process application Process whose output is read Reader for output stream of process Reader for error stream of process Synchronized object queue in which object read form output and error streams are deposited Start reading the output/error. Note all the work is done asynchronously. Stops reading from streams. This is called from NativeCommandProcessor's StopProcessing method. Note return of this method doesn't mean reading has stopped and all threads are done. Use Done to ensure that all reading threads are finished. This method returns when all output reader threads have returned Return one object which was read from the process. AutomationNull.Value if no more objects. object of type ProcessOutputObject otherwise object used for synchronizing ReaderDone call between two readers Count of readers - this is set by Start. If both output and error are redirected, it will be 2. If only one is redirected, it'll be 1. This method is called by output or error reader when they are done reading. When it is called two times, we close the writer. This class reads the string from output or error streams of process and processes them appropriately. This class is not thread safe. It is assumed that NativeCommnadProcessor class will synchronize access to this class between different threads. Stream from which data is read. Flag which tells if streamReader is for stdout or stderr stream of process Writer to which data read from stream are written Path to the process. This is used for setting the name of the thread. ProcessReader which owns this stream reader Creates an instance of ProcessStreamReader Stream from which data is read Path to the process. This is used for setting the name of the thread. if true stream is output stream of process else stream is error stream. Processed data is written to it ProcessOutputReader which owns this stream reader Thread on which reading happens Launches a new thread to start reading. This method returns when reader thread has returned. Thread proc for reading Adds one object to writer This class provides helper methods for converting to/fro from string to base64string Converts string to base64 encoded string string to encode base64 encoded string Decodes base64 encoded string base64 string to decode decoded string Decodes base64 encoded string in to args array Static class that allows you to show and hide the console window associated with this process. Method to get all the process associated with the current console. Code to control the display properties of the a window... The window to show... The command to do true it it was successful Code to allocate a console... true if a console was created... Called to save the foreground window before allocating a hidden console window A handle to the foreground window Called to restore the foreground window after allocating a hidden console window A handle to the window that should be activated and brought to the foreground. true if the window was brought to the foreground If no console window is attached to this process, then allocate one, hide it and return true. If there's already a console window attached, then just return false. If there is a console attached, then make it visible and allow interactive console applications to be run. If there is a console attached, then hide it and always capture output from the child process. If set to true, then native commands will always be run redirected... Exception used to wrap the error coming from remote instance of Msh. This remote instance of Msh can be in a separate process, appdomain or machine. RuntimeException is the base class for exceptions likely to occur while a Monad command is running. Monad scripts can trap RuntimeException using the "trap (exceptionclass) {handler}" script construct. Instances of this exception class are usually generated by the Monad Engine. It is unusual for code outside the Monad Engine to create an instance of this class. Initializes a new instance of the RuntimeException class. constructed object Initializes a new instance of the RuntimeException class using data serialized via serialization information streaming context constructed object Serializer for serialization information streaming context Initializes a new instance of the RuntimeException class. constructed object Initializes a new instance of the RuntimeException class. constructed object Initializes a new instance of the RuntimeException class starting with an already populated error record. constructed object Subclasses can use this method to set the ErrorId. Note that this will clear the cached ErrorRecord, so be sure to change this before writing to ErrorRecord.ErrorDetails or the like. per ErrorRecord constructors Subclasses can use this method to set the ErrorCategory. Note that this will clear the cached ErrorRecord, so be sure to change this before writing to ErrorRecord.ErrorDetails or the like. per ErrorRecord.CategoryInfo.Category Subclasses can use this method to set or update the TargetObject. This convenience function doesn't clobber the error record if it already exists... per ErrorRecord.TargetObject This locks down the StackTrace parameter. Call this before rethrowing an exception which is potentially a RuntimeException. Additional information about the error Note that ErrorRecord.Exception is . Same as fix for BUG: Windows Out Of Band Releases: 906263 and 906264 The interpreter prompt CommandBaseStrings:InquireHalt should be suppressed when this flag is set. This will be set when this prompt has already occurred and Break was chosen, or for ActionPreferenceStopException in all cases. Initializes a new instance of RemoteException Initializes a new instance of RemoteException with a specified error message. The message that describes the error. Initializes a new instance of the RemoteException class with a specified error message and a reference to the inner exception that is the cause of this exception. The message that describes the error. The exception that is the cause of the current exception. Initializes a new instance of the RemoteException with a specified error message, serialzed Exception and serialized InvocationInfo The message that describes the error. serialized exception from remote msh serialized invocation info from remote msh Initializes a new instance of the class with serialized data. The that holds the serialized object data about the exception being thrown. The that contains contextual information about the source or destination. Sets the remote error record associated with this exception Original Serialized Exception from remote msh This is the exception which was thrown in remote. InvocationInfo, if any, associated with the SerializedRemoteException. This is the serialized InvocationInfo from the remote msh. ErrorRecord associated with the exception Exposes the path manipulation and location APIs to the Cmdlet base class. Hide the default constructor since we always require an instance of SessionState Internal constructor for the PathIntrinsics facade. The session for which this is a facade. This is only public for testing purposes. If is null. Gets the current location for a specific provider The name of the provider to get the current location for. If is null. If refers to a provider that does not exist. If a current drive cannot be found for the provider Changes the current location to the specified path. The path to change the location to. This can be either a drive-relative or provider-relative path. It cannot be a provider-internal path. The path of the new current location. If is null. If does not exist, is not a container, or resolved to multiple containers. If refers to a provider that does not exist. If refers to a drive that does not exist. If the provider associated with threw an exception. Changes the current location to the specified path. The path to change the location to. This can be either a drive-relative or provider-relative path. It cannot be a provider-internal path. The context under which the command is running. The path of the new current location. If is null. If does not exist, is not a container, or resolved to multiple containers. If refers to a provider that does not exist. If refers to a drive that does not exist. If the provider associated with threw an exception. Determines if the specified path is the current location or a parent of the current location. A drive or provider-qualified path to be compared against the current location. The context under which the command is running. True if the path is the current location or a parent of the current location. False otherwise. If is null. If the path is a provider-qualified path for a provider that is not loaded into the system. If the refers to a drive that could not be found. If the provider used to build the path threw an exception. If the provider that the represents is not a NavigationCmdletProvider or ContainerCmdletProvider. If the starts with "~" and the home location is not set for the provider. If the provider specified by threw an exception when its GetParentPath or MakePath was called while processing the . Pushes the current location onto the location stack so that it can be retrieved later. The ID of the stack to push the location onto. Gets the location off the top of the location stack. The ID of the stack to pop the location from. If stackName is null or empty the default stack is used. The path information for the location that was on the top of the location stack. If the path on the stack does not exist, is not a container, or resolved to multiple containers. or If contains wildcard characters and resolves to multiple location stacks. or A stack was not found with the specified name. If the path on the stack refers to a provider that does not exist. If the path on the stack refers to a drive that does not exist. If the provider associated with the path on the stack threw an exception. Gets the location stack and all the locations on it. The stack ID of the stack to get the stack info for. Sets the default location stack to that specified by the stack ID. The stack ID of the stack to use as the default location stack. If does not exist as a location stack. Resolves a drive or provider qualified absolute or relative path that may contain wildcard characters into one or more absolute drive or provider qualified paths. The drive or provider qualified path to be resolved. This path may contain wildcard characters which will get resolved. An array of Msh paths that resolved from the given path. If is null. If is a provider-qualified path and the specified provider does not exist. If is a drive-qualified path and the specified drive does not exist. If the provider throws an exception when its MakePath gets called. If the provider does not support multiple items. If the home location for the provider is not set and starts with a "~". If does not contain wildcard characters and could not be found. Resolves a drive or provider qualified absolute or relative path that may contain wildcard characters into one or more absolute drive or provider qualified paths. The drive or provider qualified path to be resolved. This path may contain wildcard characters which will get resolved. The context under which the command is running. An array of Msh paths that resolved from the given path. If or is null. If is a provider-qualified path and the specified provider does not exist. If the provider throws an exception when its MakePath gets called. If the provider does not support multiple items. If the home location for the provider is not set and starts with a "~". If does not contain wildcard characters and could not be found. Resolves a drive or provider qualified absolute or relative path that may contain wildcard characters into one or more provider-internal paths. The drive or provider qualified path to be resolved. This path may contain wildcard characters which will get resolved. The provider for which the returned paths should be used. An array of provider-internal paths that resolved from the given path. If is null. If the path is a provider-qualified path for a provider that is not loaded into the system. If the refers to a drive that could not be found. If the provider used to build the path threw an exception. If the provider that the represents is not a NavigationCmdletProvider or ContainerCmdletProvider. If the starts with "~" and the home location is not set for the provider. If the provider associated with the threw an exception when building its path. If does not contain wildcard characters and could not be found. Resolves a drive or provider qualified absolute or relative path that may contain wildcard characters into one or more provider-internal paths. The drive or provider qualified path to be resolved. This path may contain wildcard characters which will get resolved. The context under which the command is running. The provider for which the returned paths should be used. An array of provider-internal paths that resolved from the given path. If or is null. If the path is a provider-qualified path for a provider that is not loaded into the system. If the refers to a drive that could not be found. If the provider used to build the path threw an exception. If the provider that the represents is not a NavigationCmdletProvider or ContainerCmdletProvider. If the starts with "~" and the home location is not set for the provider. If the provider associated with the threw an exception when its GetParentPath or MakePath was called while processing the . If does not contain wildcard characters and could not be found. Resolves a drive or provider qualified absolute or relative path that may contain wildcard characters into one or more provider-internal paths. The drive or provider qualified path to be resolved. This path may contain wildcard characters which will get resolved. The provider for which the returned paths should be used. An array of provider-internal paths that resolved from the given path. If is null. If references a provider that does not exist. If the references a provider that is not a ContainerCmdletProvider. If the provider used to build the path threw an exception. If the starts with "~" and the home location is not set for the provider. If does not contain wildcard characters and could not be found. Resolves a drive or provider qualified absolute or relative path that may contain wildcard characters into one or more provider-internal paths. The drive or provider qualified path to be resolved. This path may contain wildcard characters which will get resolved. The context under which the command is running. The provider for which the returned paths should be used. An array of provider-internal paths that resolved from the given path. If , , or is null. If references a provider that does not exist. If the references a provider that is not a ContainerCmdletProvider. If the provider used to build the path threw an exception. If the starts with "~" and the home location is not set for the provider. If does not contain wildcard characters and could not be found. Converts a drive or provider qualified absolute or relative path that may contain wildcard characters into one a provider-internal path still containing the wildcard characters. The drive or provider qualified path to be converted. This path may contain wildcard characters which will not get resolved. A provider-internal path that does not have the wildcard characters resolved. If is null. If the path is a provider-qualified path for a provider that is not loaded into the system. If the refers to a drive that could not be found. If the provider used to build the path threw an exception. If the provider that the represents is not a NavigationCmdletProvider or ContainerCmdletProvider. If the starts with "~" and the home location is not set for the provider. If the provider specified by threw an exception. Converts a drive or provider qualified absolute or relative path that may contain wildcard characters into one a provider-internal path still containing the wildcard characters. The drive or provider qualified path to be converted. This path may contain wildcard characters which will not get resolved. The information for the provider for which the returned path should be used. The drive of the Msh path that was used to convert the path. Note, this may be null if the was a provider-qualified path. A provider-internal path that does not have the wildcard characters resolved. If or is null. If the path is a provider-qualified path for a provider that is not loaded into the system. If the refers to a drive that could not be found. If the provider used to build the path threw an exception. If the provider that the represents is not a NavigationCmdletProvider or ContainerCmdletProvider. If the starts with "~" and the home location is not set for the provider. If the provider specified by threw an exception when its GetParentPath or MakePath was called while processing the . Converts a drive or provider qualified absolute or relative path that may contain wildcard characters into one a provider-internal path still containing the wildcard characters. The drive or provider qualified path to be converted. This path may contain wildcard characters which will not get resolved. The context under which this command is running. The information for the provider for which the returned path should be used. The drive of the Msh path that was used to convert the path. A provider-internal path that does not have the wildcard characters resolved. If or is null. If the path is a provider-qualified path for a provider that is not loaded into the system. If the refers to a drive that could not be found. If the provider used to build the path threw an exception. If the provider that the represents is not a NavigationCmdletProvider or ContainerCmdletProvider. If the starts with "~" and the home location is not set for the provider. If the provider specified by threw an exception when its GetParentPath or MakePath was called while processing the . Determines if the give path is an Msh provider-qualified path. The path to check. True if the specified path is provider-qualified, false otherwise. A provider-qualified path is a path in the following form: providerId::provider-internal-path If is null. Determines if the given path is a drive-qualified absolute path. The path to check. If the path is an Msh absolute path then the returned value is the name of the drive that the path is absolute to. True if the specified path is an Msh absolute drive-qualified path. False otherwise. A path is an absolute drive-qualified path if it has the following form: drive-name:drive-relative-path If is null. Combines two strings with a provider specific path separator. The parent path to be joined with the child. The child path to be joined with the parent. The combined path of the parent and child with the provider specific path separator between them. If is null. If both and is null. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Combines two strings with a provider specific path separator. The parent path to be joined with the child. The child path to be joined with the parent. The context under which this command is running. The combined path of the parent and child with the provider specific path separator between them. If is null. If both and is null. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Gets the parent path of the specified path. The path to get the parent path from. If the root is specified the path returned will not be any higher than the root. The parent path of the specified path. If is null. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Gets the parent path of the specified path. The path to get the parent path from. If the root is specified the path returned will not be any higher than the root. The context under which the command is running. The parent path of the specified path. If is null. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Gets the parent path of the specified path. Allow to use FileSystem as the default provider when the given path is drive-qualified and the drive cannot be found. The path to get the parent path from. If the root is specified the path returned will not be any higher than the root. The context under which the command is running. to use default provider when needed. The parent path of the specified path. If is null. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Gets the child name of the specified path. The path to get the child name from. The last element of the path. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the child name of the specified path. The path to get the child name from. The context under which the command is running. The last element of the path. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the child name of the specified path. Allow to use FileSystem as the default provider when the given path is drive-qualified and the drive cannot be found. The path to get the child name from. The context under which the command is running. to use default provider when needed. The last element of the path. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Normalizes the path that was passed in and returns the normalized path as a relative path to the basePath that was passed. An MSH path to an item. The item should exist or the provider should write out an error. The path that the return value should be relative to. A normalized path that is relative to the basePath that was passed. If is null. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Normalizes the path that was passed in and returns the normalized path as a relative path to the basePath that was passed. An MSH path to an item. The item should exist or the provider should write out an error. The path that the return value should be relative to. The context under which the command is running. A normalized path that is relative to the basePath that was passed. If is null. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Determines if the MSH path is a syntactically and semantically valid path for the provider. The path to validate. true if the object specified by path is syntactically and semantically valid, false otherwise. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Determines if the MSH path is a syntactically and semantically valid path for the provider. The path to validate. The context under which the call is being made. true if the object specified by path is syntactically and semantically valid, false otherwise. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the current location. If a location has not been set yet. Gets the current location for the file system provider If a current drive cannot be found for the FileSystem provider Defines a data structure used to represent the status of an ongoing operation at a point in time. ProgressRecords are passed to , which, according to user preference, forwards that information on to the host for rendering to the user. Initializes a new instance of the ProgressRecord class and defines the activity Id, activity description, and status description. A unique numeric key that identifies the activity to which this record applies. A description of the activity for which progress is being reported. A description of the status of the activity. Cloning constructor (all fields are value types - can treat our implementation of cloning as "deep" copy) Overrides "parent = a id = b act = c stat = d cur = e pct = f sec = g type = h" where a, b, c, d, e, f, and g are the values of ParentActivityId, ActivityId, Activity, StatusDescription, CurrentOperation, PercentComplete, SecondsRemaining and RecordType properties. Returns percentage complete when it is impossible to predict how long an operation might take. The percentage complete will slowly converge toward 100%. At the the percentage complete will be 90%. When did the operation start How long does the operation usually take Estimated percentage complete of the operation (always between 0 and 99% - never returns 100%) Thrown when 1) is in the future 2) is negative or zero Creates a ProgressRecord object from a PSObject property bag. PSObject has to be in the format returned by ToPSObjectForRemoting method. PSObject to rehydrate ProgressRecord rehydrated from a PSObject property bag Thrown if the PSObject is null. Thrown when the PSObject is not in the expected format Returns this object as a PSObject property bag that can be used in a remoting protocol data object. This object as a PSObject property bag Gets the Id of the activity to which this record corresponds. Used as a 'key' for the linking of subordinate activities. Gets and sets the Id of the activity for which this record is a subordinate. Used to allow chaining of progress records (such as when one installation invokes a child installation). UI: normally not directly visible except as already displayed as its own activity. Usually a sub-activity will be positioned below and to the right of its parent. A negative value (the default) indicates that the activity is not a subordinate. May not be the same as ActivityId. Gets and sets the description of the activity for which progress is being reported. States the overall intent of whats being accomplished, such as "Recursively removing item c:\temp." Typically displayed in conjunction with a progress bar. Gets and sets the current status of the operation, e.g., "35 of 50 items Copied." or "95% completed." or "100 files purged." Gets and sets the current operation of the many required to accomplish the activity (such as "copying foo.txt"). Normally displayed below its associated progress bar, e.g., "deleting file foo.bar" Set to null or empty in the case a sub-activity will be used to show the current operation. Gets and sets the estimate of the percentage of total work for the activity that is completed. Typically displayed as a progress bar. Set to a negative value to indicate that the percentage completed should not be displayed. Gets and sets the estimate of time remaining until this activity is completed. This can be based upon a measurement of time since started and the percent complete or another approach deemed appropriate by the caller. Normally displayed beside the progress bar, as "N seconds remaining." A value less than 0 means "don't display a time remaining." Gets and sets the type of record represented by this instance. Defines two types of progress record that refer to the beginning (or middle) and end of an operation. Operation just started or is not yet complete A cmdlet can call WriteProgress with ProgressRecordType.Processing as many times as it wishes. However, at the end of the operation, it should call once more with ProgressRecordType.Completed. The first time that a host receives a progress record for a given activity, it will typically display a progress indicator for that activity. For each subsequent record of the same Id, the host will update that display. Finally, when the host receives a 'completed' record for that activity, it will remove the progress indicator. Operation is complete If a cmdlet uses WriteProgress, it should use ProgressRecordType.Completed exactly once, in the last call to WriteProgress. Exposes the Property noun of the Cmdlet Providers to the Cmdlet base class. The methods of this class use the providers to perform operations. Hide the default constructor since we always require an instance of SessionState Constructs a facade over the "real" session state API An instance of the cmdlet. If is null. Constructs a facade over the "real" session state API An instance of the "real" session state. If is null. Gets the specified properties from the specified item(s) The path to the item to get the properties from. The properties to get from the item(s). If this is empty, null, or "*" all properties should be returned. A PSObject for each item that the path represents. Each PSObject should contain a property for those in the providerSpecificPickList. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the specified properties from the specified item(s) The path(s) to the item(s) to get the properties from. If true, globbing is not done on paths. The properties to get from the item(s). If this is empty, null, or "*" all properties should be returned. A PSObject for each item that the path represents. Each PSObject should contain a property for those in the providerSpecificPickList. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the specified properties from the specified item(s) The path to the item to get the properties from. The properties to get from the item(s). If this is empty, null, or "*" all properties should be returned. The context under which the command is running. Nothing. A PSObject for each item that the path represents is written to the context. Each PSObject should contain a property for those in the providerSpecificPickList. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the dynamic parameters for the get-itemproperty cmdlet. The path to the item if it was specified on the command line. The properties to get from the item(s). If this is empty, null, or "*" all properties should be returned. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Sets the specified properties on the specified item(s) The path to the item to set the properties on. The properties that are to be set on the item A PSObject for each item that had the property set on it. If or is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Sets the specified properties on the specified item(s) The path(s) to the item(s) to set the properties on. The properties that are to be set on the item Passed on to providers to force operations. If true, globbing is not done on paths. A PSObject for each item that had the property set on it. If or is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Sets the specified properties on the specified item(s) The path to the item to set the properties on. The properties that are to be set on the item The context under which the command is running. Nothing. A PSObject for the property that was set is written to the context. If or is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the dynamic parameters for the set-itemproperty cmdlet. The path to the item if it was specified on the command line. The properties that are to be set on the item The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Clear the specified properties from the specified item(s) The path to the item to clear the properties from. The properties to clear from the item(s). If or is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Clear the specified properties from the specified item(s) The path(s) to the item(s) to clear the properties from. The properties to clear from the item(s). Passed on to providers to force operations. If true, globbing is not done on paths. If or is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Clears the specified properties from the specified item(s) The path to the item to clear the properties from. The properties to clear from the item(s). The context under which the command is running. If or is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the dynamic parameters for the clear-itemproperty cmdlet. The path to the item if it was specified on the command line. The properties to clear from the item(s). The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Creates a new property on the specified item The path to the item on which the new property should be created. The name of the property that should be created. The type of the property that should be created. The new value of the property that should be created. A PSObject for each item that the property was created on. The PSObject contains the properties that were created. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Creates a new property on the specified item The path(s) to the item(s0 on which the new property should be created. The name of the property that should be created. The type of the property that should be created. The new value of the property that should be created. Passed on to providers to force operations. If true, globbing is not done on paths. A PSObject for each item that the property was created on. The PSObject contains the properties that were created. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Creates a new property on the specified item The path to the item on which the new property should be created. The name of the property that should be created. The type of the property that should be created. The new value of the property that should be created. The context under which the command is running. Nothing. A PSObject for each item that the property was created on is written to the context. Each PSObject contains the properties that were created. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the dynamic parameters for the new-itemproperty cmdlet. The path to the item if it was specified on the command line. The name of the property that should be created. The type of the property that should be created. The new value of the property that should be created. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Removes a property from the specified item(s) The path to the item(s) on which the property should be removed. The property name that should be removed. If or is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Removes a property from the specified item(s) The path(s) to the item(s) on which the property should be removed. The property name that should be removed. Passed on to providers to force operations. If true, globbing is not done on paths. If or is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Removes a property from the specified item(s) The path to the item(s) on which the property should be removed. The property name that should be removed. The context under which the command is running. If or is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the dynamic parameters for the remove-itemproperty cmdlet. The path to the item if it was specified on the command line. The name of the property that should be removed. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Renames a property on the specified item(s) The path to the item(s) on which the property should be renamed. The source name of the property to be renamed. The new name of the property. A PSObject for each item that is the new property after the rename. If , , or is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Renames a property on the specified item(s) The path(s) to the item(s) on which the property should be renamed. The source name of the property to be renamed. The new name of the property. Passed on to providers to force operations. If true, globbing is not done on paths. A PSObject for each item that is the new property after the rename. If , , or is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Renames a property on the specified item(s) The path to the item(s) on which the property should be renamed. The source name of the property to be renamed. The new name of the property. The context under which the command is running. Nothing. A PSObject for each item that the property is renamed on is written to the context. The Shellobject contains the new property after the rename. If , , or is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the dynamic parameters for the rename-itemproperty cmdlet. The path to the item if it was specified on the command line. The source name of the property to be renamed. The new name of the property. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Copies a property on the specified item(s) The path to the item(s) on which the property should be copied. The source name of the property to be copied. The path to the item(s) to copy the property to. It can be the same as the sourcePath as long as the destinationProperty is different. The new name of the property. A PSObject for each item that is the new property after the copy. If , , , or is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Copies a property on the specified item(s) The path(s) to the item(s) on which the property should be copied. The source name of the property to be copied. The path to the item(s) to copy the property to. It can be the same as the sourcePath as long as the destinationProperty is different. The new name of the property. Passed on to providers to force operations. If true, globbing is not done on paths. A PSObject for each item that is the new property after the copy. If , , , or is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Copies a property on the specified item(s) The path to the item(s) on which the property should be copied. The source name of the property to be copied. The path to the item(s) to copy the property to. It can be the same as the sourcePath as long as the destinationProperty is different. The new name of the property. The context under which the command is running. Nothing. A PSObject for each item that the new property was copied to is written to the context. If , , , or is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the dynamic parameters for the copy-itemproperty cmdlet. The path to the item if it was specified on the command line. The source name of the property to be copied. The path to the item(s) to copy the property to. It can be the same as the sourcePath as long as the destinationProperty is different. The new name of the property. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Moves a property on the specified item(s) The path to the item(s) on which the property should be moved. The source name of the property to be moved. The path to the item(s) to move the property to. It can be the same as the sourcePath as long as the destinationProperty is different. The new name of the property. A PSObject for each item that is the new property after the move. If , , , or is null. If resolves to more than one item. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Moves a property on the specified item(s) The path(s) to the item(s) on which the property should be moved. The source name of the property to be moved. The path to the item(s) to move the property to. It can be the same as the sourcePath as long as the destinationProperty is different. The new name of the property. Passed on to providers to force operations. If true, globbing is not done on paths. A PSObject for each item that is the new property after the move. If , , , or is null. If resolves to more than one item. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Moves a property on the specified item(s) The path to the item(s) on which the property should be moved. The source name of the property to be moved. The path to the item(s) to move the property to. It can be the same as the sourcePath as long as the destinationProperty is different. The new name of the property. The context under which the command is running. Nothing. A PSObject for each item that the property was moved to is written to the context. If , , , or is null. If resolves to more than one item. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the dynamic parameters for the copy-itemproperty cmdlet. The path to the item if it was specified on the command line. The source name of the property to be moved. The path to the item(s) to move the property to. It can be the same as the sourcePath as long as the destinationProperty is different. The new name of the property. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If does not contain glob characters and could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Exposes the APIs to manage the Cmdlet Providers the Cmdlet base class. The methods of this class get and set provider data in session state. Hide the default constructor since we always require an instance of SessionState The facade for managing providers The session to which this is a facade. If is null. Gets the specified provider(s). Either the fully-qualified or friendly name for the provider. The provider information for the specified provider. If is null or empty. If the provider specified by is not currently loaded. Gets the specified provider(s). Either the fully-qualified or friendly name for the provider. The provider information for the specified provider. If is null or empty. If is not PSSnapin-qualified and more than one provider exists with the specified name. If the provider specified by is not currently loaded. Gets all the Cmdlet Providers that are loaded. Determines if the specified provider has the specified capability The capability to check the provider for. The provider information to use for the check. True, if the provider has the capability, false otherwise. Gets the count of the number of providers that are loaded A ProxyCommand class used to represent a Command constructed Dynamically Private Constructor to restrict inheritance This method constructs a string representing the command specified by . The returned string is a ScriptBlock which can be used to configure a Cmdlet/Function in a Runspace. An instance of CommandMetadata representing a command. A string representing Command ScriptBlock. commandMetadata is null. This method constructs a string representing the command specified by . The returned string is a ScriptBlock which can be used to configure a Cmdlet/Function in a Runspace. An instance of CommandMetadata representing a command. The string to be used as the help comment. A string representing Command ScriptBlock. commandMetadata is null. This method constructs a string representing the CmdletBinding attribute of the command specified by . An instance of CommandMetadata representing a command. A string representing the CmdletBinding attribute of the command. commandMetadata is null. This method constructs a string representing the param block of the command specified by . The returned string only contains the parameters, it is not enclosed in "param()". An instance of CommandMetadata representing a command. A string representing the parameters of the command. commandMetadata is null. This method constructs a string representing the begin block of the command specified by . The returned string only contains the script, it is not enclosed in "begin { }". An instance of CommandMetadata representing a command. A string representing the begin block of the command. commandMetadata is null. This method constructs a string representing the process block of the command specified by . The returned string only contains the script, it is not enclosed in "process { }". An instance of CommandMetadata representing a command. A string representing the process block of the command. commandMetadata is null. This method constructs a string representing the end block of the command specified by . The returned string only contains the script, it is not enclosed in "end { }". An instance of CommandMetadata representing a command. A string representing the end block of the command. commandMetadata is null. Construct the text that can be used in a multi-line comment for get-help. A custom PSObject created by Get-Help. A string that can be used as the help comment for script for the input HelpInfo object. When the help argument is null. When the help argument is not recognized as a HelpInfo object. Exposes the APIs to manipulate the providers, Runspace data, and location to the Cmdlet base class. The internal constructor for this object. It should be the only one that gets called. An instance of SessionState that the APIs should work against. If is null. The internal constructor for this object. It should be the only one that gets called. An instance of ExecutionContext whose EngineSessionState represents the parent session state. True if the session state should be created as a child session state. True if the session state should be linked to the global scope. If is null. Construct a new session state object... Utility to check the visiblity of an object based on the current command origin. If the object implements IHasSessionStateEntryVisibility then the check will be made. If the check fails, then an exception will be thrown... The command origin value to check against... The object to check Checks the visibility of an object based on the command origin argument. The origin to check against The object to check Returns true if the object is visible, false otherwise Checks the visibility of an object based on the command origin argument. The origin to check against The variable to check Returns true if the object is visible, false otherwise Checks the visibility of an object based on the command origin argument. The origin to check against The command to check Returns true if the object is visible, false otherwise Gets the APIs to access drives Gets the APIs to access providers Gets the APIs to access paths and location Gets the APIs to access variables in session state. Get/set constraints for this execution environemnt If true the PowerShell debugger will use FullLanguage mode, otherwise it will use the current language mode Public proxy for the list of scripts that are allowed to be run. If the name "*" is in the list, then all scripts can be run. (This is the default.) Public proxy for the list of appications that are allowed to be run. If the name "*" is in the list, then all applications can be run. (This is the default.) The module associated with this session state instance... The provider intrinsics for this session state instance. The command invocation intrinsics for this session state instance. Gets a reference to the "real" session state object instead of the facade This enum defines the visiblity of execution environment elements... Entries are visible to requests from outside the runspace Entries are not visible to requests from outside the runspace This enum defines what subset of the PowerShell language is permitted when calling into this execution environment. All PowerShell langugage elements are available A subset of language elements are available to external requests Commands containing script text to evaluate are not allowed. You can only call commands using the Runspace APIs when in this mode. Exposes a subset of the PowerShell language that limits itself to core PowerShell types, does not support method invocation (except on those types), and does not support property setters (except on those types). Derives InternalCommand for ScriptCommand. A common base class for code shared between an interpreted (old) script block and a compiled (new) script block. When executing a scriptblock, the command origin needs to be set for the current scope. If this true, then the scope origin will be set to the command origin. If it's false, then the scope origin will be set to Internal. This allows public functions to call private functions but still see $MyInvocation.CommandOrigin as $true. If true, then an exit exception will be rethrown to instead of caught and processed... This indicates whether exit is called during the execution of script block. Exit command can be executed in any of begin/process/end blocks. If exit is called in one block (for example, begin), any subsequent blocks (for example, process and end) should not be executed. Helper function for setting up command object and commandRuntime object for script command processor. Checks if user has requested help (for example passing "-?" parameter for a cmdlet) and if yes, then returns the help target to display. help target to request help category to request true if user requested help; false otherwise This class implements a command processor for script related commands. 1. Usage scenarios ScriptCommandProcessor is used for four kinds of commands. a. Functions and filters For example, function foo($a) {$a} foo "my text" Second command is an example of a function invocation. In this case, a FunctionInfo object is provided while constructing command processor. b. Script File For example, . .\my.ps1 In this case, a ExternalScriptInfo or ScriptInfo object is provided while constructing command processor. c. ScriptBlock For example, . {$a = 5} In this case, a ScriptBlock object is provided while constructing command processor. d. Script Text This is used internally for directly running a text stream of script. 2. Design a. Script block No matter how a script command processor is created, core piece of information is always a ScriptBlock object, which can come from either a FunctionInfo object, a ScriptInfo object, or directly parsed from script text. b. Script scope A script block can be executed either in current scope or in a new scope. New scope created should be a scope supporting $script: in case the command processor is created from a script file. c. Begin/Process/End blocks Each script block can have one block of script for begin/process/end. These map to BeginProcessing, ProcessingRecord, and EndProcessing of cmdlet api. d. ExitException handling If the command processor is created based on a script file, its exit exception handling is different in the sense that it indicates an exitcode instead of killing current powershell session. Execute BeginProcessing part of command. It sets up the overall scope object for this command and runs the begin clause of the script block if it isn't empty. a terminating error occurred, or the pipeline was otherwise stopped The parameters for the paging support enabled by . Includes: -IncludeTotalCount, -Skip [int], -First [int] A helper method for creating an object that represents a total count of objects that the cmdlet would return without paging (this can be more than the size of the page specified in the cmdlet parameter). a total count of objects that the cmdlet would return without paging accuracy of the parameter. 1.0 means 100% accurate; 0.0 means that total count is unknown; anything in-between means that total count is estimated An object that represents a total count of objects that the cmdlet would return without paging Gets or sets the value of the -IncludeTotalCount parameter for all cmdlets that support paging. Gets or sets the value of the -Skip parameter for all cmdlets that support paging. If the user doesn't specify anything, the default is 0. Gets or sets the value of the -First parameter for all cmdlets that support paging. If the user doesn't specify anything, the default is . The declaration of parameters for the ShouldProcess mechanisms. -Whatif, and -Confirm. Constructs an instance with the specified command instance The instance of the command that the parameters should set the user feedback properties on when the parameters get bound. Gets or sets the value of the -Whatif parameter for all cmdlets. Gets or sets the value of the -Confirm parameter for all cmdlets. The declaration of parameters for the Transactions mechanisms. -UseTransaction, and -BypassTransaction. Constructs an instance with the specified command instance The instance of the command that the parameters should set the user feedback properties on when the parameters get bound. Gets or sets the value of the -UseTransaction parameter for all cmdlets. Exposes the APIs to manipulate variables in the Runspace. Hide the default constructor since we always require an instance of SessionState Constructs a facade for the specified session. The session for which the facade wraps. If is null. Gets the specified variable from session state. The name of the variable to get. The name can contain drive and/or scope specifiers like "ENV:path" or "global:myvar". The specified variable. If is null. Gets the specified variable from session state in the specified scope. If the variable doesn't exist in the specified scope no additional lookup will be done. The name of the variable to get. The name can contain drive and/or scope specifiers like "ENV:path" or "global:myvar". The ID of the scope to do the lookup in. The specified variable. If is null. If is less than zero, or not a number and not "script", "global", "local", or "private" If is less than zero or greater than the number of currently active scopes. Gets the specified variable value from session state. The name of the variable to get. The name can contain drive and/or scope specifiers like "ENV:path" or "global:myvar". The value of the specified variable. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the specified variable from session state. If the variable is not found the default value is returned. The name of the variable to get. The name can contain drive and/or scope specifiers like "ENV:path" or "global:myvar". The default value returned if the variable could not be found. The value of the specified variable or the default value if the variable is not found. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the specified variable from session state in the specified scope. If the variable doesn't exist in the specified scope no additional lookup will be done. The name of the variable to get. The name can contain drive and/or scope specifiers like "ENV:path" or "global:myvar". The ID of the scope to do the lookup in. The value of the specified variable. If is null. If is less than zero, or not a number and not "script", "global", "local", or "private" If is less than zero or greater than the number of currently active scopes. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Sets the variable to the specified value. The name of the variable to be set. The name can contain drive and/or scope specifiers like "ENV:path" or "global:myvar". The value to set the variable to. If is null. If the variable is read-only or constant. If the maximum number of variables has been reached for this scope. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Sets the variable. The variable to set If is null. If the variable is read-only or constant. If the maximum number of variables has been reached for this scope. Removes the specified variable from session state. The name of the variable to be removed. The name can contain drive and/or scope specifiers like "ENV:path" or "global:myvar". If is null. if the variable is constant. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Removes the specified variable from session state. The variable to be removed. It is removed based on the name of the variable. If is null. if the variable is constant. Removes the specified variable from the specified scope The name of the variable to remove. The ID of the scope to do the lookup in. The ID is a zero based index of the scope tree with the current scope being zero, its parent scope being 1 and so on. If is null. If is less than zero or greater than the number of currently active scopes. if the variable is constant. If refers to an MSH path (not a variable) and the provider throws an exception. Removes the specified variable from the specified scope The variable to be removed. It is removed based on the name of the variable. The ID of the scope to do the lookup in. The ID is a zero based index of the scope tree with the current scope being zero, its parent scope being 1 and so on. If is null. If is less than zero or greater than the number of currently active scopes. if the variable is constant. This interface defines the set of functionality that must be implemented to directly execute an instance of a Cmdlet. When a cmdlet is instantiated and run directly, all calls to the stream APIs will be proxied through to an instance of this class. For example, when a cmdlet calls WriteObject, the WriteObject implementation on the instance of the class implementing this interface will be called. The Monad implementation provides a default implementation of this class for use with standalone cmdlets as well as the implementation provided for running in the monad engine itself. If you do want to run Cmdlet instances standalone and capture their output with more fidelity than is provided for with the default implementation, then you should create your own implementation of this class and pass it to cmdlets before calling the Cmdlet Invoke() or Execute() methods. Display debug information debug output This API is called by the cmdlet to display debug information on the inner workings of the Cmdlet. An implementation of this interface should display this information in an appropriately distinctive manner (e.g. through a different color or in a separate status window. In simple implementations, just ignoring the text and returning is sufficient. Internal variant: Writes the specified error to the error pipe. Do not call WriteError(e.ErrorRecord). The ErrorRecord contained in the ErrorRecord property of an exception which implements IContainsErrorRecord should not be passed directly to WriteError, since it contains a rather than the real exception. error Called to write objects to the output pipe. The object that needs to be written. This will be written as a single object, even if it is an enumeration. When the cmdlet wants to write a single object out, it will call this API. It is up to the implementation to decide what to do with these objects. Called to write one or more objects to the output pipe. If the object is a collection and the enumerateCollection flag is true, the objects in the collection will be written individually. The object that needs to be written to the pipeline. true if the collection should be enumerated When the cmdlet wants to write multiple objects out, it will call this API. It is up to the implementation to decide what to do with these objects. Called by the cmdlet to display progress information progress information Use WriteProgress to display progress information about the activity of your Task, when the operation of your Task could potentially take a long time. By default, progress output will be displayed, although this can be configured with the ProgressPreference shell variable. The implementation of the API should display these progress records in a fashion appropriate for the application. For example, a GUI application would implement this as a progress bar of some sort. Displays progress output if enabled Identifies which command is reporting progress Progress status to be displayed The implementation of the API should display these progress records in a fashion appropriate for the application. For example, a GUI application would implement this as a progress bar of some sort. Called when the cmdlet want to display verbose information verbose output Cmdlets use WriteVerbose to display more detailed information about the activity of the Cmdlet. By default, verbose output will not be displayed, although this can be configured with the VerbosePreference shell variable or the -Verbose and -Debug command-line options. The implementation of this API should display this addition information in an appropriate manner e.g. in a different color in a console application or in a separate window in a GUI application. Called by the cmdlet to display warning information warning output Use WriteWarning to display warnings about the activity of your Cmdlet. By default, warning output will be displayed, although this can be configured with the WarningPreference shell variable or the -Verbose and -Debug command-line options. The implementation of this API should display this addition information in an appropriate manner e.g. in a different color in a console application or in a separate window in a GUI application. Write text into pipeline execution log. text to be written to log Use WriteCommandDetail to write important information about cmdlet execution to pipeline execution log. If LogPipelineExecutionDetail is turned on, this information will be written to monad log under log category "Pipeline execution detail" Called by the cmdlet to confirm the operation with the user. Cmdlets which make changes (e.g. delete files, stop services etc.) should call ShouldProcess to give the user the opportunity to confirm that the operation should actually be performed. Name of the target resource being acted upon. This will potentially be displayed to the user. If ShouldProcess returns true, the operation should be performed. If ShouldProcess returns false, the operation should not be performed, and the Cmdlet should move on to the next target resource. An implementation should prompt the user in an appropriate manner and return true or false. An alternative trivial implementation would be to just return true all the time. A Cmdlet should declare [Cmdlet( SupportsShouldProcess = true )] if-and-only-if it calls ShouldProcess before making changes. ShouldProcess may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread. ShouldProcess will take into account command-line settings and preference variables in determining what it should return and whether it should prompt the user. Called by a cmdlet to confirm the operation with the user. Cmdlets which make changes (e.g. delete files, stop services etc.) should call ShouldProcess to give the user the opportunity to confirm that the operation should actually be performed. This variant allows the caller to specify text for both the target resource and the action. Name of the target resource being acted upon. This will potentially be displayed to the user. Name of the action which is being performed. This will potentially be displayed to the user. (default is Cmdlet name) If ShouldProcess returns true, the operation should be performed. If ShouldProcess returns false, the operation should not be performed, and the Cmdlet should move on to the next target resource. An implementation should prompt the user in an appropriate manner and return true or false. An alternative trivial implementation would be to just return true all the time. A Cmdlet should declare [Cmdlet( SupportsShouldProcess = true )] if-and-only-if it calls ShouldProcess before making changes. ShouldProcess may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread. ShouldProcess will take into account command-line settings and preference variables in determining what it should return and whether it should prompt the user. Called by a cmdlet to confirm the operation with the user. Cmdlets which make changes (e.g. delete files, stop services etc.) should call ShouldProcess to give the user the opportunity to confirm that the operation should actually be performed. This variant allows the caller to specify the complete text describing the operation, rather than just the name and action. Textual description of the action to be performed. This is what will be displayed to the user for ActionPreference.Continue. Textual query of whether the action should be performed, usually in the form of a question. This is what will be displayed to the user for ActionPreference.Inquire. Caption of the window which may be displayed if the user is prompted whether or not to perform the action. may be displayed by some hosts, but not all. If ShouldProcess returns true, the operation should be performed. If ShouldProcess returns false, the operation should not be performed, and the Cmdlet should move on to the next target resource. A Cmdlet should declare [Cmdlet( SupportsShouldProcess = true )] if-and-only-if it calls ShouldProcess before making changes. ShouldProcess may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread. ShouldProcess will take into account command-line settings and preference variables in determining what it should return and whether it should prompt the user. An implementation should prompt the user in an appropriate manner and return true or false. An alternative trivial implementation would be to just return true all the time. Called by a cmdlet to confirm the operation with the user. Cmdlets which make changes (e.g. delete files, stop services etc.) should call ShouldProcess to give the user the opportunity to confirm that the operation should actually be performed. This variant allows the caller to specify the complete text describing the operation, rather than just the name and action. Textual description of the action to be performed. This is what will be displayed to the user for ActionPreference.Continue. Textual query of whether the action should be performed, usually in the form of a question. This is what will be displayed to the user for ActionPreference.Inquire. Caption of the window which may be displayed if the user is prompted whether or not to perform the action. may be displayed by some hosts, but not all. Indicates the reason(s) why ShouldProcess returned what it returned. Only the reasons enumerated in are returned. If ShouldProcess returns true, the operation should be performed. If ShouldProcess returns false, the operation should not be performed, and the Cmdlet should move on to the next target resource. A Cmdlet should declare [Cmdlet( SupportsShouldProcess = true )] if-and-only-if it calls ShouldProcess before making changes. ShouldProcess may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread. ShouldProcess will take into account command-line settings and preference variables in determining what it should return and whether it should prompt the user. An implementation should prompt the user in an appropriate manner and return true or false. An alternative trivial implementation would be to just return true all the time. Called by a cmdlet to confirm an operation or grouping of operations with the user. This differs from ShouldProcess in that it is not affected by preference settings or command-line parameters, it always does the query. This variant only offers Yes/No, not YesToAll/NoToAll. Textual query of whether the action should be performed, usually in the form of a question. Caption of the window which may be displayed when the user is prompted whether or not to perform the action. It may be displayed by some hosts, but not all. If ShouldContinue returns true, the operation should be performed. If ShouldContinue returns false, the operation should not be performed, and the Cmdlet should move on to the next target resource. Cmdlets using ShouldContinue should also offer a "bool Force" parameter which bypasses the calls to ShouldContinue and ShouldProcess. If this is not done, it will be difficult to use the Cmdlet from scripts and non-interactive hosts. Cmdlets using ShouldContinue must still verify operations which will make changes using ShouldProcess. This will assure that settings such as -WhatIf work properly. You may call ShouldContinue either before or after ShouldProcess. ShouldContinue may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread. Cmdlets may have different "classes" of confirmations. For example, "del" confirms whether files in a particular directory should be deleted, whether read-only files should be deleted, etc. Cmdlets can use ShouldContinue to store YesToAll/NoToAll members for each such "class" to keep track of whether the user has confirmed "delete all read-only files" etc. ShouldProcess offers YesToAll/NoToAll automatically, but answering YesToAll or NoToAll applies to all subsequent calls to ShouldProcess for the Cmdlet instance. An implementation should prompt the user in an appropriate manner and return true or false. An alternative trivial implementation would be to just return true all the time. Called to confirm an operation or grouping of operations with the user. This differs from ShouldProcess in that it is not affected by preference settings or command-line parameters, it always does the query. This variant offers Yes, No, YesToAll and NoToAll. Textual query of whether the action should be performed, usually in the form of a question. Caption of the window which may be displayed when the user is prompted whether or not to perform the action. It may be displayed by some hosts, but not all. true iff user selects YesToAll. If this is already true, ShouldContinue will bypass the prompt and return true. true iff user selects NoToAll. If this is already true, ShouldContinue will bypass the prompt and return false. If ShouldContinue returns true, the operation should be performed. If ShouldContinue returns false, the operation should not be performed, and the Cmdlet should move on to the next target resource. Cmdlets using ShouldContinue should also offer a "bool Force" parameter which bypasses the calls to ShouldContinue and ShouldProcess. If this is not done, it will be difficult to use the Cmdlet from scripts and non-interactive hosts. Cmdlets using ShouldContinue must still verify operations which will make changes using ShouldProcess. This will assure that settings such as -WhatIf work properly. You may call ShouldContinue either before or after ShouldProcess. ShouldContinue may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread. Cmdlets may have different "classes" of confirmations. For example, "del" confirms whether files in a particular directory should be deleted, whether read-only files should be deleted, etc. Cmdlets can use ShouldContinue to store YesToAll/NoToAll members for each such "class" to keep track of whether the user has confirmed "delete all read-only files" etc. ShouldProcess offers YesToAll/NoToAll automatically, but answering YesToAll or NoToAll applies to all subsequent calls to ShouldProcess for the Cmdlet instance. An implementation should prompt the user in an appropriate manner and return true or false. An alternative trivial implementation would be to just return true all the time. Returns true if a transaction is available and active. This interface will be called to route fatal errors from a cmdlet. The error which caused the command to be terminated terminates the command, where allows the command to continue. The cmdlet can also terminate the command by simply throwing any exception. When the cmdlet's implementation of , or throws an exception, the Engine will always catch the exception and report it as a terminating error. However, it is preferred for the cmdlet to call , so that the additional information in is available. It is up to the implementation of this routine to determine what if any information is to be added. It should encapsulate the error record into an exception and then throw that exception. Returns an instance of the PSHost implementation for this environment. Gets an object that surfaces the current PowerShell transaction. When this object is disposed, PowerShell resets the active transaction Monad internal implementation of the ICommandRuntime interface used for execution in the monad engine environment. There will be one instance of this class for each cmdlet added to a pipeline. When the cmdlet calls its WriteObject API, that API will call the WriteObject implementation in this class which, in turn, calls the downstream cmdlet. for diagnostic purposes Writes the object to the output pipe. The object that needs to be written. This will be written as a single object, even if it is an enumeration. The pipeline has already been terminated, or was terminated during the execution of this method. The Cmdlet should generally just allow PipelineStoppedException to percolate up to the caller of ProcessRecord etc. Not permitted at this time or from this thread. WriteObject may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread. The pipeline has already been terminated, or was terminated during the execution of this method. The Cmdlet should generally just allow PipelineStoppedException to percolate up to the caller of ProcessRecord etc. Not permitted at this time or from this thread Writes one or more objects to the output pipe. If the object is a collection and the enumerateCollection flag is true, the objects in the collection will be written individually. The object that needs to be written to the pipeline. true if the collection should be enumerated The pipeline has already been terminated, or was terminated during the execution of this method. The Cmdlet should generally just allow PipelineStoppedException to percolate up to the caller of ProcessRecord etc. Not permitted at this time or from this thread. WriteObject may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread. The pipeline has already been terminated, or was terminated during the execution of this method. The Cmdlet should generally just allow PipelineStoppedException to percolate up to the caller of ProcessRecord etc. Not permitted at this time or from this thread Display progress information progress information The pipeline has already been terminated, or was terminated during the execution of this method. The Cmdlet should generally just allow PipelineStoppedException to percolate up to the caller of ProcessRecord etc. Not permitted at this time or from this thread. WriteProgress may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread. Use WriteProgress to display progress information about the activity of your Cmdlet, when the operation of your Cmdlet could potentially take a long time. By default, progress output will be displayed, although this can be configured with the ProgressPreference shell variable. Displays progress output if enabled Identifies which command is reporting progress Progress status to be displayed The pipeline has already been terminated, or was terminated during the execution of this method. The Cmdlet should generally just allow PipelineStoppedException to percolate up to the caller of ProcessRecord etc. If the pipeline is terminated due to ActionPreference.Stop or ActionPreference.Inquire, this method will throw , but the command failure will ultimately be , Display debug information debug output The pipeline has already been terminated, or was terminated during the execution of this method. The Cmdlet should generally just allow PipelineStoppedException to percolate up to the caller of ProcessRecord etc. Not permitted at this time or from this thread. WriteDebug may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread. Use WriteDebug to display debug information on the inner workings of your Cmdlet. By default, debug output will not be displayed, although this can be configured with the DebugPreference shell variable or the -Debug command-line option. If the pipeline is terminated due to ActionPreference.Stop or ActionPreference.Inquire, this method will throw , but the command failure will ultimately be , Display debug information Display verbose information verbose output The pipeline has already been terminated, or was terminated during the execution of this method. The Cmdlet should generally just allow PipelineStoppedException to percolate up to the caller of ProcessRecord etc. Not permitted at this time or from this thread. WriteVerbose may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread. Use WriteVerbose to display more detailed information about the activity of your Cmdlet. By default, verbose output will not be displayed, although this can be configured with the VerbosePreference shell variable or the -Verbose and -Debug command-line options. Display verbose information Display warning information warning output The pipeline has already been terminated, or was terminated during the execution of this method. The Cmdlet should generally just allow PipelineStoppedException to percolate up to the caller of ProcessRecord etc. Not permitted at this time or from this thread. WriteWarning may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread. Use WriteWarning to display warnings about the activity of your Cmdlet. By default, warning output will be displayed, although this can be configured with the WarningPreference shell variable or the -Verbose and -Debug command-line options. Display warning information Write text into pipeline execution log. text to be written to log Use WriteCommandDetail to write important information about cmdlet execution to pipeline execution log. If LogPipelineExecutionDetail is turned on, this information will be written to monad log under log category "Pipeline execution detail" Confirm the operation with the user. Cmdlets which make changes (e.g. delete files, stop services etc.) should call ShouldProcess to give the user the opportunity to confirm that the operation should actually be performed. Name of the target resource being acted upon. This will potentially be displayed to the user. The pipeline has already been terminated, or was terminated during the execution of this method. The Cmdlet should generally just allow PipelineStoppedException to percolate up to the caller of ProcessRecord etc. Not permitted at this time or from this thread. ShouldProcess may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread. If ShouldProcess returns true, the operation should be performed. If ShouldProcess returns false, the operation should not be performed, and the Cmdlet should move on to the next target resource. A Cmdlet should declare [Cmdlet( SupportsShouldProcess = true )] if-and-only-if it calls ShouldProcess before making changes. ShouldProcess may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread. ShouldProcess will take into account command-line settings and preference variables in determining what it should return and whether it should prompt the user. If the pipeline is terminated due to ActionPreference.Stop or ActionPreference.Inquire, will throw , but the command failure will ultimately be , namespace Microsoft.Samples.MSH.Cmdlet { [Cmdlet(VerbsCommon.Remove,"myobjecttype1")] public class RemoveMyObjectType1 : PSCmdlet { [Parameter( Mandatory = true )] public string Filename { get { return filename; } set { filename = value; } } private string filename; public override void ProcessRecord() { if (ShouldProcess(filename)) { // delete the object } } } } Confirm the operation with the user. Cmdlets which make changes (e.g. delete files, stop services etc.) should call ShouldProcess to give the user the opportunity to confirm that the operation should actually be performed. This variant allows the caller to specify text for both the target resource and the action. Name of the target resource being acted upon. This will potentially be displayed to the user. Name of the action which is being performed. This will potentially be displayed to the user. (default is Cmdlet name) The pipeline has already been terminated, or was terminated during the execution of this method. The Cmdlet should generally just allow PipelineStoppedException to percolate up to the caller of ProcessRecord etc. Not permitted at this time or from this thread. ShouldProcess may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread. If ShouldProcess returns true, the operation should be performed. If ShouldProcess returns false, the operation should not be performed, and the Cmdlet should move on to the next target resource. A Cmdlet should declare [Cmdlet( SupportsShouldProcess = true )] if-and-only-if it calls ShouldProcess before making changes. ShouldProcess may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread. ShouldProcess will take into account command-line settings and preference variables in determining what it should return and whether it should prompt the user. If the pipeline is terminated due to ActionPreference.Stop or ActionPreference.Inquire, this method will throw , but the command failure will ultimately be , namespace Microsoft.Samples.MSH.Cmdlet { [Cmdlet(VerbsCommon.Remove,"myobjecttype2")] public class RemoveMyObjectType2 : PSCmdlet { [Parameter( Mandatory = true )] public string Filename { get { return filename; } set { filename = value; } } private string filename; public override void ProcessRecord() { if (ShouldProcess(filename, "delete")) { // delete the object } } } } Confirm the operation with the user. Cmdlets which make changes (e.g. delete files, stop services etc.) should call ShouldProcess to give the user the opportunity to confirm that the operation should actually be performed. This variant allows the caller to specify the complete text describing the operation, rather than just the name and action. Textual description of the action to be performed. This is what will be displayed to the user for ActionPreference.Continue. Textual query of whether the action should be performed, usually in the form of a question. This is what will be displayed to the user for ActionPreference.Inquire. Caption of the window which may be displayed if the user is prompted whether or not to perform the action. may be displayed by some hosts, but not all. The pipeline has already been terminated, or was terminated during the execution of this method. The Cmdlet should generally just allow PipelineStoppedException to percolate up to the caller of ProcessRecord etc. Not permitted at this time or from this thread. ShouldProcess may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread. If ShouldProcess returns true, the operation should be performed. If ShouldProcess returns false, the operation should not be performed, and the Cmdlet should move on to the next target resource. A Cmdlet should declare [Cmdlet( SupportsShouldProcess = true )] if-and-only-if it calls ShouldProcess before making changes. ShouldProcess may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread. ShouldProcess will take into account command-line settings and preference variables in determining what it should return and whether it should prompt the user. If the pipeline is terminated due to ActionPreference.Stop or ActionPreference.Inquire, this method will throw , but the command failure will ultimately be , namespace Microsoft.Samples.MSH.Cmdlet { [Cmdlet(VerbsCommon.Remove,"myobjecttype3")] public class RemoveMyObjectType3 : PSCmdlet { [Parameter( Mandatory = true )] public string Filename { get { return filename; } set { filename = value; } } private string filename; public override void ProcessRecord() { if (ShouldProcess( String.Format("Deleting file {0}",filename), String.Format("Are you sure you want to delete file {0}?", filename), "Delete file")) { // delete the object } } } } Confirm the operation with the user. Cmdlets which make changes (e.g. delete files, stop services etc.) should call ShouldProcess to give the user the opportunity to confirm that the operation should actually be performed. This variant allows the caller to specify the complete text describing the operation, rather than just the name and action. Textual description of the action to be performed. This is what will be displayed to the user for ActionPreference.Continue. Textual query of whether the action should be performed, usually in the form of a question. This is what will be displayed to the user for ActionPreference.Inquire. Caption of the window which may be displayed if the user is prompted whether or not to perform the action. may be displayed by some hosts, but not all. Indicates the reason(s) why ShouldProcess returned what it returned. Only the reasons enumerated in are returned. The pipeline has already been terminated, or was terminated during the execution of this method. The Cmdlet should generally just allow PipelineStoppedException to percolate up to the caller of ProcessRecord etc. Not permitted at this time or from this thread. ShouldProcess may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread. If ShouldProcess returns true, the operation should be performed. If ShouldProcess returns false, the operation should not be performed, and the Cmdlet should move on to the next target resource. A Cmdlet should declare [Cmdlet( SupportsShouldProcess = true )] if-and-only-if it calls ShouldProcess before making changes. ShouldProcess may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread. ShouldProcess will take into account command-line settings and preference variables in determining what it should return and whether it should prompt the user. If the pipeline is terminated due to ActionPreference.Stop or ActionPreference.Inquire, this method will throw , but the command failure will ultimately be , namespace Microsoft.Samples.MSH.Cmdlet { [Cmdlet(VerbsCommon.Remove,"myobjecttype3")] public class RemoveMyObjectType3 : PSCmdlet { [Parameter( Mandatory = true )] public string Filename { get { return filename; } set { filename = value; } } private string filename; public override void ProcessRecord() { ShouldProcessReason shouldProcessReason; if (ShouldProcess( String.Format("Deleting file {0}",filename), String.Format("Are you sure you want to delete file {0}?", filename), "Delete file", out shouldProcessReason)) { // delete the object } } } } Helper function for ShouldProcess APIs Description of operation, to be printed for Continue or WhatIf Warning prompt, to be printed for Inquire This is the caption of the window which may be displayed if the user is prompted whether or not to perform the action. It may be displayed by some hosts, but not all. Indicates the reason(s) why ShouldProcess returned what it returned. Only the reasons enumerated in are returned. true iff the action should be performed The pipeline has already been terminated, or was terminated during the execution of this method. The Cmdlet should generally just allow PipelineStoppedException to percolate up to the caller of ProcessRecord etc. If the pipeline is terminated due to ActionPreference.Stop or ActionPreference.Inquire, this method will throw , but the command failure will ultimately be , Confirm an operation or grouping of operations with the user. This differs from ShouldProcess in that it is not affected by preference settings or command-line parameters, it always does the query. This variant only offers Yes/No, not YesToAll/NoToAll. Textual query of whether the action should be performed, usually in the form of a question. Caption of the window which may be displayed when the user is prompted whether or not to perform the action. It may be displayed by some hosts, but not all. The pipeline has already been terminated, or was terminated during the execution of this method. The Cmdlet should generally just allow PipelineStoppedException to percolate up to the caller of ProcessRecord etc. Not permitted at this time or from this thread. ShouldContinue may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread. If ShouldContinue returns true, the operation should be performed. If ShouldContinue returns false, the operation should not be performed, and the Cmdlet should move on to the next target resource. Cmdlets using ShouldContinue should also offer a "bool Force" parameter which bypasses the calls to ShouldContinue and ShouldProcess. If this is not done, it will be difficult to use the Cmdlet from scripts and non-interactive hosts. Cmdlets using ShouldContinue must still verify operations which will make changes using ShouldProcess. This will assure that settings such as -WhatIf work properly. You may call ShouldContinue either before or after ShouldProcess. ShouldContinue may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread. Cmdlets may have different "classes" of confirmations. For example, "del" confirms whether files in a particular directory should be deleted, whether read-only files should be deleted, etc. Cmdlets can use ShouldContinue to store YesToAll/NoToAll members for each such "class" to keep track of whether the user has confirmed "delete all read-only files" etc. ShouldProcess offers YesToAll/NoToAll automatically, but answering YesToAll or NoToAll applies to all subsequent calls to ShouldProcess for the Cmdlet instance. namespace Microsoft.Samples.MSH.Cmdlet { [Cmdlet(VerbsCommon.Remove,"myobjecttype4")] public class RemoveMyObjectType4 : PSCmdlet { [Parameter( Mandatory = true )] public string Filename { get { return filename; } set { filename = value; } } private string filename; [Parameter] public SwitchParameter Force { get { return force; } set { force = value; } } private bool force; public override void ProcessRecord() { if (ShouldProcess( String.Format("Deleting file {0}",filename), String.Format("Are you sure you want to delete file {0}", filename), "Delete file")) { if (IsReadOnly(filename)) { if (!Force && !ShouldContinue( String.Format("File {0} is read-only. Are you sure you want to delete read-only file {0}?", filename), "Delete file")) ) { return; } } // delete the object } } } } Confirm an operation or grouping of operations with the user. This differs from ShouldProcess in that it is not affected by preference settings or command-line parameters, it always does the query. This variant offers Yes, No, YesToAll and NoToAll. Textual query of whether the action should be performed, usually in the form of a question. Caption of the window which may be displayed when the user is prompted whether or not to perform the action. It may be displayed by some hosts, but not all. true iff user selects YesToAll. If this is already true, ShouldContinue will bypass the prompt and return true. true iff user selects NoToAll. If this is already true, ShouldContinue will bypass the prompt and return false. The pipeline has already been terminated, or was terminated during the execution of this method. The Cmdlet should generally just allow PipelineStoppedException to percolate up to the caller of ProcessRecord etc. Not permitted at this time or from this thread. ShouldContinue may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread. If ShouldContinue returns true, the operation should be performed. If ShouldContinue returns false, the operation should not be performed, and the Cmdlet should move on to the next target resource. Cmdlets using ShouldContinue should also offer a "bool Force" parameter which bypasses the calls to ShouldContinue and ShouldProcess. If this is not done, it will be difficult to use the Cmdlet from scripts and non-interactive hosts. Cmdlets using ShouldContinue must still verify operations which will make changes using ShouldProcess. This will assure that settings such as -WhatIf work properly. You may call ShouldContinue either before or after ShouldProcess. ShouldContinue may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread. Cmdlets may have different "classes" of confirmations. For example, "del" confirms whether files in a particular directory should be deleted, whether read-only files should be deleted, etc. Cmdlets can use ShouldContinue to store YesToAll/NoToAll members for each such "class" to keep track of whether the user has confirmed "delete all read-only files" etc. ShouldProcess offers YesToAll/NoToAll automatically, but answering YesToAll or NoToAll applies to all subsequent calls to ShouldProcess for the Cmdlet instance. namespace Microsoft.Samples.MSH.Cmdlet { [Cmdlet(VerbsCommon.Remove,"myobjecttype4")] public class RemoveMyObjectType5 : PSCmdlet { [Parameter( Mandatory = true )] public string Filename { get { return filename; } set { filename = value; } } private string filename; [Parameter] public SwitchParameter Force { get { return force; } set { force = value; } } private bool force; private bool yesToAll; private bool noToAll; public override void ProcessRecord() { if (ShouldProcess( String.Format("Deleting file {0}",filename), String.Format("Are you sure you want to delete file {0}", filename), "Delete file")) { if (IsReadOnly(filename)) { if (!Force && !ShouldContinue( String.Format("File {0} is read-only. Are you sure you want to delete read-only file {0}?", filename), "Delete file"), ref yesToAll, ref noToAll ) { return; } } // delete the object } } } } Returns true if a transaction is available for use. Implementation of ThrowTerminatingError. The error which caused the command to be terminated always terminates the command, where allows the command to continue. The cmdlet can also terminate the command by simply throwing any exception. When the cmdlet's implementation of , or throws an exception, the Engine will always catch the exception and report it as a terminating error. However, it is preferred for the cmdlet to call , so that the additional information in is available. always throws , regardless of what error was specified in . The Cmdlet should generally just allow . to percolate up to the caller of . etc. Method to set data stream merging based on passed in runtime object. MshCommandRuntime object. An empty array that is declared statically so we don't keep allocating them over and over... throws if the pipeline is stopping throws if the caller is trying to call WriteObject/WriteError from the wrong thread, or not during a call to BeginProcessing/ProcessRecord/EndProcessing WriteObject/WriteObjecs/WriteError are only allowed during this scope. Be sure to use this object only in "using" so that it is reliably disposed and follows stack semantics. IDisposable Stores the exception to be returned from PipelineProcessor.SynchronousExecute, and writes it to the error variable. The general pattern is to call throw ManageException(e); the exception PipelineStoppedException Append an error to the ErrorVariable if specified, and also to $ERROR Exception or ErrorRecord (An error occurred working with the error variable or $ERROR. Appends the object to $global:error. Non-terminating errors are always added (even if they are redirected to another Cmdlet), but terminating errors are only added if they are at the top-level scope (the LocalPipeline scope). We insert at position 0 and delete from position 63. ErrorRecord or Exception to be written to $global:error An error occurred accessing $ERROR. Append a warning to WarningVariable if specified. The warning message The pipeline has already been terminated, or was terminated during the execution of this method. The Cmdlet should generally just allow PipelineStoppedException to percolate up to the caller of ProcessRecord etc. The pipeline has already been terminated, or was terminated during the execution of this method. The Cmdlet should generally just allow PipelineStoppedException to percolate up to the caller of ProcessRecord etc. Internal variant: Writes the specified error to the error pipe. Do not call WriteError(e.ErrorRecord). The ErrorRecord contained in the ErrorRecord property of an exception which implements IContainsErrorRecord should not be passed directly to WriteError, since it contains a rather than the real exception. error Not permitted at this time or from this thread The pipeline has already been terminated, or was terminated during the execution of this method. The Cmdlet should generally just allow PipelineStoppedException to percolate up to the caller of ProcessRecord etc. terminates the command, where allows the command to continue. If the pipeline is terminated due to ActionPreference.Stop or ActionPreference.Inquire, this method will throw , but the command failure will ultimately be , Not permitted at this time or from this thread The pipeline has already been terminated, or was terminated during the execution of this method. The Cmdlet should generally just allow PipelineStoppedException to percolate up to the caller of ProcessRecord etc. If the pipeline is terminated due to ActionPreference.Stop or ActionPreference.Inquire, this method will throw , but the command failure will ultimately be , The pipeline has already been terminated, or was terminated during the execution of this method. The Cmdlet should generally just allow PipelineStoppedException to percolate up to the caller of ProcessRecord etc. If the pipeline is terminated due to ActionPreference.Stop or ActionPreference.Inquire, this method will throw , but the command failure will ultimately be , Preference setting for displaying ProgressRecords when WriteProgress is called. Should the verbose/debug/progress message be printed? Complete implementation of WriteDebug/WriteVerbose/WriteProgress Did Inquire return YesToAll? The pipeline has already been terminated, or was terminated during the execution of this method. The Cmdlet should generally just allow PipelineStoppedException to percolate up to the caller of ProcessRecord etc. If the pipeline is terminated due to ActionPreference.Stop or ActionPreference.Inquire, this method will throw , but the command failure will ultimately be , Helper for continue prompt, handles Inquire may be null may be null user's selection The pipeline has already been terminated, or was terminated during the execution of this method. The Cmdlet should generally just allow PipelineStoppedException to percolate up to the caller of ProcessRecord etc. If the pipeline is terminated due to ActionPreference.Stop or ActionPreference.Inquire, this method will throw , but the command failure will ultimately be , Determines if this is being run in the context of a remote host or not. Gets/Set the execution context value for this runtime object. The host object for this object IsClosed indicates to the Cmdlet whether its upstream partner could still write more data to its incoming queue. Note that there may still be data in the incoming queue. True if we're not closed and the input pipe is non-null... Return the invocation data object for this command. The invocation object for this command. Internal helper. Indicates whether stop has been requested on this command. This allows all success output to be set to a variable. Similar to the way -errorvariable sets all errors to a variable name. Semantically this is equivalent to : cmd |set-var varname -passthru but it should be MUCH faster as there is no binding that takes place may not be set to null This is a common parameter via class CommonParameters. Configures the number of objects to buffer before calling the downstream Cmdlet This is a common parameter via class CommonParameters. Gets an object that surfaces the current PowerShell transaction. When this object is disposed, PowerShell resets the active transaction Get/sets error data stream merge state. Claims the unclaimed error output of all previous commands Gets or sets the input pipe. Gets or sets the output pipe. Gets or sets the error pipe. Gets or sets the warning output pipe. Gets or sets the verbose output pipe. Gets or sets the debug output pipe. ErrorVariable tells which variable to populate with the errors. Use +varname to append to the variable rather than clearing it. This is a common parameter via class CommonParameters. WarningVariable tells which variable to populate with the warnings. Use +varname to append to the variable rather than clearing it. This is a common parameter via class CommonParameters. Preference setting controlling behavior of ShouldProcess() This is not an independent parameter, it just emerges from the Verbose, Debug, Confirm, and WhatIf parameters and the $ConfirmPreference shell variable. We only read $ConfirmPreference once, then cache the value. Preference setting (get-only) An error occurred accessing $DebugPreference. Preference setting An error occurred accessing $VerbosePreference. Preference setting An error occurred accessing $WarningPreference. Echo tells the command to articulate the actions it performs while executing. This is a common parameter via class CommonParameters. Confirm tells the command to ask the admin before performing an action. This is a common parameter via class ShouldProcessParameters. UseTransaction tells the command to activate the current PowerShell transaction. This is a common parameter via class TransactionParameters. Debug tell the command system to provide Programmer/Support type messages to understand what is really occuring and give the user the opportunity to stop or debug the situation This is a common parameter via class CommonParameters. WhatIf indicates that the command should not perform any changes to persistent state outside Monad. This is a common parameter via class ShouldProcessParameters. ErrorAction tells the command what to do when an error occurs (get-only) An error occurred accessing $ErrorAction. This is a common parameter via class CommonParameters. Data streams available for merging. No data stream available for merging. All data streams. Success output. Error output. Warning output. Verbose output. Debug output. Host output. Begin the scope where WriteObject/WriteError is permitted. End the scope where WriteObject/WriteError is permitted ContinueStatus indicates the last reply from the user whether or not the command should process an object. Default implementation of ICommandRuntime for running Cmdlets standalone. Constructs an instance of the default ICommandRuntime object that will write objects into the arraylist that was passed. Implementation of WriteDebug - just discards the input. Text to write Default implementation of WriteError - if the error record contains an exceptin then that exception will be thrown. If not, then an InvalidOperationException will be constructed and thrown. Error record instance to process Default implementation of WriteObject - adds the object to the arraylist passed to the objects constructor. Object to write Default implementation of the enumerated WriteObject. Either way, the objects are added to the arraylist passed to this object in the constuctor. Object to write If true, the collection is enumerated, otherwise it's written as a scalar. Default implementation - just discards it's arguments progress record to write. Default implementation - just discards it's arguments Source ID to write for record to write. Default implementation - just discards it's arguments Text to write. Default implementation - just discards it's arguments Text to write. Default implementation - just discards it's arguments Text to write. Default implementation - always returns true. ignored true Default implementation - always returns true. ignored ignored true Default implementation - always returns true. ignored ignored ignored true Default implementation - always returns true. ignored ignored ignored ignored true Default implementation - always returns true. ignored ignored true Default implementation - always returns true. ignored ignored ignored ignored true Returns true if a transaction is available and active. Implementation of the dummy default ThrowTerminatingError API - it just does what the base implementation does anyway - rethrow the exception if it exists, otherwise throw an invalid operation exception. The error record to throw Return the instance of PSHost - null by default. Gets an object that surfaces the current PowerShell transaction. When this object is disposed, PowerShell resets the active transaction Provides information about a mapping between a command name and a real command. Creates an instance of the AliasInfo class with the specified name and referenced command The name of the command. The token that the alias refers to. The execution context for this engine, used to lookup the current session state. If is null or empty. If is null. Creates an instance of the AliasInfo class with the specified name and referenced command The name of the command. The token that the alias refers to. The execution context for this engine instance, used to look up session state. The options to set on the alias. Note, Constant can only be set at creation time. If is null or empty. If is null. Sets the new definition for the alias. The new definition for the alias. If true, the value will be set even if the alias is ReadOnly. If the alias is readonly or constant. Sets the options for the alias and allows changes ReadOnly options only if force is specified. The new options value. If true the change to the options will happen even if the existing options are read-only. Gets the command information for the command that is immediately referenced by this alias. Gets the command information for the command that the alias eventually resolves to. An alias may reference another alias. This property follows the reference chain of aliases to its end. Gets the name of the command to which the alias refers. Gets or sets the scope options for the alias If the trying to set an alias that is constant or if the value trying to be set is ScopedItemOptions.Constant Gets or sets the description for the alias If ResolvedCommand returns null, this property will return the name of the command that could not be resolved. If ResolvedCommand has not yet been called or was able to resolve the command, this this property will return null. The objects output from an alias are the objects output from the resolved command. If we can't resolve the command, assume nothing is output - so use void. Provides information for applications that are not directly executable by Monad. An application is any file that is executable by Windows either directly or through file associations excluding any .ps1 files or cmdlets. Creates an instance of the ApplicationInfo class with the specified name, and path. The name of the application. The path to the application executable THe engine execution context for this command... If or is null or empty or contains one or more of the invalid characters defined in InvalidPathChars. Gets the path for the application file. Gets the extension of the application file. Gets the path of the application file. Determine the visibility for this script... An application could return nothing, but commonly it returns a string. The command information for MSH cmdlets that are directly executable by MSH Constructs a CmdletInfo object from the raw cmdlet data. This should only be used for Intrinsic commands. The name of the cmdlet. The type information about the class that implements the cmdlet. The name of the help file associated with the cmdlet The PSSnapInInfo of the PSSnapin the cmdlet comes from. The current engine context. This is a copy constructor, used primarily for get-command. Create a copy of commandInfo for GetCommandCommand so that we can generate parameter sets based on an argument list (so we can get the dynamic parameters.) Directly create a cmdlet object from a type. This allows unregistered commands to be called. It also allows the overhead of command discovery to be bypassed. The name to use for the cmdlet, must be in the form Noun-Verb. The .NET class implementing this cmdlet. Sets the options for the cmdlet and allows changes ReadOnly options only if force is specified. The new options value. If true the change to the options will happen even if the existing options are read-only. Gets the full name of the cmdlet including the PSSnapin name Gets the full name of the cmdlet including the PSSnapin name Gets the full name of the cmdlet including the PSSnapin name. Gets the verb of the cmdlet Gets the noun of the cmdlet. Gets the help file path for the cmdlet. Gets the Snap-in in which the cmdlet is implemented. Gets the name of the PSSnapin the cmdlet is implemented in. Gets the type that implements the cmdlet Gets the synopsis of the cmdlet Gets the name of the default parameter set. Return the output types specified on the cmdlet. Gets or sets the scope options for the alias If the trying to set an cmdlet that is constant or if the value trying to be set is ScopedItemOptions.Constant Gets the full name of the cmdlet including the PSSnapin name Gets the CommandMetadata for this cmdlet The type name is invalid or the length of the type name exceeds 1024 characters. The caller does not have the required permission to load the assembly or create the type. If more than int.MaxValue parameter-sets are defined for the command. If a parameter defines the same parameter-set name multiple times. If the attributes could not be read from a property or field. This is the interface between the CommandProcessor and the various parameter binders required to bind parameters to a cmdlet. The base class for the parameter binder controllers. This class and its derived classes control the interaction between the command processor and the parameter binder(s). It holds the state of the arguments and parameters. Constructs a parameter binder controller for the specified command in the specified engine context. The invocation information about the code being run. The engine context in which the command is being run. The default parameter binder for the command. Reparses the unbound arguments using the parameter metadata of the specified parameter binder as the parsing guide. If a parameter token is not matched with an argument and its not a bool or SwitchParameter. Or The name of the argument matches more than one parameter. The argument looks like a parameter if it is a string and starts with a dash. The argument to check. True if the argument is a string and starts with a dash, or false otherwise. Reparses the arguments specified in the object[] and generates CommandParameterInternal instances based on whether the arguments look like parameters. The CommandParameterInternal instances then get added to the specified command processor. The command processor instance to add the reparsed parameters to. The arguments that require reparsing. Bind the argument to the specified parameter The argument to be bound. The flags for type coercion, validation, and script block binding. True if the parameter was successfully bound. False if does not have the flag ParameterBindingFlags.ShouldCoerceType and the type does not match the parameter type. If argument transformation fails. or The argument could not be coerced to the appropriate type for the parameter. or The parameter argument transformation, prerequisite, or validation failed. or If the binding to the parameter fails. or The parameter has already been bound. Derived classes need to define the binding of multiple arguments. The arguments to be bound. The arguments which are still not bound. Bind the argument to the specified parameter The parameter set used to bind the arguments. The argument to be bound. The metadata for the parameter to bind the argument to. Flags for type coercion and valiation of the arguments. True if the parameter was successfully bound. False if specifies no type coercion and the type does not match the parameter type. If or is null. If argument transformation fails. or The argument could not be coerced to the appropriate type for the parameter. or The parameter argument transformation, prerequisite, or validation failed. or If the binding to the parameter fails. Binds the unbound arguments to positional parameters The unbound arguments to attempt to bind as positional arguments. The current parameter set flags that are valid. The parameter set to use to disambiguate parameters that have the same position Returns the underlying parameter binding exception if any was generated. The remaining arguments that have not been bound. It is assumed that the unboundArguments parameter has already been processed for this parameter binder. All named parameters have been paired with their values. Any arguments that don't have a name are considered positional and will be processed in this method. If multiple parameters were found for the same position in the specified parameter set. or If argument transformation fails. or The argument could not be coerced to the appropriate type for the parameter. or The parameter argument transformation, prerequisite, or validation failed. or If the binding to the parameter fails. This method only updates the collections contained in the dictionary, not the dictionary itself to contain only the parameters that are in the specified parameter set. The sorted dictionary of positional parameters. Valid parameter sets Generate elaborated binding exception so that the user will know the default binding might cause the failure Gets the unbound positional parameters in a sorted dictionary in the order of their positions. The sorted dictionary of MergedCompiledCommandParameter metadata with the position as the key. For any unbound parameters, this method checks to see if the parameter has a default value specified, and evaluates the expression (if the expression is not constant) and binds the result to the parameter. If not, we bind null to the parameter (which may go through type coercion). If the parameter binder might use the value more than once, this it can save the value to avoid re-evalauting complicated expressions. Bind the default value for an unbound parameter to script (used by both the script binder and the cmdlet binder). The engine context the command is running in. Gets the parameter binder for the command. The invocation information about the code being run. All the metadata associated with any of the parameters that are available from the command. A collection of the unbound parameters for the command. The collection is indexed based on the name of the parameter. A collection of the bound parameters for the command. The collection is indexed based on the name of the parameter. Set true if the default parameter binding is in use A collection of bound default parameters A collection of the unbound arguments. A collection of the arguments that have been bound Keeps track of the parameters that get bound through pipeline input, so that their previous values can be restored before the next pipeline input comes. The separator used in GetDefaultParameterValuePairs function Initializes the cmdlet parameter binder controller for the specified cmdlet and engine context The cmdlet that the parameters will be bound to. The metadata about the cmdlet. The default parameter binder to use. Binds the specified command-line parameters to the target Parameters to the command. If any parameters fail to bind, or If any mandatory parameters are missing. If there is an error generating the metadata for dynamic parameters. Binds the unbound arguments to parameters but does not perform mandatory parameter validation or parameter set validation. Process all valid parameter sets, and filter out those that don't take any pipeline input The new valid parameter set flags Apply the binding for the defualt parameter defined by the user Dictate which binding stage this default binding happens Special operation needed if the default binding happens at the dynamic binding stage Bind the default parameter value pairs validParameterSetFlag default value pairs true if there is at least one default parameter bound scucessfully false if there is no default parameter bound successfully Wrap up current binding state to provide more information to the user Get all qualified default parameter value pairs based on the given currentParameterSetFlag. null if no qualified pair found Get the aliases of the the current cmdlet Check if the passed-in aliasName matches an alias name in _aliasList Get all available default parameter value pairs return the available parameter value pairs. Otherwise return null A helper method for GetDefaultParameterValuePairs Verify if all arguments from the command line are bound. Previous binding exceptions that possiblly causes the failure Verifies that a single parameter set is selected and throws an exception if one of there are multiple and one of them is not the default parameter set. Restores the specified parameter to the original value. The argument containing the value to restore. The metadata for the parameter to restore. True if the parameter was restored correctly, or false otherwise. Binds the actual arguments to only the formal parameters for only the parameters in the specified parameter set The parameter set used to bind the arguments. The arguments that should be attempted to bind to the parameters of the specified parameter binder. if multiple parameters are found matching the name. or if no match could be found. or If argument transformation fails. or The argument could not be coerced to the appropriate type for the parameter. or The parameter argument transformation, prerequisite, or validation failed. or If the binding to the parameter fails. Determines if a ScriptBlock can be bound directly to the type of the specified parameter The metadata of the parameter to check the type of. true if the parameter type is Object, ScriptBlock, derived from ScriptBlock, a collection of ScriptBlocks, a collection of Objects, or a collection of types derived from ScriptBlock. False otherwise. Binds the specified parameters to the cmdlet The parameters to bind. Binds the specified argument to the specified parameter using the appropriate parameter binder. If the argument is of type ScriptBlock and the parameter takes pipeline input, then the ScriptBlock is saved off in the delay-bind ScriptBlock container for further processing of pipeline input and is not bound as the argument to the parameter. The parameter set used to bind the arguments. The argument to be bound. The metadata for the parameter to bind the argument to. Flags for type coercion, validation, and script block binding. ParameterBindingFlags.DelayBindScriptBlock: If set, arguments that are of type ScriptBlock where the parameter is not of type ScriptBlock, Object, or PSObject will be stored for execution during pipeline input and not bound as an argument to the parameter. True if the parameter was successfully bound. False if has the flag set and the type does not match the parameter type. Binds the specified argument to the specified parameter using the appropriate parameter binder. The argument to be bound. The metadata for the parameter to bind the argument to. Flags for type coercion and validation. True if the parameter was successfully bound. False if has the flag set and the type does not match the parameter type. Binds the remaining arguments to an unbound ValueFromRemainingArguments parameter (Varargs) If there was an error binding the arguments to the parameters. Determines if the cmdlet supports dynamic parameters. If it does, the dynamic parameter bindable object is retrieved and the unbound arguments are bound to it. Returns the underlying parameter binding exception if any was generated. If there was an error compiling the parameter metadata. If there was an error binding the arguments to the parameters. This method determines if the unbound mandatory parameters take pipeline input or if we can use the default parameter set. If all the unbound mandatory parameters take pipeline input and the default parameter set is valid, then the default parameter set is set as the current parameter set and processing can continue. If there are more than one valid parameter sets and the unbound mandatory parameters are not consistent across parameter sets or there is no default parameter set then a ParameterBindingException is thrown with an errorId of AmbiguousParameterSet. The number of valid parameter sets. True if the pipeline is open to receive input. If there are multiple valid parameter sets and the missing mandatory parameters are not consistent across parameter sets, or there is no default parameter set. Preserve potential parameter sets as much as possible The mandatory set we choose to latch on Other mandatory parameter sets to be ignored Indicate if the chosen mandatory set contains any non-pipelineable mandatory parameters Update _currentParameterSetFlag to ignore the specified mandatory sets This method is used only when we try to preserve parameter sets during the mandatory parameter checking. In cases where this method is used, there must be at least one parameter set declared. the mandatory parameter sets to be ignored Ensures that only one parameter set is valid or throws an appropriate exception If true, it is acceptable to have multiple valid parameter sets as long as one of those parameter sets take pipeline input. If true, the default parameter set will be selected if there is more than one valid parameter set and one is the default set. If false, the count of valid parameter sets will be returned but no error will occur and the default parameter set will not be used. The number of valid parameter sets. If the more than one or zero parameter sets were resolved from the named parameters. Determines if there are any unbound parameters that take pipeline input for the specified parameter sets. The parameter sets that should be checked for each unbound parameter to see if it accepts pipeline input. True if there is at least one parameter that takes pipeline input for the specified parameter sets, or false otherwise. Checks for unbound mandatory paramters. If any are found, an exception is thrown. Returns the missing mandatory parameters, if any. True if there are no unbound mandatory parameters. False if there are unbound mandatory parameters. Checks for unbound mandatory paramters. If any are found and promptForMandatory is true, the user will be prompted for the missing mandatory parameters. The number of valid parameter sets. If true, unbound mandatory parameters will cause the user to be prompted. If false, unbound mandatory parameters will cause false to be returned. If true, then only parameters that don't take pipeline input will be prompted for. If false, any mandatory parameter that has not been specified will be prompted for. Returns the missing mandatory parameters, if any. True if there are no unbound mandatory parameters. False if there are unbound mandatory parameters and promptForMandatory if false. If prompting didn't result in a value for the parameter (only when is true.) Creates a label with a Hotkey from . The Hotkey is 's first capital character not in . If does not have any capital character, the first lower case character is used. The Hotkey is preceded by an ampersand in the label. The parameter name from which the Hotkey is created A list of used HotKeys A label made from parameterName with a HotKey indicated by an ampersand Binds the specified object or its properties to parameters that accept pipeline input. The pipeline object to bind. True if the pipeline input was bound successfully or there was nothing to bind, or false if there was an error. Binds the pipeline parameters using the specified input and parameter set The pipeline input to be bound to the parameters. If argument transformation fails. or The argument could not be coerced to the appropriate type for the parameter. or The parameter argument transformation, prerequisite, or validation failed. or If the binding to the parameter fails. or If there is a failure resetting values prior to binding from the pipeline The algorithm for binding the pipeline object is as follows. If any step is successful true gets returned immediately. - If parameter supports ValueFromPipeline - attempt to bind input value without type coercion - If parameter supports ValueFromPipelineByPropertyName - attempt to bind the value of the property with the matching name without type coercion Now see if we have a single valid parameter set and reset the validParameterSets flags as necessary. If there are still multiple valid parameter sets, then we need to use TypeDistance to determine which parameters to do type coercion binding on. - If parameter supports ValueFromPipeline - attempt to bind input value using type coercion - If parameter support ValueFromPipelineByPropertyName - attempt to bind the vlue of the property with the matching name using type coercion Invokes any delay bind script blocks and binds the resulting value to the appropriate parameter. The input to the script block. Returns True if there was a ScriptBlock to invoke and bind, or false if there are no ScriptBlocks to invoke. True if the binding succeeds, or false otherwise. if is null. If execution of the script block throws an exception or if it doesn't produce any output. Determines the number of valid parameter sets based on the valid parameter set flags. The valid parameter set flags. The number of valid parameter sets in the parameterSetFlags. This method gets a backup of the default value of a parameter. Derived classes may override this method to get the default parameter value in a different way. The name of the parameter to get the default value of. The value of the parameter specified by name. If the parameter binder encounters an error getting the default value. The cmdlet metadata. THe command runtime object for this cmdlet. The parameter binder for the dynamic parameters. Currently this can be either a ReflectionParameterBinder or a RuntimeDefinedParameterBinder This dictionary is used to contain the arguments that were passed in as ScriptBlocks but the parameter isn't a ScriptBlock. So we have to wait to bind the parameter until there is a pipeline object available to invoke the ScriptBlock with. A collection of the default values of the parameters. Binds the specified value to the specified parameter The value to bind to the parameter The parameter to bind the value to. Parameter binding flags for type coercion and validation. True if the parameter was successfully bound. False if specifies no coercion and the type does not match the parameter type. If the parameter binder encounters an error getting the default value. Backs up the specified parameter value by calling the GetDefaultParameterValue abstract method. This method is called when binding a parameter value that came from a pipeline object. If the parameter binder encounters an error getting the default value. Replaces the values of the parameters with their initial value for the parameters specified. The parameters that should have their default values restored. If is null. Gets the parameter set name for the current parameter set. Gets or sets the command that this parameter binder controller will bind parameters to. The parameter binder for the ShouldProcess parameters. The parameter binder for the Paging parameters. The parameter binder for the Transactions parameters. The parameter binder for the CommonParameters. Used for defining the state of the binding state machine. A versionable hashtable, so the caching of UserInput -> ParameterBindingResult will work check to see if the hashtable has been changed since last check true for changed; false for not changed default constructor constructor takes a hash table Check for the keys' formats and make it versionable a hashtable instance override the Add to check for key's format and make it versionable key value override the Remove to make it versionable key override the Clear to make it versionable Check if the key is in valid format. If it is, get the cmdlet name and parameter name. Return true if the key is valid, false if not Get the cmdlet name and the parameter name point to a non-whitespace character the key to iterate over Specify whether to get the cmdlet name or parameter name For cmdletName: When the name is enclosed by quotes, the index returned should be the index of the character right after the second quote; When the name is not enclosed by quotes, the index returned should be the index of the separator; For parameterName: When the name is enclosed by quotes, the index returned should be the index of the seocnd quote plus 1 (the length of the key if the key is in a valid format); When the name is not enclosed by quotes, the index returned should be the length of the key. Skip whitespace characters start index the string to iterate over Return -1 if we reach the end of the key, otherwise return the index of the first non-whitespace character we encounter. override the indexing to check for key's format and make it versionable. EventArgs for the ScriptCmdletVariableUpdate event Constructor for event args object The name of the command we're searching for The origin of the command internal or runspace (external) The execution context for this command The name of the command we're looking for The origin of the command internal or runspace (external) If true on return from event handler, the search is stopped. The CommandInfo obejct for the command that was found. Scriptblock to be returned as the found command. If it is set to null, then the command to return and the StopSearch flag will be reset. Defines the preference options for the Module Auto-loading feature Do not auto-load modules when a command is not found. Only auto-load modules when a command is not found, and the command is module-qualified. Auto-load modules when a command is not found. CommandDiscovery... Default constructor... If is null. Determines if the cmdlet is a cmdlet that shouldn't be in the discovery list. Type implementing the cmdlet True if the cmdlet is a special cmdlet that shouldn't be part of the discovery list. Or false otherwise. Adds the CmdletInfo to the cmdlet cache in the current scope object. The name of the cmdlet to add. The CmdletInfo to add. If true, the cmdlet is added to the Module Scope of the session state. If a cmdlet with the same module and cmdlet name already exists but has a different implementing type. Add a SessionStateCmdletEntry to the cmdlet cache... Add a SessionStateCmdletEntry to the cmdlet cache... Look up a command named by the argument string and return its CommandProcessorBase. The command name to lookup. Location where the command was dispatched from. True if command processor should use local scope to execute the command, False if not. Null if command discovery should default to something reasonable for the command discovered. If the command, , could not be found. If the security manager is preventing the command from running. used to determine compatibility between the versions in the requires statement and the installed version. The version can be PSSnapin or msh versions in the requires statement version installed true if requires and installed's major version match and requires' minor version is smaller than or equal to installed's In PowerShell V2, script requiring PowerShell 1.0 will fail. Look up a command using a CommandInfo object and return its CommandProcessorBase. The commandInfo for the command to lookup. Location where the command was dispatched from. True if command processor should use local scope to execute the command, False if not. Null if command discovery should default to something reasonable for the command discovered. The session state the commandInfo should be run in. If the command, , could not be found. If the security manager is preventing the command from running. Look up a command and return its CommandInfo. The command name to lookup. An instance of a CommandInfo object that represents the command. If the command is resolved as an alias, an AliasInfo is returned with the ReferencedCommand info intact. If the command, , could not be found. Gets a CommandPathSearch constructed with the specified patterns and using the PATH as the lookup directories The patterns to search for. These patterns must be in the form taken by DirectoryInfo.GetFiles(). An instance of CommandPathSearch that is initialized with the specified patterns and using the PATH as the lookup directories. Gets the resolved paths contained in the PATH environment variable. The contents of the PATH environment variable split using a semi-colon as a delimiter. The result is an ordered list of paths with paths starting with "." unresolved until lookup time. Gets the paths extensions contained in the PATHEXT environment variable. The list of extensions of the PATHEXT environment variable split using a semi-colon as a delimiter. The cached list of lookup paths. It can be invalidated by the PATH changing. The key that determines if the cached PATH can be used. The cache of the tokenized PATH directories The key that determines if the cached PATHEXT can be used. The cache of the tokenized PATHEXT extensions Gets the cmdlet information for the specified name. The name of the cmdlet to return the information for. True if we should search all scopes, false if we should stop after finding the first. The CmdletInfo for the cmdlet for all the cmdlets with the specified name. If is null or empty. Called by the RunspaceConfiguration when a PSSnapIn gets added to the console to update the list of available cmdlets. Removes a cmdlet from the cmdlet cache. The configuration entry for the cmdlet which is being removed. Gets the cached ScriptInfo for a command using the script name. The name of the script. A reference to the ScriptInfo for the command if its in the cache, or null otherwise. The cache for the ScriptInfo. Reads the path for the appropriate shellID from the registry. The ID of the shell to retrieve the path for. The path to the shell represented by the shellID. The shellID must be registered in the Windows Registry in either the HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE hive under Software/Microsoft/MSH/<ShellID> and are searched in that order. Gets the PATHEXT environment variable extensions and tokenizes them. Gets the script cache A helper collection of strings that doesn't allow duplicate strings. Comparison is case-insensitive and done in the invariant culture. Default constructor Constructs a LookupPathCollection object and adds all the items in the supplied collection to it. A set of items to be added to the collection. Adds the specified string to the collection if its not already a member of the collection. The string to add to the collection. The index at which the string was added or -1 if it was not added. Adds all the strings in the specified collection to this collection The collection of strings to add. Only the strings that are not already in the collection will be added. Determines if the string already exists in the collection using a invariant culture case insensitive comparison. The string to check for existence. True if the string already exists in the collection. Returns a collection of all the indexes that are relative paths. A collection of all the indexes that are relative paths. Finds the first index of the specified string. The string is compared in the invariant culture using a case-insensitive comparison. The string to look for. The index of the string in the collection or -1 if it was not found. If is null or empty. Defines the types of commands that MSH can execute Aliases create a name that refers to other command types Aliases are only persisted within the execution of a single engine. Script functions that are defined by a script block Functions are only persisted within the execution of a single engine. Script filters that are defined by a script block. Filters are only persisted within the execution of a single engine. A cmdlet. An MSH script (*.ps1 file) Any existing application (can be console or GUI). An application can have any extension that can be executed either directly through CreateProcess or indirectly through ShellExecute. A script that is built into the runspace configuration A workflow All possible command types. Note, a CommandInfo instance will never specify All as its CommandType but All can be used when filtering the CommandTypes. Represents , but can be used where a real type might not be available, in which case the name of the type can be used. This constructor is used when the type exists and is currently loaded. The type This constructor is used when the type may not exist, or is not loaded. The name of the type Returns a String that represents the current PSTypeName. String that represents the current PSTypeName. Return the name of the type Return the type with metadata, or null if the type is not loaded. Used to enumerate the commands on the system that match the specified command name Constructs a command searching enumerator that resolves the location of a command using the PATH environment variable. The patterns to search for in the path. The paths to directories in which to lookup the command. The exection context for the current engine instance. If any of the parameters are null. Constructs a command searching enumerator that resolves the location of a command using the PATH environment variable. The patterns to search for in the path. The paths to directories in which to lookup the command. The list of allowed extensions If true, return files with any extension The execution context for the current engine instance. If any of the parameters are null. Ensures that all the paths in the lookupPaths member are absolute file system paths. Gets an instance of a command enumerator An instance of this class as IEnumerator. Gets an instance of a command enumerator An instance of this class as IEnumerator. Moves the enumerator to the next command match true if there was another command that matches, false otherwise. Resets the enumerator to before the first command match Required by the IEnumerator generic interface. Resets the searcher. Gets the matching files in the specified directories and resets the currentDirectoryResultsEnumerator to this new set of results. The pattern used to find the matching files in the specified directory. The path to the directory to find the files in. Gets the files in the specified directory that match the pattern The pattern used to match the files in the directory. The syntax of the pattern is the same as that taken by DirectoryInfo.GetFiles(). The path to the directory to find the files in. If true, allow files with any extension The list of allowed extensions. A collection containing the paths of the matching files. If no matches are found, an empty collection is returned. The directory paths in which to look for commands. This is derived from the PATH environment variable The enumerator for the lookup paths The list of results matching the pattern in the current path lookup directory. Resets to null. The enumerator for the list of results The command name to search for The enumerator for the patterns A reference to the execution context for this runspace When reset is called, this gets set to true. Once MoveNext is called, this gets set to false. If true, return file with any extension The list of allowed extensions Gets the path to the current command match. The enumerator is positioned before the first element of the collection or after the last element. Used to enumerate the commands on the system that match the specified command name Constructs a command searching enumerator that resolves the location to a command using a standard algorithm. The name of the command to look for. Determines which types of commands glob resolution of the name will take place on. The types of commands to look for. The execution context for this engine instance... If is null. If is null or empty. Gets an instance of a command enumerator An instance of this class as IEnumerator. Moves the enumerator to the next command match. Public for IEnumerable true if there was another command that matches, false otherwise. Required by the IEnumerator generic interface. Resets the searcher. Gets the next command info using the command name as a path A CommandInfo for the next command if it exists as a path, or null otherwise. Gets the appropriate CommandInfo instance given the specified path. The path to create the CommandInfo for. An instance of the appropriate CommandInfo derivative given the specified path. The refers to a cmdlet, or cmdletprovider and it could not be loaded as an XML document. The refers to a cmdlet, or cmdletprovider that does not adhere to the appropriate file format for its extension. If refers to a cmdlet file that contains invalid metadata. Gets the next matching alias A CommandInfo representing the next matching alias if found, otherwise null. Gets the next matching function A CommandInfo representing the next matching function if found, otherwise null. Gets the FunctionInfo or FilterInfo for the specified function name. The name of the function/filter to retrieve. A FunctionInfo if the function name exists and is a function, a FilterInfo if the filter name exists and is a filter, or null otherwise. Gets the next cmdlet from the collection of matching cmdlets. If the collection doesn't exist yet it is created and the enumerator is moved to the first item in the collection. A CmdletInfo for the next matching Cmdlet or null if there are no more matches. Gets the next builtin script from the collection of matching scripts. If the collection doesn't exist yet it is created and the enumerator is moved to the first item in the collection. A ScriptInfo for the next matching script or null if there are no more matches. Resolves the given path as an PSPath and ensures that it was resolved by the FileSystemProvider The path to resolve. The path that was resolved. Null if the path couldn't be resolved or was not resolved by the FileSystemProvider. Creates a collection of patterns used to find the command The name of the command to search for. A collection of the patterns used to find the command. The patterns are as follows: 1. [commandName].cmdlet 2. [commandName].ps1 3..x foreach (extension in PATHEXT) [commandName].[extension] x+1. [commandName] If contains one or more of the invalid characters defined in InvalidPathChars. Determines if the given command name is a qualified PowerShell path. The name of the command. True if the command name is either a provider-qualified or PowerShell drive-qualified path. False otherwise. Determines if the command name has any path special characters which would require resolution. If so, path lookup will not succeed. The command name (or possible path) to look for the special characters. True if the command name does not contain any special characters. False otherwise. The command name to search for Determines which command types will be globbed. Determines which types of commands to look for. The enumerator that uses the Path to search for commands. Thge execution context instance for the current engine... A routine to initialize the path searcher... If the commandName used to construct this object contains one or more of the invalid characters defined in InvalidPathChars. Resets the enumerator to before the first command match, public for IEnumerable An enumerator of the matching aliases An enumerator of the matching functions The CommandInfo that references the command that matches the pattern. The current state of the enumerator Gets the CommandInfo representing the current command match. The enumerator is positioned before the first element of the collection or after the last element. Determines which types of commands should be globbed using the specified pattern. Any flag that is not specified will only match if exact. The metadata associated with a parameter Constructs an instance of the CompiledCommandAttribute using the specified runtime-defined parameter A runtime defined parameter that contains the definition of the parameter and its metadata. True if dynamic parameters are being processed, or false otherwise. If is null. If the parameter has more than one ParameterAttribute that defines the same parameter-set name. Constructs an instance of the CompiledCommandAttribute using the reflection information retrieved from the enclosing bindable object type. The member information for the parameter True if dynamic parameters are being processed, or false otherwise. If is null. If is not a field or a property. If the member has more than one ParameterAttribute that defines the same parameter-set name. Determines if this parameter takes pipeline input for any of the specified parameter set flags. The flags for the parameter sets to check to see if the parameter takes pipeline input. True if the parameter takes pipeline input in any of the specified parameter sets, or false otherwise. Gets the parameter set data for this parameter for the specified parameter set The parameter set to get the parameter set data for. The parameter set specified data for the specified parameter set. Gets the parameter set data for this parameter for the specified parameter sets The parameter sets to get the parameter set data for. A collection for all parameter set specified data for the parameter sets specified by the . Uses the specified RuntimeDefinedParameter to generate the compiled attributes and stores them in the compiledAttributes collection. The runtime defined parameter information used to construct the compiled attributes. If contained more than one ParameterAttribute that define the same parameter-set name. Uses reflection against the MemberInfo to generate the compiled attributes and stores them in the compiledAttributes collection. The member information used to construct the compiled attributes using reflection. If contained more than one ParameterAttribute that define the same parameter-set name. Processes the Attribute metadata to generate a CompiledCommandAttribute. The name of the member the attribute was found on. The attribute to compile. If the attribute is a parameter attribute and another parameter attribute has been processed with the same parameter-set name. Extracts the data from the ParameterAttribute and creates the member data as necessary. The name of the parameter. The instance of the ParameterAttribute to extract the data from. If a parameter set name has already been declared on this parameter. Gets the alias name from the AliasAttribute and adds it to the aliases collection The AliasAttribute instance that defines the alias name. Gets the name of the parameter The PSTypeName from a PSTypeNameAttribute Gets the Type information of the attribute. If this instance was constructed with anything but the Attribute constructor, the Type information is loaded on-demand. If the type of the parameter must be dynamically loaded and a class initializer is invoked and throws an exception. Gets the Type information of the attribute. If this instance was constructed with anything but the Attribute constructor, the Type information is loaded on-demand. If the type of the parameter must be dynamically loaded and a class initializer is invoked and throws an exception. Gets whether the parameter is a dynamic parameter or not. Gets the parameter collection type information If the type of the parameter must be dynamically loaded and a class initializer is invoked and throws an exception. A collection of the attributes found on the member. The attributes have been compiled into a format that easier to digest by the metadata processor. If a parameter was discovered to define the same parameter-set multiple times when compiling the attributes. Gets the collection of data generation attributes on this parameter Gets the collection of data validation attributes on this parameter If true, null can be bound to the parameter even if the parameter is mandatory If true, an empty string can be bound to the string parameter even if the parameter is mandatory If true, an empty collection can be bound to the collection/array parameter even if the parameter is mandatory Gets or sets the value that tells whether this parameter is for the "all" parameter set Returns true if this parameter is ValueFromPipeline or ValueFromPipelineByPropertyName in one or more (but not necessarily all) parameter sets. Returns true if this parameter is Mandatory in one or more (but not necessarily all) parameter sets. Gets or sets the parameter set flags that map the parameter sets for this parameter to the parameter set names. This is a bit-field that maps the parameter sets in this parameter to the parameter sets for the rest of the command. A dictionary of the parameter sets and the parameter set specific data for this parameter The alias names for this parameter The types of collections that are supported as parameter types. Contains the collection type information for a parameter Constructs a parameter collection type information object which exposes the specified Type's collection type in a simple way. The type to determine the collection information for. The collection type of the parameter The type of the elements in the collection Provides information for MSH scripts that are directly executable by MSH but are not built into the runspace configuration. Creates an instance of the ExternalScriptInfo class with the specified name, and path. The name of the script. The path to the script The context of the currently running engine. If is null. If is null or empty. Creates an instance of ExternalScriptInfo that has no ExecutionContext. This is used exclusively to pass it to the AuthorizationManager that just uses the path parameter The name of the script. The path to the script If is null or empty. This is a copy constructor, used primarily for get-command. Common initialization for all constructors Create a copy of commandInfo for GetCommandCommand so that we can generate parameter sets based on an argument list (so we can get the dynamic parameters.) Validates the external script info Gets the path to the script file. Gets the path to the script file. Returns the syntax of a command Determine the visibility for this script... The script block that represents the external script The output type(s) is specified in the script block The command metadata for the script. True if the command has dynamic parameters, false otherwise. Gets the original contents of the script. Gets the original encoding of the script. Thrown when fail to parse #requires statements. Caught by CommandDiscovery. Defines the exception thrown when a script's requirements to run specified by the #requires statements are not met. Constructs an ScriptRequiresException. Recommended constructor for the class for #requires -shellId MyShellId. The name of the script containing the #requires statement. The ID of the shell that is incompatible with the current shell. The path to the shell specified in the #requires -shellId statement. The error id for this exception. Constructs an ScriptRequiresException. Recommended constructor for the class for #requires -version N. The name of the script containing the #requires statement. The Msh version that the script requires. The current Msh version The error id for this exception. Constructs an ScriptRequiresException. Recommended constructor for the class for the #requires -PSSnapin MyPSSnapIn statement. The name of the script containing the #requires statement. The missing snap-ins/modules that the script requires. /// Indicates whether the error message needs to be constructed for missing snap-ins/ missing modules. The error id for this exception. Constructs an ScriptRequiresException. Recommended constructor for the class for the #requires -PSSnapin MyPSSnapIn statement. The name of the script containing the #requires statement. The missing snap-ins/modules that the script requires. /// Indicates whether the error message needs to be constructed for missing snap-ins/ missing modules. The error id for this exception. The error Record for this exception. Constructs an PSVersionNotCompatibleException Constructs an PSVersionNotCompatibleException The message used in the exception. Constructs an PSVersionNotCompatibleException The message used in the exception. The exception that led to this exception. Constructs an PSVersionNotCompatibleException using serialized data. serialization information streaming context Gets the serialized data for the exception. serialization information streaming context Gets the name of the script that contained the #requires statement. Gets the PSVersion that the script requires Gets the missing snap-ins that the script requires Gets or sets the ID of the shell. Gets or sets the path to the incompatible shell Defines the name and version tuple of a PSSnapin The name of the snapin. The version of the snapin. Provides information about a filter that is stored in session state. Provides information about a function that is stored in session state. Creates an instance of the FunctonInfo class with the specified name and ScriptBlock The name of the function. The ScriptBlock for the function The execution context for the function. If is null. Creates an instance of the FunctonInfo class with the specified name and ScriptBlock The name of the function. The ScriptBlock for the function The execution context for the function. The name of the help file associated with the function. If is null. Creates an instance of the FunctonInfo class with the specified name and ScriptBlock The name of the function. The ScriptBlock for the function The options to set on the function. Note, Constant can only be set at creation time. The execution context for the function. If is null. Creates an instance of the FunctonInfo class with the specified name and ScriptBlock The name of the function. The ScriptBlock for the function The options to set on the function. Note, Constant can only be set at creation time. The execution context for the function. The name of the help file associated with the function. If is null. This is a copy constructor, used primarily for get-command. This is a copy constructor, used primarily for get-command. Create a copy of commandInfo for GetCommandCommand so that we can generate parameter sets based on an argument list (so we can get the dynamic parameters.) Updates a function. The script block that the function should represent. If true, the script block will be applied even if the filter is ReadOnly. Any options to set on the new function, null if none. If is null. Updates a function. The script block that the function should represent. If true, the script block will be applied even if the filter is ReadOnly. Any options to set on the new function, null if none. The helpfile for this function. If is null. Gets the ScriptBlock which is the implementation of the function Returns true if this function uses cmdlet binding mode for its parameters; otherwise returns false. Gets the name of the default parameter set. Returns null if this function doesn't use cmdlet parameter binding or if the default parameter set wasn't specified. Gets the definition of the function which is the ToString() of the ScriptBlock that implements the function. Gets or sets the scope options for the function. If the trying to set a function that is constant or if the value trying to be set is ScopedItemOptions.Constant Gets or sets the description associated with the function Gets the verb of the function Gets the noun of the function. Gets the help file path for the function. Returns the syntax of a command True if the command has dynamic parameters, false otherwise. The command metadata for the function or filter The output type(s) is specified in the script block Creates an instance of the FilterInfo class with the specified name and ScriptBlock The name of the filter. The ScriptBlock for the filter The ExecutionContext for the filter. If is null. Creates an instance of the FilterInfo class with the specified name and ScriptBlock The name of the filter. The ScriptBlock for the filter The ExecutionContext for the filter. The help file for the filter. If is null. Creates an instance of the FilterInfo class with the specified name and ScriptBlock The name of the filter. The ScriptBlock for the filter The options to set on the function. Note, Constant can only be set at creation time. The execution context for the filter. If is null. Creates an instance of the FilterInfo class with the specified name and ScriptBlock The name of the filter. The ScriptBlock for the filter The options to set on the function. Note, Constant can only be set at creation time. The execution context for the filter. The help file for the filter. If is null. This is a copy constructor, used primarily for get-command. This is a copy constructor, used primarily for get-command. Create a copy of commandInfo for GetCommandCommand so that we can generate parameter sets based on an argument list (so we can get the dynamic parameters.) Provides information about a workflow that is stored in session state. Creates an instance of the workflowInfo class with the specified name and ScriptBlock The name of the workflow. The script body defining the workflow. The ScriptBlock for the workflow The XAML used to define the workflow The workflows referenced within . If is null. Creates an instance of the workflowInfo class with the specified name and ScriptBlock The name of the workflow. The script body defining the workflow. The ScriptBlock for the workflow The XAML used to define the workflow The workflows referenced within . module If is null. Creates an instance of the workflowInfo class with the specified name and ScriptBlock The name of the workflow. The ScriptBlock for the workflow The ExecutionContext for the workflow. If is null. Creates an instance of the workflowInfo class with the specified name and ScriptBlock The name of the workflow. The ScriptBlock for the workflow The ExecutionContext for the workflow. The helpfile for the workflow. If is null. Creates an instance of the WorkflowInfo class with the specified name and ScriptBlock The name of the workflow. The ScriptBlock for the workflow The options to set on the function. Note, Constant can only be set at creation time. The execution context for the workflow. If is null. Creates an instance of the WorkflowInfo class with the specified name and ScriptBlock The name of the workflow. The ScriptBlock for the workflow The options to set on the function. Note, Constant can only be set at creation time. The execution context for the workflow. The helpfile for the workflow. If is null. This is a copy constructor. This is a copy constructor. Update a workflow The script block that the function should represent. If true, the script block will be applied even if the filter is ReadOnly. Any options to set on the new function, null if none. Helpfile for this function Create a copy of commandInfo for GetCommandCommand so that we can generate parameter sets based on an argument list (so we can get the dynamic parameters.) Returns the definition of the workflow. Gets the XAML that represents the definition of the workflow. Gets or sets the XAML that represents the definition of the workflow when called from another workflow. Gets the XAML for workflows called by this workflow. The get-command cmdlet. It uses the command discovery APIs to find one or more commands of the given name. It returns an instance of CommandInfo for each command that is found. method that implements get-command Writes out the accumulated matching commands Writes out the commands for the AllCommandSet using the specified CommandType Determines if the specific command information has already been written out based on the path or definition. The command information to check for duplication. true if the command has already been written out. Gets matching commands from the module tables The commandname to look for IEnumerable of CommandInfo objects Determines if the specific command information has already been added to the result from CommandSearcher The command information to check for duplication. true if the command is present in the result. Gets or sets the path(s) or name(s) of the commands to retrieve Gets or sets the verb parameter to the cmdlet Gets or sets the noun parameter to the cmdlet Gets or sets the PSSnapin/Module parameter to the cmdlet Gets or sets the type of the command to get The parameter representing the total number of commands that will be returned. If negative, all matching commands that are found will be returned. The parameter that determines if the CommandInfo or the string definition of the command is output. The parameter that all additional arguments get bound to. These arguments are used when retrieving dynamic parameters from cmdlets that support them. The parameter that determines if additional matching commands should be returned. (Additional matching functions and aliases are returned from module tables) The parameter that determines if additional matching commands from available modules should be returned. If set to true, only those commands currently in the session are returned. The parameter that filters commands returned to only include commands that have a parameter with a name that matches one of the ParameterName's arguments The parameter that filters commands returned to only include commands that have a parameter of a type that matches one of the ParameterType's arguments The comparer to sort CommandInfo objects in the result list Compare two CommandInfo objects first by their command types, and if they are with the same command type, then we compare their names. Replaces any existing metadata in this object with the metadata specified The metadata to replace in this object. A collection of the merged parameter metadata that was added. Merges the specified metdata with the other metadata already defined in this object. The compiled metadata for the type to be merged. The type of binder that the CommandProcessor will use to bind the parameters for A collection of the merged parameter metadata that was added. If a parameter name or alias described in the already exists. The next available parameter set bit. This number increments but the parameter set bit is really 1 shifted left this number of times. This number also acts as the index for the parameter set map. This is the parameter set map. The index is the number of times 1 gets shifted left to specify the bit field marker for the parameter set. The value is the parameter set name. New parameter sets are added at the nextAvailableParameterSetIndex. The name of the default parameter set Adds the parameter set name to the parameter set map and returns the index. If the parameter set name was already in the map, the index to the existing parameter set name is returned. The name of the parameter set to add. The index of the parameter set name. If the name didn't already exist the name gets added and the new index is returned. If the name already exists the index of the existing name is returned. The nextAvailableParameterSetIndex is incremented if the parameter set name is added. If more than uint.MaxValue parameter-sets are defined for the command. Loops through all the parameters and retrieves the parameter set names. In the process it generates a mapping of parameter set names to the bits in the bit-field and sets the parameter set flags for the parameter. The default parameter set name. The bit flag for the default parameter set. If more than uint.MaxValue parameter-sets are defined for the command. Gets the parameter set name for the specified parameter set. The parameter set to get the name for. The name of the specified parameter set. Helper function to retrieve the name of the parameter which defined an alias. Gets the parameters by matching its name. The name of the parameter. If true and a matching parameter is not found, an exception will be throw. If false and a matching parameter is not found, null is returned. If true we do exact matching, otherwise we do not. The invocation information about the code being run. The a collection of the metadata associated with the parameters that match the specified name. If no matches were found, an empty collection is returned. If is null or empty. Gets a collection of all the parameters that are allowed in the parameter set The bit representing the parameter set from which the parameters should be retrieved. A collection of all the parameters in the specified parameter set. Used for partial matching of parameter names Gets the number of parameter sets that were declared for the command. Gets a bit-field representing all valid parameter sets Gets a dictionary of the compiled parameter metadata for this Type. The dictionary keys are the names of the parameters and the values are the compiled parameter metdata. Gets a dictionary of the parameters that have been aliased to other names. The key is the alias name and the value is the MergedCompiledCommandParameter metadata. Makes an association between a CompiledCommandParameter and the type of the parameter binder used to bind the parameter. Constructs an association between the CompiledCommandParameter and the binder that should be used to bind it. The metadata for a parameter. The type of binder that should be used to bind the parameter. Gets the compiled command parameter for the association Gets the type of binder that the compiled command parameter should be bound with. This enum is used in the MergedCompiledCommandParameter class to associate a particular CompiledCommandParameter with the appropriate ParameterBinder. The parameter was declared as a formal parameter in the command type. The parameter was declared as a dynamic parameter for the command. The parameter is a common parameter found in the CommonParameters class. The parameter is a ShouldProcess parameter found in the ShouldProcessParameters class. The parameter is a transactions parameter found in the TransactionParameters class. The parameter is a Paging parameter found in the PagingParameters class. This is the interface between the NativeCommandProcessor and the parameter binders required to bind parameters to a minishell. This is the interface between the NativeCommandProcessor and the parameter binders required to bind parameters to a native command. Initializes the cmdlet parameter binder controller for the specified native command and engine context The command that the parameters will be bound to. Passes the binding directly through to the parameter binder. It does no verification against metadata. The name and value of the variable to bind. Ignored. True if the parameter was successfully bound. Any error condition produces an exception. Binds the specified parameters to the native command The parameters to bind. For any parameters that do not have a name, they are added to the command line arguments for the command Gets the command arguments in string form Initializes the parameter binder controller for the specified native command and engine context The command that the parameters will be bound to. Override of parent class which should not be used. The parameters to bind. For any parameters that do not have a name, they are added to the command line arguments for the command Binds the specified parameters to the native command The parameters to bind. true if minishell output is redirected. name of the calling host. For any parameters that do not have a name, they are added to the command line arguments for the command Process the args for minihsell arguments. An arraylist which contains updated arguments Handles error handling if some parameter is specified more than once. This function processes the value for -inputFormat -outputFormat parameter of minishell. Name of the parameter. Value should be -inputFormat or -outputFormat value to process Processed value Converts value of args parameter in to an encoded string Converts the value of -args parameter received from parser in to an arraylist Checks if lhs starts with value Value of input format. This property should be read after binding of parameters. Value of output format. This property should be read after binding of parameters. IF true, child minishell is invoked with no-window The parameter binder for native commands. An abstract class used by the CommandProcessor to bind parameters to a bindable object. Derived classes are used to provide specific binding behavior for different object types, like Cmdlet, PsuedoParameterCollection, and dynamic parameter objects. Constructs the parameter binder with the specified type metadata. The binder is only valid for a single instance of a bindable object and only for the duration of a command. The target object that the parameter values will be bound to. The invocation information for the code that is being bound. The context of the currently running engine. The command that the parameter binder is binding to. The command can be null. Constructs the parameter binder with the specified type metadata. The binder is only valid for a single instance of a bindable object and only for the duration of a command. The invocation information for the code that is being bound. The context of the currently running engine. The command that the parameter binder is binding to. The command can be null. The bindable object that parameters will be bound to. If this is true, then we want to record the list of bound parameters... Derived classes must override this method to get the default parameter value so that it can be restored between pipeline input The name of the parameter to get the default value of. The value of the parameter specified by name. Derived classes define this method to bind the specified value to the specified parameter. The name of the parameter to bind the value to. The value to bind to the parameter. It should be assumed by derived classes that the proper type coercion has already taken place and that any validation metadata has been satisfied. Does all the type coercion, data generation, and validation necessary to bind the parameter, then calls the protected BindParameter method to have the derived class do the actual binding. The parameter to be bound. The metadata for the parameter to use in guiding the binding. Flags for type coercion and validation. True if the parameter was successfully bound. False if is false and the type does not match the parameter type. The binding algorithm goes as follows: 1. The data generation attributes are run 2. The data is coerced into the correct type 3. The data if validated using the validation attributes 4. The data is encoded into the bindable object using the protected BindParameter method. If or is null. If argument transformation fails. or The argument could not be coerced to the appropriate type for the parameter. or The parameter argument transformation, prerequisite, or validation failed. or If the binding to the parameter fails. This method ensures that if the parameter is mandatory, and AllowNull, AllowEmptyString, and/or AllowEmptyCollection is not specified, then argument is not null or empty. The argument token. The metadata for the parameter. The type of the argument to validate against. The value that will be bound to the parameter. If true, then elements of collections will be validated against the metadata. Determines if the parameter is mandatory in any of its parametersets. The parameter metadata. True if the parameter is mandatory in any parameter-set or false otherwise. The invocation information for the code that is being bound The context of the currently running engine An instance of InternalCommand that the binder is binding to. The engine APIs that need to be passed the attributes when evaluated. Coerces the argument type to the parameter value type as needed. The argument as was specified by the command line. The name of the parameter that the coercion is taking place to bind to. It is used only for error reporting. The type to coerce the value to. The information about the collection type, like element type, etc. The current value of the argument. The value of the argument in the type of the parameter. If or is null. If the argument value is missing and the parameter is not a bool or SwitchParameter. or If the argument value could not be converted to the parameter type. Takes the current value specified and converts or adds it to a collection of the appropriate type. The argument the current value comes from. Used for error reporting. The name of the parameter. The collection type information to which the current value will be encoded. The type the current value will be converted to. The value to be encoded. If true, the element will be coerced into the appropriate type for the collection. If false, and the element isn't of the appropriate type then the out parameter will be true. This out parameter will be true if is true and the value could not be encoded into the collection because it requires coercion to the element type. A collection of the appropriate type containing the specified value. If is a collection and one of its values cannot be coerced into the appropriate type. or A collection of the appropriate could not be created. Gets or sets the bindable object that the binder will bind parameters to. Holds the set of parameters that have been bound from the command line... Constructs a NativeCommandParameterBinder The NativeCommand to bind to. .Context is null Binds a parameter for a native command (application). The name of the parameter to bind the value to. For applications this just becomes another parameter... The value to bind to the parameter. It should be assumed by derived classes that the proper type coercion has already taken place and that any prerequisite metadata has been satisfied. Stringize a non-IEnum argument to a native command, adding quotes and trailing spaces as appropriate. An array gets added as multiple arguments each of which will be stringized. Execution context instance True if an initial space should be added before adding the element The string builder to append to The object to append Add an argument to the native arg stringbuilder. If it's an IEnum, split up the individual pieces. Execution context instance The string builder to add the arg to. The argument to add The native command to bind to Gets the command arguments in string form Flags No flags specified Set when the argument should be converted to the parameter type Set when the argument should not be validated or recorded in BoundParameters Set when script blocks can be bound as a script block parameter instead of a normal argument Set when an exception will be thrown if a matching parameter could not be found. Represents an unbound parameter object in the engine. It's similar to AutomationNull.Value however AutomationNull.Value as a parameter value is used to say "use the default value for this object" whereas UnboundParameter says "this parameter is unbound, use the default only if the target type supports permits this." It's a singleton class. Sealed to prevent subclassing Represents an object of the same class (singleton class). Provides information about a cmdlet parameter for a particular parameter set. Constructs the parameter info using the specified aliases, attributes, and parameter set metadata The parameter metadata to retrieve the parameter information from. The parameter set flag to get the parameter information from. If is null. Gets the name of the parameter. Gets the type of the parameter. Gets whether or not the parameter is a dynamic parameter. True if the parameter is dynamic, or false otherwise. Gets whether or not the parameter is mandatory. True if the parameter is mandatory, or false otherwise. Gets the position in which the parameter can be specified on the command line if not named. If the returned value is int.MinValue then the parameter must be named. Gets whether the parameter can take values from the incoming pipeline object. Gets whether the parameter can take values from a property inn the incoming pipeline object with the same name as the parameter. Gets whether the parameter will take any argument that isn't bound to another parameter. Gets the help message for this parameter. Gets the aliases by which this parameter can be referenced. Gets the attributes that are specified on the parameter. The information about a parameter set and its parameters for a cmdlet Constructs the parameter set information using the specified parameter name, and type metadata. The formal name of the parameter. True if the parameter set is the default parameter set, or false otherwise. The bit that specifies the parameter set in the type metadata. The type metadata about the cmdlet. If is null or empty. If is null. Gets the synopsis for the cmdlet as a string This boolean is used to suppress common workflow parameters (or) display them separately towards the end GenerateParameters parameters in display order ie., Postional followed by Named Mandatory (in alpha numeric) followed by Named (in alpha numeric). Callers use and to handle syntax generation etc. This boolean is used to suppress common workflow parameters (or) display them separately towards the end Gets the name of the parameter set Gets whether the parameer set is the default parameter set. Gets the parameter information for the parameters in this parameter set. This class holds the data for missing mandatory parameters for each parameter set as we are trying to process which parameter set to use based on the missing mandatory parameters True if this parameter set represents the default parameter set The parameter set this data represents True if the parameter set represents parameters in all the parameter sets Gets the parameters that take pipeline input and are mandatory in this parameter set Gets the parameters that take pipeline input by value, and are mandatory in this parameter set Gets the parameters that take pipeline input by property name, and are mandatory in this parameter set Gets the parameters that do not take pipeline input and are mandatory in this parameter set Constructs an instance of the ParameterSetSpecificMetadata using the instance of the attribute that is specified. The attribute to be compiled. If is null. If HelpMessageBaseName and HelpMessageResourceId are set, the help info is loaded from the resouce indicated by HelpMessageBaseName and HelpMessageResourceId. If that fails and HelpMessage is set, the help info is set to HelpMessage; otherwise, the exception that is thrown when loading the resource is thrown. If both HelpMessageBaseName and HelpMessageResourceId are not set, the help info is set to HelpMessage Help info about the parameter If the value of the specified resource is not a string and HelpMessage is not set. If only one of HelpMessageBaseName and HelpMessageResourceId is set OR if no usable resources have been found, and there are no neutral culture resources and HelpMessage is not set. Returns true if the parameter is mandatory for this parameterset, false otherwise. If the parameter is allowed to be positional for this parameter set, this returns the position it is allowed to be in. If it is not positional, this returns int.MinValue. Returns true if the parameter is positional for this parameter set, or false otherwise. Returns true if this parameter takes all the remaining unbound arguments that were specified, or false otherwise. Specifies that this parameter can take values from the incoming pipeline object. Specifies that this parameter can take values from a property un the incoming pipeline object with the same name as the parameter. A short description for this parameter, suitable for presentation as a tool tip. The base name of the resource for a help message. The Id of the resource for a help message. Gets or sets the value that tells whether this parameter set data is for the "all" parameter set Gets the parameter set flag that represents the parameter set that this data is valid for. Constructs a container for the merged parameter metadata and parameter set specific metadata for a positional parameter The parameter binder for runtime-defined parameters which are declared through the RuntimeDefinedParameterDictionary. Constructs the parameter binder with the specified type metadata. The binder is only valid for a single instance of a bindable runtime-defined parameter collection and only for the duration of a command. The target runtime-defined parameter collection that the parameter values will be bound to. An instance of the command so that attributes can access the context. The Command line parameter collection to update... Gets the default value for the specified parameter The name of the parameter to get the value for. The value of the specified parameter Uses ETS to set the property specified by name to the value on the target bindable object. The name of the parameter to bind the value to. The value to bind to the parameter. It should be assumed by derived classes that the proper type coercion has already taken place and that any prerequisite metadata has been satisfied. If is null or empty. Hides the base class Target property to ensure the target is always a RuntimeDefinedParameterDictionary Represents a parameter declaration that can be constructed at runtime. Instances of should be returned to cmdlet implementations of . It is permitted to subclass but there is no established scenario for doing this, nor has it been tested. Constructs a runtime-defined parameter instance. Constructs a new instance of a runtime-defined parameter using the specified parameters. The name of the parameter. This cannot be null or empty. The type of the parameter value. Arguments will be coerced to this type before binding. This parameter cannot be null. Any parameter attributes that should be on the parameter. This can be any of the parameter attributes including but not limited to Validate*Attribute, ExpandWildcardAttribute, etc. If is null or empty. If is null. Gets or sets the name of the parameter If is null or empty on set. Gets or sets the type of the parameter. Arguments will be coerced to this type before being bound. If is null. Gets or sets the value of the parameter. If the value is set prior to parameter binding, the value will be reset before each pipeline object is processed. Gets or sets whether this parameter value has been set. Gets or sets the attribute collection that describes the parameter. This can be any attribute that can be applied to a normal parameter. Represents a collection of runtime-defined parameters that are keyed based on the name of the parameter. Instances of should be returned to cmdlet implementations of . It is permitted to subclass but there is no established scenario for doing this, nor has it been tested. Constructs a new instance of a runtime-defined parameter dictionary. Gets or sets the help file that documents these parameters Gets or sets private data associated with the runtime-defined parameters. The parameter binder for real CLR objects that have properties and fields decorated with the parameter attributes. Constructs the parameter binder with the specified type metadata. The binder is only valid for a single instance of a bindable object and only for the duration of a command. The target object that the parameter values will be bound to. An instance of the command so that attributes can access the context. Constructs the parameter binder with the specified type metadata. The binder is only valid for a single instance of a bindable object and only for the duration of a command. The target object that the parameter values will be bound to. An instance of the command so that attributes can access the context. The dictionary to use to record the parameters set by this object... Gets the default value for the specified parameter The name of the parameter to get the default value of. The default value of the specified parameter. If the ETS call to get the property value throws an exception. Uses ETS to set the property specified by name to the value on the target bindable object. The name of the parameter to bind the value to. The value to bind to the parameter. It should be assumed by derived classes that the proper type coercion has already taken place and that any prerequisite metadata has been satisfied. If the setter raises an exception. The command information for MSH scripts that are directly executable by MSH Creates an instance of the ScriptInfo class with the specified name, and script. The name of the script. The script definition The execution context for the script. If is null. This is a copy constructor, used primarily for get-command. Create a copy of commandInfo for GetCommandCommand so that we can generate parameter sets based on an argument list (so we can get the dynamic parameters.) for diagnostic purposes Gets the ScriptBlock that represents the implementation of the script. Gets the definition of the ScriptBlock for the script. This is the ToString() of the ScriptBlock. The output type(s) is specified in the script block True if the command has dynamic parameters, false otherwise. The command metadata for the script. The parameter binder for shell functions. Constructs a ScriptParameterBinder with the specified context The script block representing the code being run The invocation information about the code that is being run. The context under which the shell function is executing. The command instance that represents the script in a pipeline. May be null. If binding in a new local scope, the scope to set variables in. If dotting, the value is null. Gets the default value for the specified parameter The name of the parameter to get the default value of. The default value of the specified parameter. see SessionStateInternal.GetVariableValue Binds the parameters to local variables in the function scope The name of the parameter to bind the value to. The value to bind to the parameter. It should be assumed by derived classes that the proper type coercion has already taken place and that any prerequisite metadata has been satisfied. Return the default value of a script parameter, evaluating the parse tree if necessary. The script that is being bound to This is the interface between the ScriptCommandProcessor and the parameter binders required to bind parameters to a shell function. Initializes the cmdlet parameter binder controller for the specified cmdlet and engine context The script that contains the parameter metadata. The invocation information about the code being run. The engine context the cmdlet is run in. The command that the parameters will be bound to. The scope that the parameter binder will use to set parameters. Binds the command line parameters for shell functions/filters/scripts/scriptblocks The arguments to be bound. True if binding was successful or false otherwise. Passes the binding directly through to the parameter binder. It does no verification against metadata. The name and value of the variable to bind. Ignored. True if the parameter was successfully bound. Any error condition produces an exception. Binds the specified parameters to the shell function The arguments to bind. Takes the remaining arguments that haven't been bound, and binds them to $args The remaining unbound arguments. An ArrayList containing the values that were bound to $args. Holds the set of parameters that were not bound to any argument (i.e $args) A class respresenting a name that is qualified by the PSSnapin name Gets an instance of the Name class. The name of the command. An instance of the Name class. The full name A string representing the full name. Gets the command's full name. Gets the command's PSSnapin name. Gets the command's short name. This class represents the compiled metadata for a parameter set. A copy constructor that creates a deep copy of the ParameterSetMetadata object. object to copy Compares this instance with the supplied . An object to compare this instance with true if the metadata is same. false otherwise. Constructor used by rehydration Returns true if the parameter is mandatory for this parameterset, false otherwise. If the parameter is allowed to be positional for this parameter set, this returns the position it is allowed to be in. If it is not positional, this returns int.MinValue. Specifies that this parameter can take values from the incoming pipeline object. Specifies that this parameter can take values from a property from the incoming pipeline object with the same name as the parameter. Specifies if this parameter takes all the remaining unbound arguments that were specified A short description for this parameter, suitable for presentation as a tool tip. The base name of the resource for a help message. The Id of the resource for a help message. This class represents the compiled metadata for a parameter. Constructs a ParameterMetadata instance. Name of the parameter. name is null. Constructs a ParameterMetadata instance. Name of the parameter. Type of the parameter. name is null. A copy constructor that creates a deep copy of the ParameterMetadata object. Instances of Attribute and Type classes are copied by reference. object to copy An internal constructor which constructs a ParameterMetadata object from compiled commmand parameter metadata. ParameterMetadata is a proxy written on top of CompiledCommandParameter Internal CompiledCommandParameter metadata Constructor used by implicit remoting Gets a dictionary of parameter metadata for the supplied . CLR Type for which the parameter metadata is constructed. A Dictionary of ParameterMetadata keyed by parameter name. null if no parameter metadata is found. type is null. prefix that is added to every new-line. Used for tabbing content. The paramNameOverride is used as the parameter name if it is not null or empty. The parameter is for a cmdlet and requires a Parameter attribute. Generates proxy data for attributes like ValidateLength, ValidateRange etc. Attribute to process. Prefix string to add. Attribute's proxy string. Gets the name of the parameter Gets the Type information of the Parameter. Gets the ParameterSets metadata that this parameter belongs to. Specifies if the parameter is Dynamic Specifies the alias names for this parameter A collection of the attributes found on the member. Specifies if the parameter is a SwitchParameter The metadata associated with a bindable type Gets or constructs an instance of the InternalParameterMetadata for the specified runtime-defined parameters. The runtime-defined parameter collection that describes the parameters and their metadata. True if dynamic parameters are being processed, or false otherwise. Check for reserved parameter names. An instance of the TypeMetdata for the specified runtime-defined parameters. The metadata is always constructed on demand and never cached. If is null. If a parameter defines the same parameter-set name multiple times. If the attributes could not be read from a property or field. Gets or constructs an instance of the InternalParameterMetadata for the specified type. The type to get the metadata for. The current engine context. True if dynamic parameters are being processed, or false otherwise. An instance of the TypeMetdata for the specified type. The metadata may get constructed on-demand or may be retrieved from the cache. If is null. If a parameter defines the same parameter-set name multiple times. If the attributes could not be read from a property or field. Constructs an instance of the InternalParameterMetadata using the metadata in the runtime-defined parameter collection. The collection of runtime-defined parameters that declare the parameters and their metadata. True if dynamic parameters are being processed, or false otherwise. Check if the parameter name has been reserved. If is null. If a parameter defines the same parameter-set name multiple times. If the attributes could not be read from a property or field. Constructs an instance of the InternalParameterMetadata using the reflection information retrieved from the enclosing bindable object type. The type information for the bindable object True if dynamic parameters are being processed, or false otherwise. If is null. If a parameter defines the same parameter-set name multiple times. If the attributes could not be read from a property or field. The type information for the class that implements the bindable object. This member is null in all cases except when constructed with using reflection against the Type. The flags used when reflecting against the object to create the metadata Fills in the data for an instance of this class using the specified runtime-defined parameters A description of the parameters and their metadata. True if dynamic parameters are being processed, or false otherwise. Check if the parameter name has been reserved. If a parameter defines the same parameter-set name multiple times. If the attributes could not be read from a property or field. Compiles the parameter using reflection against the CLR type. True if dynamic parameters are being processed, or false otherwise. If a parameter defines the same parameter-set name multiple times. If the attributes could not be read from a property or field. Determines if the specified member represents a parameter based on its attributes The member to check to see if it is a parameter. True if at least one ParameterAttribute is declared on the member, or false otherwise. If GetCustomAttributes fails on . The cache of the type metadata. The key for the cache is the Type.FullName. Note, this is a case-sensitive dictionary because Type names are case sensitive. Gets the type name of the bindable type Gets a dictionary of the compiled parameter metadata for this Type. The dictionary keys are the names of the parameters (or aliases) and the values are the compiled parameter metdata. Gets a dictionary of the parameters that have been aliased to other names. The key is the alias name and the value is the CompiledCommandParameter metadata. Implements a cmdlet that loads a module Export the specified functions... This parameter specifies the functions to import from the module... This parameter specifies the functions to import from the module... This parameter specifies the variables to import from the module... This parameter specifies the aliases to import from the module... Implements a cmdlet that gets the list of loaded modules... This is the base class for some of the module cmdlets. It contains a number of utility functions for these classes. Load and execute the manifest psd1 file or a localized manifest psd1 file. Load and execute the manifest psd1 file or a localized manifest psd1 file. Verify the hash contains only valid members. Write an error and return false if it is not valid. Get a list of all modules which can be imported just by specifying a non rooted file name of the module (Import-Module foo\bar.psm1; but not Import-Module .\foo\bar.psm1) Get a list of the available modules which can be imported just by specifying a non rooted directory name of the module (Import-Module foo\bar; but not Import-Module .\foo\bar or Import-Module .\foo\bar.psm1) Helper function for building a module info for Get-Module -List The module file True if we should update any cached module info for this module Routine to process the module manifest data language script. The script info for the manifest script processing flags (whether to write errors / load elements) The minimum version to check the manifest against The version to check the manifest against Routine to process the module manifest data language script. The script info for the manifest script processing flags (whether to write errors / load elements) The minimum version to check the manifest against The version to check the manifest against The set of options that are used while importing a module Routine to process the module manifest data language script. The path to the manifest file The script info for the manifest script Contents of the module manifest Contents of the localized module manifest processing flags (whether to write errors / load elements) The minimum version to check the manifest against The version to check the manifest against The set of options that are used while importing a module Tracks if there were errors in the file Check if a module has been loaded. If loadElements is false, we check requireModule for correctness but do not check if the modules are loaded. Execution Context. Either a string or a hash of ModuleName, optional Guid, and ModuleVersion. Sets if the module cannot be found due to incorrect version. Sets if the module cannot be found due to incorrect guid. Sets if the module/snapin is already present. null if the module is not loaded or loadElements is false, the loaded module otherwise. Check if a module has been loaded. If loadElements is false, we check requireModule for correctness but do not check if the modules are loaded. The current module being loaded. Either a string or a hash of ModuleName, optional Guid, and ModuleVersion. Used for error messages. Specifies how to treat errors and whether to load elements Set if any errors are found. Contains error record information. null if the module is not loaded or loadElements is false, the loaded module otherwise. Check if a module has been loaded. If loadElements is false, we check requireModule for correctness but do not check if the modules are loaded. Execution Context. The current module being loaded. Either a string or a hash of ModuleName, optional Guid, and ModuleVersion. Used for error messages. Specifies how to treat errors and whether to load elements Contains error record information. null if the module is not loaded or loadElements is false, the loaded module otherwise. Verifies if a nested module is available using GetModuleIfAvailable. and will be used to create module name for searching. If is null, the name specified in nestedModuleSpec will be used. Search for a localized psd1 manifest file, using the same algorithm as Import-LocalizedData. Checks to see if the module manifest contains the specified key. If it does and it's valid, it returns true otherwise it returns false. If the key wasn't there or wasn't valid, then is set to null The hashtable to look for the key in The manifest that generated the hashtable the table key to use Specifies how to treat errors and whether to load elements Returns the extracted version Checks to see if the module manifest contains the specified key. If it does and it's valid, it returns true otherwise it returns false. If the key wasn't there or wasn't valid, then is set to null. The hashtable to look for the key in The manifest that generated the hashtable the table key to use Specifies how to treat errors and whether to load elements Returns the extracted version Checks to see if the module manifest contains the specified key. If it does and it's valid, it returns true otherwise it returns false. If the key wasn't there or wasn't valid, then is set to null The hashtable to look for the key in The manifest that generated the hashtable the table key to use Specifies how to treat errors and whether to load elements base directory of a module expected file extension (added to strings that didn't have an extension) if true then we want to error out if the specified files don't exist Returns the extracted version Enable Module logging based on group policy Get Module Logging information from the registry. Checks to see if the module manifest contains the specified key. If it does and it can be converted to the expected type, then it returns true and sets to the value. If the key is missing it returns true and sets to default() If the key is invalid then it returns false The hashtable to look for the key in The manifest that generated the hashtable the table key to use Specifies how to treat errors and whether to load elements Value from the manifest converted to the right type true if success; false if there were errors A utility routine to fix up a file name so it's rooted and has an extension The base path to use if the file is not rooted The file name to resolve. The extension to use. This utility resolves a rooted file name using the provider routines. It will only work if the path exists. The filename to resolve Execution context The resolved filename Removes a module from the session state module to remove Removes a module from the session state module to remove module name specified in the cmdlet Returns PSModuleInfo of an already loaded module if that module can be simply reimported and there is no need to proceed with a regular import Returns null if the caller should proceed with a regular import (either because there is no previously loaded module, or because the -Force flag was specified and the previously loaded module has been removed by this method) Loads a module file after searching for it using the known extension list The parent module for which this module is a nested module The name to use for the module The file basename for this module The module's extension The module base which comes from the module manifest Command name prefix The session state instance to use for this module - may be null in which case a session state will be allocated if necessary The set of options that are used while importing a module The processing flags to use when processing the module True if a module was found Loads a module file after searching for it using the known extension list The parent module for which this module is a nested module The name to use for the module The file basename for this module The module's extension The module base which comes from the module manifest Command name prefix The session state instance to use for this module - may be null in which case a session state will be allocated if necessary The set of options that are used while importing a module The processing flags to use when processing the module True if a module was found True if a module file was found Create an ExternalScriptInfo object from a file path. The path to the file The base name of the script check the current execution policy The ExternalScriptInfo object. Load a module from a file... The resolved path to load the module from The module base path to use for this module Command name prefix The session state instance to use for this module - may be null in which case a session state will be allocated if necessary The set of options that are used while importing a module The manifest processing flags to use when processing the module True if a module was found True if the module was successfully loaded Load a module from a file... The parent module, if any The resolved path to load the module from The module base path to use for this module Command name prefix The session state instance to use for this module - may be null in which case a session state will be allocated if necessary Private Data for the module The set of options that are used while importing a module The manifest processing flags to use when processing the module True if a module was found True if a module file was found True if the module was successfully loaded Load a binary module. A binary module is an assembly that should contain cmdlets. If true, then then the registered snapins will also be searched when loading. The name of the snapin or assembly to load. The path to the assembly to load The assembly to load so no lookup need be done. The module base to use for this module. The session state instance to use for this module. Normally binary modules don't have a session state instance, however when loaded through a module manifest with nested modules, it will have a session state instance to store the imported functions, aliases and variables. The set of options that are used while importing a module The manifest processing flags to use when processing the module load the types files mentioned in the snapin registration Load the formst files mentioned in the snapin registration Command name prefix Sets this to true if an assembly was found. THe module info object that was created... Load a binary module. A binary module is an assembly that should contain cmdlets. The parent module for which this module is a nested module If true, then then the registered snapins will also be searched when loading. The name of the snapin or assembly to load. The path to the assembly to load The assembly to load so no lookup need be done. The module base to use for this module. The session state instance to use for this module. Normally binary modules don't have a session state instance, however when loaded through a module manifest with nested modules, it will have a session state instance to store the imported functions, aliases and variables. The set of options that are used while importing a module The manifest processing flags to use when processing the module Command name prefix load the types files mentioned in the snapin registration Load the formst files mentioned in the snapin registration Sets this to true if an assembly was found. Short name for module. THe module info object that was created... Removes prefix from a command name and returns the command name The command name from which the prefix needs to be removed. The string containing the prefix. The command name without the prefix. Import the script-level functions from one session state to another, calling WriteVerbose for each imported member... The session state instance to use as the source of the functions Command name prefix Import the script-level functions from one session state to another, calling WriteVerbose for each imported member... The session state instance to use as the source of the functions Command name prefix The set of options that are used while importing a module This parameter specified a prefix used to modify names of imported commands Flags -force operations Flags -global operations (affects what gets returned by TargetSessionState) Flags -passthru operations Flags -passthru operations Wildcard patterns for the function to import Wildcard patterns for the cmdlets to import Wildcard patterns for the variables to import Wildcard patterns for the aliases to import The minimum version number to check the module against. Used the underlying property for derived cmdlet paramters. The version number to check the module against. Used the underlying property for derived cmdlet paramters. The arguments to pass to the scriptblock used to create the module Disable warnings on cmdlet and function names that have non-standard verbs or non-standard characters in the noun. Add module path to app domain level module path cache if name is not rooted A handy match all pattern used to initialize various import and export lists... Flags defining how a module manifest should be processed Write errors (otherwise no non-terminating-errors are written) Return null on first error (otherwise we try to process other elements of the manifest) Load elements of the manifest (i.e. types/format.ps1xml, nested modules, etc.) Write warnings Force full module manifest processing. Options set during module import Holds the value of NoClobber parameter in Import-Module This is used when importing modules. If Scope parameter is Local, this is true. Win8:90779 ServiceCore assembly is automatically imported as a nested module to process the NestedModules/RootModules/RequiredAssemblies fields in module manifests. This property is set to ensure that Import-Module of a manifest module does not expose "Import-psworkflow" cmdlet. When overridden in the derived class, interrupts currently running code within the command. It should interrupt BeginProcessing, ProcessRecord, and EndProcessing. Default implementation in the base class just returns. Releases resources associated with this object Releases resources associated with this object Write out the specified modules... This parameter specifies the current pipeline object If specified, all loaded modules should be returne, otherwise only the visible modules should be returned. If specified, then Get-Module will return the set of available modules... If specified, then Get-Module refreshes the internal cmdlet analysis cache If specified, then Get-Module will attempt to discover PowerShell modules on a remote computer using the specified session If specified, then Get-Module will attempt to discover PS-CIM modules on a remote computer using the specified session For interoperability with 3rd party CIM servers, user can specify custom resource URI For interoperability with 3rd party CIM servers, user can specify custom namespace Implements a cmdlet that loads a module Construct the Import-Module cmdlet object When overridden in the derived class, interrupts currently running code within the command. It should interrupt BeginProcessing, ProcessRecord, and EndProcessing. Default implementation in the base class just returns. Releases resources associated with this object Releases resources associated with this object BeginProcessing override Load the specified modules... Examples: c:\temp\mdir\mdir.psm1 # load absolute path ./mdir.psm1 # load relative path c:\temp\mdir\mdir # resolve by using extensions. mdir is a directory, mdir.xxx is a file. c:\temp\mdir # load default module if mdir is directory module # $PSScriptRoot/module/module.psd1 (ps1,psm1,dll) module/foobar.psm1 # $PSScriptRoot/module/module.psm1 module/foobar # $PSScriptRoot/module/foobar.XXX if foobar is not a directory... module/foobar # $PSScriptRoot/module/foobar is a directory and $PSScriptRoot/module/foobar/foobar.XXX exists module/foobar/foobar.XXX This parameter specifies whether to import to the current session state or to the global / top-level session state This parameter specified a prefix used to modify names of imported commands This parameter names the module to load. A list of assembly objects to process as modules. This patterns matching the names of functions to import from the module... This patterns matching the names of cmdlets to import from the module... This parameter specifies the variables to import from the module... This parameter specifies the aliases to import from the module... This parameter causes a module to be loaded over top of the current one... This parameter causes the session state instance to be written... This parameter causes the session state instance to be written as a custom object... The minimum version of the module to load. The version of the module to load. This parameter specifies the current pipeline object The arguments to pass to the module script. Disable warnings on cmdlet and function names that have non-standard verbs or non-standard characters in the noun. Does not import a command if a command with same name exists on the target sessionstate. Imports a command to the scope specified If specified, then Import-Module will attempt to import PowerShell modules from a remote computer using the specified session If specified, then Import-Module will attempt to import PS-CIM modules from a remote computer using the specified session For interoperability with 3rd party CIM servers, user can specify custom resource URI For interoperability with 3rd party CIM servers, user can specify custom namespace Encapsulates the basic module operations for a PowerShell engine instance... Tracer for module analysis Create a new module object from a scriptblock specifying the path to set for the module The name of the module The path where the module is rooted ScriptBlock that is executed to initialize the module... The arguments to pass to the scriptblock used to initialize the module The session state instance to use for this module - may be null The results produced from evaluating the scriptblock The newly created module info object Create a new module object from a ScriptInfo object The path where the module is rooted The script info to use to create the module The position for the command that loaded this module Optional arguments to pass to the script while executing The session state instance to use for this module - may be null The private data to use for this module - may be null The constructed module object Create a new module object from code specifying the path to set for the module The name of the module The path to use for the module root The code to use to create the module. This can be one of ScriptBlock, string or ExternalScriptInfo Arguments to pass to the module scriptblock during evaluation. The results of the evaluation of the scriptblock. The position of the caller of this function so you can tell where the call to Import-Module (or whatever) occurred. This can be null. The session state instance to use for this module - may be null The private data to use for this module - may be null The created module Allocate a new dynamic module then return a new scriptblock bound to the module instance. Context to use to create bounded script. The scriptblock to bind Whether it should be linked to the global session state or not A new scriptblock Returns true if the extension is one of the module extensions... The extension to check True if it was a module extension... Gets the module name from module path. The path to the module The module name Gets the personal module path (i.e. C:\Users\lukasza\Documents\WindowsPowerShell\modules) personal module path Gets the default system-wide module path. The default system wide module path Checks if $env:PSModulePath is not set and sets it as appropriate. Note - because these strings go through the provider, we need to escape any wildcards before passing them along. Get the current module path setting. 'preferSystemModulePath' should only be used for internal functions - by default, user modules should be able to override system modules. The module path as an array of strings Mark stuff to be exported from the current environment using the various patterns The cmdlet calling this method The session state instance to do the exports on Patterns describing the functions to export Patterns describing the cmdlets to export Patterns describing the aliases to export Patterns describing the variables to export List of Cmdlets that will not be exported, even if they match in cmdletPatterns. Used by Modules/Snapins to provide a hook to the engine for startup initialization w.r.t compiled assembly loading. Gets called when assembly is loaded. Represents module specification written in a module manifest (i.e. in RequiredModules member/field). Module manifest allows 2 forms of module specification: 1. string - module name 2. hashtable - [string]ModuleName (required) + [Version]ModuleVersion (required) + [Guid]GUID (optional) so we have a constructor that takes a string and a constructor that takes a hashtable (so that LanguagePrimitives.ConvertTo can cast a string or a hashtable to this type) Construct a module specification from the module name. The module name. Construct a module specification from a hashtable. Keys can be ModuleName, ModuleVersion, and Guid. ModuleName must be convertible to . ModuleVersion must be convertible to . Guid must be convertible to . The module specification as a hashtable. The module name. The module GUID, if specified. The module version number if specified, otherwise null. Recurse through all subdirectories of and call on all of the subdirectories. Silently skip subdirectories that have "access denied" kind of issues. Get a list of all module files which can be imported just by specifying a non rooted file name of the module (Import-Module foo\bar.psm1; but not Import-Module .\foo\bar.psm1) When obtaining all module files we return all possible combinations for a given file. For example, for foo we return both foo.psd1 and foo.psm1 if found. Get-Module will create the module info only for the first one Get a list of the available module files which can be imported just by specifying a non rooted directory name of the module (Import-Module foo\bar; but not Import-Module .\foo\bar or Import-Module .\foo\bar.psm1) Gets a list of matching commands command pattern Implements a cmdlet that creates a dynamic module from a scriptblock.. Create the new module... This parameter specifies the name to assign to the dynamic module. Specify a scriptblock to use for the module body... This parameter specifies the patterns matching the functions to import from the module... This parameter specifies the patterns matching the cmdlets to import from the module... This parameter causes the session state instance to be written... This parameter causes the session state instance to be written... The arguments to pass to the scriptblock used to create the module Cmdlet to create a new module manifest file. Return a single-quoted string. Any embedded single quotes will be doubled. The string to quote The quoted string Takes a collection of strings and returns the collection quoted. The list to quote Streamwriter to get end of line character from The quoted list This function is created to PreProcess -NestedModules in Win8. In Win7, -NestedModules is of type string[]. In Win8, we changed this to object[] to support module specification using hashtable. To be backward compatible, this function calls ToString() on any object that is not of type hashtable or string. Takes a collection of "module specifications" (string or hashtable) and returns the collection as a string that can be inserted into a module manifest The list to quote Streamwriter to get end of line character from The quoted list Takes a collection of file names and returns the collection quoted. The list to quote Streamwriter to get end of line character from The quoted list Glob a set of files then resolve them to relative paths. This routine builds a fragment of the module manifest file for a particular key. It returns a formatted string that includes a comment describing the key as well as the key and its value. The manifest key to use resourceString that holds the message The formatted manifest fragment Streamwriter to get end of line character from BeginProcessing override Generate the module manfest... The output path for the generated file... Sets the list of files to load by default... Set the GUID in the manifest file Set the author string in the manifest Set the company name in the manifest Set the copyright string in the module manifest Set the module version... Set the module version... Set the module description Set the ProcessorArchitecture required by this module Set the PowerShell version required by this module Set the CLR version required by the module. Set the version of .NET Framework required by the module. Set the name of PowerShell host required by the module. Set the version of PowerShell host required by the module. Sets the list of Dependencies for the module Sets the list of types files for the module Sets the list of formats files for the module Sets the list of ps1 scripts to run in the session state of the import-module invocation. Set the list of assemblies to load for this module. Specify any additional files used by this module. List of other modules included with this module. Like the RequiredModules key, this list can be a simple list of module names or a complex list of module hashtables. Specify any functions to export from this manifest. Specify any aliases to export from this manifest. Specify any variables to export from this manifest. Specify any cmdlets to export from this manifest. Specify any module-specific private data here. Specify the HelpInfo URI This parameter causes the module manifest string to be to the output stream... Specify the Default Command Prefix Class describing a PowerShell module... This object describes a PowerShell module... The absolute path to the module The execution context for this engine instance The module's sessionstate object - this may be null if the module is a dll. This object describes a PowerShell module... The name to use for the module. If null, get it from the path name The absolute path to the module The execution context for this engine instance The module's sessionstate object - this may be null if the module is a dll. Default constructor to create an empty module info. Default constructor to create an empty module info. Construct a PSModuleInfo instance initializing it from a scriptblock instead of a script file. The scriptblock to use to initialize the module. ToString() implementation which returns the name of the module. The name of the module Sets the name property of the PSModuleInfo object The name to set it to Sets the module version the version to set... This this module as being a compiled module... Add function to the fixed exports list the function to add Add workflow to the fixed exports list the function to add Add CmdletInfo to the fixed exports list... the cmdlet to add... Add CmdletInfo to the fixed exports list... the cmdlet to add... Add a module to the list of child modules. The module to add Add a module to the list of required modules. The module to add Add a module to the list of required modules specification The module to add Add a module to the list of modules, avoiding adding duplicates. Add alias to the detected alias list the alias to add the command it resolves to Returns a new scriptblock bound to this module instance. The original scriptblock The new bound scriptblock Invoke a scriptblock in the context of this module... The scriptblock to invoke Arguments to the scriptblock The result of the invocation Copies the local variables in the caller's cope into the module... Build a custom object out of this module... A custom object Implements deep copy of a PSModuleInfo instance. A new PSModuleInfo instance Clear out the appdomain-level module path cache. Look up a module in the appdomain wide module path cache. Module name to look up. The path to the matched module Add an entry to the appdomain level module path cache. By default, if there already is an entry it won't be replace. If force is specified, then it will be updated. \ If there is an entry for the named module in the appdomain level module path cache, remove it. The name of the module to remove from the cache True if the module was remove. True if the module had errors during loading Get/set whether to log Pipeline Execution Detail events. The name of this module. The path to the file that defined this module... If this is a script module, then this property will contain the PowerShell source text that was used to define this module. A description of this module... The guid for this module if one was defined in the module manifest. The HelpInfo for this module if one was defined in the module manifest. Get the module base directory for this module. For modules loaded via a module manifest, this will be the directory containting the manifest file rather than the directory containing the actual module file. This is particularly useful when loading a GAC'ed assembly. This value is set from the PrivateData member in the module manifest. It allows implementor specific data to be passed to the module via the manifest file. The version of this module True if the module was compiled (i.e. a .DLL) instead of being in PowerShell script... Module Author Controls the module access mode... CLR Version Company Name Copyright .NET Framework Version Lists the functions exported by this module... Lists the functions exported by this module... Gets the aggregated list of visible commands exported from the module. If there are two commands of different types exported with the same name (e.g. alias 'foo' and cmdlet 'foo') the combined dictionary will only contain the highest precidence cmdlet (e.g. the alias 'foo' since aliases shadow cmdlets. Return the merged list of exported cmdlets. This is necessary because you may have a binary module with nested modules where some cmdlets come from the module and others come from the nested module. We need to consolidate the list so it can properly be constrained. FileList ModuleList Returns the list of child modules of this module. This will only be non-empty for module manifests. PowerShell Host Name PowerShell Host Version PowerShell Version Processor Architecture Scripts to Process Required Assemblies Returns the list of required modules of this module. This will only be non-empty for module manifests. Returns the list of required modules specified in the module manifest of this module. This will only be non-empty for module manifests. Root Module This member is used to copy over the RootModule in case the module is a manifest module This is so that only ModuleInfo for modules with type=Manifest have RootModule populated Lists the variables exported by this module. Lists the aliases exported by this module. Lists the workflows exported by this module. The session state instance associated with this module. Optional script that is going to be called just before Remove-Module cmdlet removes the module The list of Format files imported by this module. The list of types files imported by this module. Enables or disables the appdomain module path cache Indicates the type of a module. Indicates that this is a script module (a powershell file with a .PSM1 extension) Indicates that this is compiled .dll containing cmdlet definitions. Indicates that this module entry was derived from a module manifest and may have child modules. Indicates that this is cmdlets-over-objects module (a powershell file with a .CDXML extension) Indicates that this is workflow module (a powershell file with a .XAML extension) Defines the possible access modes for a module... The default access mode for the module The module is readonly and can only be removed with -force The module cannot be removed. An EqualityComparer to compare 2 PSModuleInfo instances. 2 PSModuleInfos are considered equal if their Name,Guid and Version are equal. Implements a cmdlet that gets the list of loaded modules... Remove the specified modules. Modules can be specifed either through a ModuleInfo or a name. Returns a map from a module to the list of modules that require it Reports an error if no modules were removed... This parameter specifies the current pipeline object This parameter specifies the current pipeline object If provided, this paramter will allow readonly modules to be removed. Class describing a PowerShell module... AstVisitor is used for basic scenarios requiring traveral of the nodes in an Ast. An implementation of AstVisitor does not explicitly traverse the Ast, instead, the engine traverses all nodes in the Ast and calls the appropriate method on each node. By default, Class to manage the caching of analysis data. For performance, module command caching is flattened after discovery. Many modules have nested modules that can only be resolved at runtime - for example, script modules that declare: $env:PATH += "; $psScriptRoot". When doing initial analysis, we include these in 'ExportedCommands'. Changes to these type of modules will not be re-analyzed, unless the user re-imports the module, or runs Get-Module -List. This cmdlet takes a module manifest and validates the contents... Implements the record processing for this cmdlet The output path for the generated file... This class aggregates the objects necessary for the Monad engine to run. The principal constructor that most hosts will use when creating an instance of the automation engine. It allows you to pass in an instance of PSHost that provides the host-specific I/O routines, etc. Method to take a string and expand any metachars in it. Compile a piece of text into a parse tree for later execution. The text to parse The parse text as a parsetree node. Returns the handle to the execution context for this instance of the automation engine. Gets the CommandDiscovery instance for the current engine Exposes the Engine APIs for a particular instance of the engine Hide the default constructor since we always require an instance of ExecutionContext The internal constructor for this object. It should be the only one that gets called. An instance of ExecutionContext that the APIs should work against. If is null. Gets engine APIs to access the host Gets engine APIs to access the event manager Gets the engine APIs to access providers Gets the engine APIs to access session state Gets the engine APIs to invoke a command This class contains the execution context that gets passed around to commands. This is all of the information that lets you get at session state and the host interfaces. Check to see a specific version of strict mode is enabled. The check is always scoped, even though in version 1 the check was engine wide. The version for a strict check about to be performed. Get a variable out of session state. Get a variable out of session state. This calls GetVariable(name) and returns the value unless it is null in which case it returns the defaultValue provided by the caller Set a variable in session state. Same as GetEnumPreference, but for boolean values Routine to create a command(processor) instance using the factory. The name of the command to lookup The command processor object Host uses this to saves context data when entering a nested prompt A method to check to see if a particular pipe is the top level error pipe for this engine instance. the pipe instance to check true if this is the top level error pipe. Reset all of the redirection book keeping variables. This routine should be called when starting to execute a script. Appends the object to $global:error if it's an error record or exception. ErrorRecord or Exception to be written to $global:error (get-only) An error occurred accessing $ERROR. Check if the stack would overflow soon, if so, throw ScriptCallDepthException. If the stack would overflow soon. The current connection object Each pipeline has a stack of pipeline processor. This method pushes pp in to stack for currently executing pipeline. Each pipeline has a stack of pipeline processor. This method pops the top item from the stack This function is called by RunspaceConfiguration.Assemblies.Update call back. It's not used when constructing a runspace from an InitialSessionState object. Report an initialization-time error. resource string arguments Report an initialization-time error error to report Report an initialization-time error Report an initialization-time error Constructs an Execution context object for Automation Engine Engine that hosts this execution context Interface that should be used for interaction with host RunspaceConfiguration information Constructs an Execution context object for Automation Engine Engine that hosts this execution context Interface that should be used for interaction with host InitialSessionState information AssemblyResolve event handler that will look in the assembly cache to see if the named assembly has been loaded. This is necessary so that assemblies loaded with LoadFrom, which are in a different loaded context than Load, can still be used to resolve types. The event sender The event args The resolve assembly or null if not found The events received by this runspace The debugger for the interpreter The tracing mode for the interpreter. True if tracing is turned on, false if it's turned off. The step mode for the interpreter. True of stepping is turned on, false if it's turned off. Is true if the current statement in the interpreter should be traced... If true, then a script command processor should rethrow the exit exception instead of simply capturing it. This is used by the -file option on the console host. If this flag is set to true, script trace output will not be generated regardless of the state of the trace flag. The current state of the IgnoreScriptDebug flag. Gets the automation engine instance. Get the RunspaceConfiguration instance True if the RunspaceConfiguration/InitialSessionState is for a single shell or false otherwise. Added for Win8: 336382 Contains the name of the previous module that was processed. This allows you to skip this module when doing a lookup. Contains the name of the module currently being processed. This allows you to skip this module when doing a lookup. Authorization manager for this runspace Gets the appropriate provider names for the default providers based on the type of the shell (single shell or custom shell). The module information for this engine... Get the shellID for this runspace... Session State with which this instance of engine works The default or top-level session state instance for the engine. Get the SessionState facade for the internal session state APIs Get/set constraints for this execution environemnt True if this runspace has ever used constrained language mode True if we've ever used ConstrainedLanguage. If this is the case, then the binding restrictions need to also validate against the language mode. If true the PowerShell debugger will use FullLanguage mode, otherwise it will use the current language mode Gets the location globber for the session state for this instance of the runspace. The assemblies that have been loaded for this runspace The state for current engine that is running. Help system for this engine context. Hold the current command. Reference to command discovery Redirect to the CommandDiscovery in the engine. Reference to command discovery Interface that should be used for interaction with host Interface to be used for interaction with internal host. InternalHost wraps the host supplied during construction. Use this wrapper to access functionality specific to InternalHost. Interface to the public API for the engine Log context cache The PipelineWriter provided by the connection object for success output The PipelineWriter provided by the connection object for error output The PipelineWriter provided by the connection object for progress output Function and Script command processors will route their error output to this pipe if set, unless explicitly routed elsewhere. We also keep track of the first time this value is set so we can know if it's the default error output or not. Supports expression Warning output redirection. Supports expression Verbose output redirection. Supports expression Verbose output redirection. The current connection object This flag is checked by parser to stop loops etc. Indicates that there is a trap statement in a dynamically enclosing statement block that might catch an exception. True if there was a trap in the outer Shortcut to get at $? The current value of $? Shortcut to get at $error The current value of $global:error Gets the type table instance for this engine. This is somewhat complicated by the need to have a single type table in RunspaceConfig shared across all bound runspaces, as well as individual tables for instances created from InitialSessionState. Gets the format info database for this engine. This is significantly complicated by the need to have a single type table in RunspaceConfig shared across all bound runspaces, as well as individual tables for instances created from InitialSessionState. Gets the TransactionManager instance that controlls transactions in the current instance. Enum that defines state of monad engine. Engine state is not defined or initialized. Engine available Engine service is degraded Engine is out of service Engine is stopped Encapsulates $PSVersionTable. A constant to track current PowerShell Version. We can't depend on assembly version for PowerShell version. This is why we hard code the PowerShell version here. For each later relase of PowerShell, this constant needs to be updated to reflect the right version. For 2.0 PowerShell, we still use "1" as the registry version key. For 3.0 PowerShell, we still use "1" as the registry version key for Snapin and Custom shell lookup/discovery. For 3.0 PowerShell, we use "3" as the registry version key only for Engine related data like ApplicationBase. For 3.0 PowerShell, we still use "1" as the registry version key for Snapin and Custom shell lookup/discovery. A custom hashtable to delay initialization of certain PSVersionTable members WSMan interface. IWSManEx interface. CreateSession method of IWSManEx interface. An original IDL definition of CreateSession method was the following: HRESULT CreateSession ([optional, defaultvalue("")] BSTR connection, [optional, defaultvalue(0)] long flags, [optional] IDispatch* connectionOptions, [out, retval] IDispatch** ReturnValue) CreateConnectionOptions method of IWSManEx interface. An original IDL definition of CreateConnectionOptions method was the following: HRESULT CreateConnectionOptions ([out, retval] IDispatch** ReturnValue); IWSManSession interface. Get method of IWSManSession interface. An original IDL definition of Get method was the following: HRESULT Get (VARIANT resourceUri, [optional, defaultvalue(0)] long flags, [out, retval] BSTR* ReturnValue); Put method of IWSManSession interface. An original IDL definition of Put method was the following: HRESULT Put (VARIANT resourceUri, BSTR resource, [optional, defaultvalue(0)] long flags, [out, retval] BSTR* ReturnValue); Create method of IWSManSession interface. An original IDL definition of Create method was the following: HRESULT Create (VARIANT resourceUri, BSTR resource, [optional, defaultvalue(0)] long flags, [out, retval] BSTR* ReturnValue); Delete method of IWSManSession interface. An original IDL definition of Delete method was the following: HRESULT Delete (VARIANT resourceUri, [optional, defaultvalue(0)] long flags); Enumerate method of IWSManSession interface. An original IDL definition of Enumerate method was the following: HRESULT Enumerate (VARIANT resourceUri, [optional, defaultvalue("")] BSTR filter, [optional, defaultvalue("")] BSTR dialect, [optional, defaultvalue(0)] long flags, [out, retval] IDispatch** ReturnValue); Identify method of IWSManSession interface. An original IDL definition of Identify method was the following: HRESULT Identify ([optional, defaultvalue(0)] long flags, [out, retval] BSTR* ReturnValue); Represents the interface to the PowerShell eventing functionality. This class allows you to subscribe to, and receive events. Sequential event ID Returns a sequential event ID Creates a PowerShell event. An optional identifier that identifies the source event The object that generated this event Any event-specific data associated with the event. Any additional data you wish to attach to the event Generate a PowerShell event. An optional identifier that identifies the source event The object that generated this event Any event-specific data associated with the event. Any additional data you wish to attach to the event Generate a PowerShell event. An optional identifier that identifies the source event The object that generated this event Any event-specific data associated with the event. Any additional data you wish to attach to the event True if the event should be triggered in current thread. False for the event to be triggered in a separate thread. Wait for the event and associated action to be processed and completed. Adds a forwarded event to the current event manager Processes new events (which have either been generated by this instance or forwarded to it) Processes new events (which have either been generated by this instance or forwarded to it) Get the event subscription that corresponds to an identifier The identifier that identifies the source of the events Subscribes to an event on an object. The source object that defines the event The event to subscribe An optional subscription identifier to help identify this event subscription Any additional data you wish to attach to the event Any action to be invoked when the event arrives Any action to be invoked when the event arrives Whether events in this subscriber should be forwarded to the client PowerShell during remote executions Subscribes to an event on an object. The source object that defines the event The event to subscribe An optional subscription identifier to help identify this event subscription Any additional data you wish to attach to the event Any action to be invoked when the event arrives Any action to be invoked when the event arrives Whether events in this subscriber should be forwarded to the client PowerShell during remote executions Indicate how many times the subscriber should be triggered before auto-unregister it If the value is equal or less than zero, there is no limit on the number of times the event can be triggered without being unregistered Subscribes to an event on an object. The source object that defines the event The event to subscribe An optional subscription identifier to help identify this event subscription Any additional data you wish to attach to the event Any action to be invoked when the event arrives Any action to be invoked when the event arrives Whether events in this subscriber should be forwarded to the client PowerShell during remote executions Subscribes to an event on an object. The source object that defines the event The event to subscribe An optional subscription identifier to help identify this event subscription Any additional data you wish to attach to the event Any action to be invoked when the event arrives Any action to be invoked when the event arrives Whether events in this subscriber should be forwarded to the client PowerShell during remote executions Indicate how many times the subscriber should be triggered before auto-unregister it If the value is equal or less than zero, there is no limit on the number of times the event can be triggered without being unregistered Subscribes to an event on an object. The source object that defines the event The event to subscribe An optional subscription identifier to help identify this event subscription Any additional data you wish to attach to the event Any action to be invoked when the event arrives Any action to be invoked when the event arrives Whether events in this subscriber should be forwarded to the client PowerShell during remote executions True, if the handlerDelegate should be processed in the pipeline execution thread (if possible). Indicate how many times the subscriber should be triggered before auto-unregister it If the value is equal or less than zero, there is no limit on the number of times the event can be triggered without being unregistered The default value is zero Unsubscribes from an event on an object. The subscriber associated with the event subscription Represents the interface to the PowerShell event queue. Gets the list of event subscribers. This event is raised by the event manager to forward events Implementation of the PSEventManager for local runspaces. Creates a new instance of the PSEventManager class. Subscribes to an event on an object. The source object that defines the event The event to subscribe An optional subscription identifier to help identify this event subscription Any additional data you wish to attach to the event Any action to be invoked when the event arrives Any action to be invoked when the event arrives Whether events in this subscriber should be forwarded to the client PowerShell during remote executions Subscribes to an event on an object. The source object that defines the event The event to subscribe An optional subscription identifier to help identify this event subscription Any additional data you wish to attach to the event Any action to be invoked when the event arrives Any action to be invoked when the event arrives Whether events in this subscriber should be forwarded to the client PowerShell during remote executions Indicate how many times the subscriber should be triggered before auto-unregister it If the value is equal or less than zero, there is no limit on the number of times the event can be triggered without being unregistered Subscribes to an event on an object. The source object that defines the event The event to subscribe An optional subscription identifier to help identify this event subscription Any additional data you wish to attach to the event Any action to be invoked when the event arrives Any action to be invoked when the event arrives Whether events in this subscriber should be forwarded to the client PowerShell during remote executions True, if the handlerDelegate should be processed in the pipeline execution thread (if possible). Indicate how many times the subscriber should be triggered before auto-unregister it If the value is equal or less than zero, there is no limit on the number of times the event can be triggered without being unregistered The default value is zero Subscribes to an event on an object. The source object that defines the event The event to subscribe An optional subscription identifier to help identify this event subscription Any additional data you wish to attach to the event Any action to be invoked when the event arrives Any action to be invoked when the event arrives Whether events in this subscriber should be forwarded to the client PowerShell during remote executions Subscribes to an event on an object. The source object that defines the event The event to subscribe An optional subscription identifier to help identify this event subscription Any additional data you wish to attach to the event Any action to be invoked when the event arrives Any action to be invoked when the event arrives Whether events in this subscriber should be forwarded to the client PowerShell during remote executions Indicate how many times the subscriber should be triggered before auto-unregister it If the value is equal or less than zero, there is no limit on the number of times the event can be triggered without being unregistered We sample every 100ms to check if the engine is idle (currentlyRunningPipeline == null). If it's "idle" in four consecutive samples, then we believe it's actually idle. In this way we can avoid capturing possible pipeline transitions. Send on-idle event if the engine is idle. The property "AutoReset" of the timer is always false, so only one handler will be running at anytime. The timer will be enabled again if we can meet the following two conditions. 1. No PowerShell.OnIdle event is sent out 2. A PowerShell.OnIdle event is sent out, and there are still subscribers to the on-idle event Unsubscribes from an event on an object. The subscriber associated with the event subscription Unsubscribes from an event on an object. The subscriber associated with the event subscription Indicate if we should skip draining Creates a PowerShell event. An optional identifier that identifies the source event The object that generated this event Any event-specific data associated with the event. Any additional data you wish to attach to the event Adds a forwarded event to the current event manager Processes new events (which have either been generated by this instance or forwarded to it) Processes new events (which have either been generated by this instance or forwarded to it) Called from ProcessNewEvent to actually process the event. Process any pending actions. The parser calls this method before it executes any parse tree node. If we are processing pending actions, we must block the parser. To prevent starvation of the foreground script, we throttle the number of events that we process while the parser is waiting. If the parser is not waiting, we do not throttle the event processing. Auto unregister the subscriber if both 'RemainingTriggerCount' and 'RemainingActionsToProcess' become zero Drain any pending actions for a given subscriber. This is a synchronous (and expensive) operation, but is required so that unregistering for an event / stopping the event job truly discontinues those event arrivals. Get the event subscription that corresponds to an identifier The identifier that identifies the source of the events If we add event filter feature in the future, the filtering work should be done in this method, so that we only return a list of subscribers that will be invoked. Raises the ForwardEvent event Destructor for the EventManager class Disposes the EventManager class. Stop the timer if it's not null. Unsubscribes from all events. Whether to actually dispose the object. Gets the list of event subscribers. This event is raised by the event manager to forward events Implementation of PSEventManager for remote runspaces Computer on which the event was generated Runspace on which the event was generated Creates an event manager for the given runspace Computer on which the event was generated Runspace on which the event was generated Creates a PowerShell event. An optional identifier that identifies the source event The object that generated this event Any event-specific data associated with the event. Any additional data you wish to attach to the event Adds a forwarded event to the current event manager Processes new events (which have either been generated by this instance or forwarded to it) Processes new events (which have either been generated by this instance or forwarded to it) Get the event subscription that corresponds to an identifier The identifier that identifies the source of the events Subscribes to an event on an object. The source object that defines the event The event to subscribe An optional subscription identifier to help identify this event subscription Any additional data you wish to attach to the event Any action to be invoked when the event arrives Any action to be invoked when the event arrives Whether events in this subscriber should be forwarded to the client PowerShell during remote executions Subscribes to an event on an object. The source object that defines the event The event to subscribe An optional subscription identifier to help identify this event subscription Any additional data you wish to attach to the event Any action to be invoked when the event arrives Any action to be invoked when the event arrives Whether events in this subscriber should be forwarded to the client PowerShell during remote executions Indicate how many times the subscriber should be triggered before auto-unregister it If the value is equal or less than zero, there is no limit on the number of times the event can be triggered without being unregistered Subscribes to an event on an object. The source object that defines the event The event to subscribe An optional subscription identifier to help identify this event subscription Any additional data you wish to attach to the event Any action to be invoked when the event arrives Any action to be invoked when the event arrives Whether events in this subscriber should be forwarded to the client PowerShell during remote executions Subscribes to an event on an object. The source object that defines the event The event to subscribe An optional subscription identifier to help identify this event subscription Any additional data you wish to attach to the event Any action to be invoked when the event arrives Any action to be invoked when the event arrives Whether events in this subscriber should be forwarded to the client PowerShell during remote executions Indicate how many times the subscriber should be triggered before auto-unregister it If the value is equal or less than zero, there is no limit on the number of times the event can be triggered without being unregistered Unsubscribes from an event on an object. The subscriber associated with the event subscription Raises the ForwardEvent event Gets the list of event subscribers. This event is raised by the event manager to forward events Constants that represent PowerShell engine events Called when the PowerShell engine is exiting Call when the PowerShell engine is idle Called during scriptblock invocation A HashSet that contains all engine event names Represents a subscriber to an event Creates an instance of the PSEventSubscriber class for a given source object, event name, and optional source identifier Creates an instance of the PSEventSubscriber class. Additionally supports an Action scriptblock. Creates an instance of the PSEventSubscriber class. Additionally supports an Action scriptblock. Create a bound script block Determines if two PSEventSubscriber instances are equal The PSEventSubscriber to which to compare this instance Gets the hashcode that represents this PSEventSubscriber instance Get the identifier of this event subscription The object to which this event subscription applies The event object to which this event subscription applies The identifier that identifies the source of these events The action invoked when this event arrives The delegate invoked when this event arrives Get the flag that marks this event as a supporting event Gets whether to forward the event to the PowerShell client during a remote execution Gets whether the event should be processed in the pipeline execution thread. Gets whether the event should be unregistered Indicate how many new should be added to the action queue. e.g. NumberOfTimesToBeInvoked = 3 means that this subscriber only responses to the first triggered event. So three new actions will be added to the action queue, and the following events will be ignored. Indicate how many actions from this subscriber should be processed. The method "ProcessPendingAction" will unsubscribe this subscriber if it's marked as auto-unregister and this property becomes 0. Indicate if the subscriber is being subscribed by a thread The event generated when this event subscriber is unregistered The generic event handler from which specific event handlers extend. When possible, add functionality to this class instead of the IL generated by the GenerateEventHandler() method. Creates a new instance of the PsEventHandler class Creates a new instance of the PsEventHandler class for a given event manager, source identifier, and extra data The event manager to which we forward events. The object that generated this event. An optional subscription identifier that identifies the source of the event Any additional data you wish to attach to the event The event manager to which we forward events The sender of the event An optional identifier that identifies the source of the event Any additional data you wish to attach to the event Event argument associated with the event fired in a remote runspace and forwarded to the current runspace. Serialized event arguments from the event fired in a remote runspace PowerShell event arguments This class provides a generic wrapper for event arguments. event argument type Event arguments Class constructor event arguments The event arguments associated with an event Create a new instance of the PSEventArgs type Computer on which this event was generated Runspace on which this event was generated The unique identifier of the event The source of the event The object that generated this event The arguments associated with the handler of the original event. Additional data attached by the user to this event. Gets the name of the computer on which this event was generated; the value of this property is null for events generated on the local machine. Gets the unique identifier of this event Gets the unique identifier of this event Gets the object that generated this event Gets the first argument from the original event source that derives from EventArgs Gets the list of arguments captured by the original event source Gets the identifier associated with the source of this event Gets the time and date that this event was generated Gets the additional user data associated with this event Gets whether to forward the event to the PowerShell client during a remote execution When processing synchronous events, this mutex is set so we know when we can safely return. The delegate that handles notifications of new events added to the collection The event arguments associated with unsubscribing from an event Create a new instance of the PSEventUnsubscribedEventArgs type The event subscriber being unregistered The event subscriber being unregistered The delegate that handles notifications of the event being unsubscribed This class contains the collection of events received by the execution context. Add add an event to the collection The PSEventArgs instance that represents this event Don't add events to the collection directly; use the EventManager instead Removes an item at a specific index from the collection Get the enumerator of this collection Get the enumerator of this collection The event generated when a new event is received Removes an item at a specific index from the collection Gets an item at a specific index from the collection Get the synchronization root for this collection The combination of an event subscriber, and the event that was fired. This is to support the arguments to script blocks that we invoke automatically as a response to some events Get the sender of this event (the event subscriber) Get the arguments of this event (the event that was fired) A class to give a job-like interface to event actions Represents a command running in background. A job object can internally contain many child job objects. Default constructor Creates an instance of this class Command invoked by this job object Creates an instance of this class Command invoked by this job object Friendly name for the job object Creates an instance of this class Command invoked by this job object Friendly name for the job object Child jobs of this job object Creates an instance of this class Command invoked by this job object Friendly name for the job object Id and InstanceId pair to be used for this job object The JobIdentifier is a token that must be issued by PowerShell to allow reuse of the Id. This is the only way to set either Id or instance Id. Creates an instance of this class Command invoked by this job object Friendly name for the job object InstanceId to be used for this job object The InstanceId may need to be set to maintain job identity across instances of the process. Static variable which is incremented to generate id This method is introduce for delaying the loading of streams for a particular job. Unloads job streams information. Enables jobs to clear stream information from memory Load the required job streams Unload the required job streams Returns runspaces associated with the Job, including child jobs. IEnumerable of RemoteRunspaces Sets Job State. New State of Job Sets Job State. New State of Job Reason associated with the state. Stop this job object. If job contains child job, this should stop child job objects also. Returns the items in results collection after clearing up all the internal structures collection of stream objects Helper function to check if job is finished Checks if the current instance can accept changes like changing one of the properties like Output, Error etc. If changes are not allowed, throws an exception. Powershell instance cannot be changed in its current state. Object is disposed. Automatically generate a job name if the user does not supply one auto generated job name Since the user can script/program against the job name, the auto generated name will not be localizable Checks if the current powershell instance is disposed. If disposed, throws ObjectDisposedException. Object is disposed. A helper method to close all the streams. Gets the job for the specified location location to filter on collection of jobs Dispose all managed resources. This will suppress finalizer on the object from getting called by calling System.GC.SuppressFinalize(this). Release all the resources. if true, release all the managed objects. Command Invoked by this Job Status of the command execution. Wait Handle which is signaled when job is finished. This is set when state of the job is set to Completed, Stopped or Failied. unique identifier for this job Short identifier for this result which will be recycled and used within a process Name for identifying this job object List of child jobs contained within this job Success status of the command execution. Indicates that more data is available in this result object for reading. Time job was started. Time job stopped. Job type name. Result objects from this job. If this object is not a leaf node (with no children), then this will aggregate the results from all child jobs Indicates if a particular Job type uses the internal results collection Suppresses forwarding of job output into a cmdlet (like Receive-Job). This flag modifies functionality of method, so that it doesnt add output-processing to collection. Allows propagating of terminating exceptions from remote "throw" statement (normally / by default all remote errors are transformed into non-terminating errors Gets or sets the output buffer. Output of job is written into this buffer. Cannot set to a null value. Object is disposed. Gets or sets the error buffer. Errors of job are written into this buffer. Cannot set to a null value. Object is disposed. Gets or sets the progress buffer. Progress of job is written into this buffer. Cannot set to a null value. Object is disposed. Gets or sets the verbose buffer. Verbose output of job is written to this stream. Object is disposed. Gets or sets the debug buffer. Debug output of Job is written to this buffer. Cannot set to a null value. Object is disposed. Gets or sets the warning buffer. Warnings of job are written to this buffer Cannot set to a null value. Object is disposed. Indicates a location where this job is running Returns boolean indicating whether the underlying transport for the job (or child jobs) supports connect/disconnect semantics. Event raised when state of the job changes Creates a new instance of the PSEventJob class. The event manager that controls the event subscriptions The subscriber that generates these actions The script block invoked for this event The name of the job Stop Job Invoke the script block The subscriber that generated this event The context of this event Gets dynamic module where the action is invoked Message indicating status of the job indicates if more data is available This has more data if any of the child jobs have more data. Location in which this job is running The scriptblock that defines the action Base class for object-based event registration. Returns the object that generates events to be monitored Returns the event name to be monitored on the input object Check arguments Subscribe to the event on the object Parameter for an identifier for this event subscription Parameter for any action to be invoked when the event arrives Parameter for additional data to be associated with this event subscription Parameter for the flag that determines if this subscription is used to support other subscriptions Parameter for the flag that determines whether this subscription will forward its events to the PowerShell client during remote executions Parameter to indicate that the subscriber should be auto-unregistered after being triggered for specified times. If the value is equal or less than zero, there is no limit on the number of times the event can be triggered without being unregistered Gets the subscriber generated by this command Holds the information for a given breakpoint The action to take when the breakpoint is hit Gets whether this breakpoint is enabled Records how many times this breakpoint has been triggered This breakpoint's Id True if breakpoint is set on a script, false if the breakpoint is not scoped The script this breakpoint is on, or null if the breakpoint is not scoped A breakpoint on a command Gets a string representation of this breakpoint. A string representation of this breakpoint Which command this breakpoint is on The access type for variable breakpoints to break on Break on read access only Break on write access only (default) Breakon read or write access A breakpoint on a variable Gets the string representation of this breakpoint The string representation of this breakpoint The access mode to trigger this variable breakpoint on Which variable this breakpoint is on A breakpoint on a line or statement Gets a string representation of this breakpoint. A string representation of this breakpoint Which column this breakpoint is on Which line this breakpoint is on. Possible actions for the debugger after hitting a breakpoint/step Continue running until the next breakpoint, or the end of the script Step to next statement, going into functions, scripts, etc Step to next statement, going over functions, scripts, etc Step to next statement after the current function, script, etc Stop executing the script Arguments for the DebuggerStop event. Initializes the DebuggerStopEventArgs Invocation info of the code being executed The breakpoint(s) hit Note there may be more than one breakpoint on the same object (line, variable, command). A single event is raised for all these breakpoints. This property must be set in the event handler to indicate the debugger what it should do next The default action is DebuggerAction.Continue. DebuggerAction.StepToLine is only valid when debugging an script. Kinds of breakpoint updates A breakpoint was set A breakpoint was removed A breakpoint was enabled A breakpoint was disabled Arguments for the BreakpointUpdated event. Initializes the BreakpointUpdatedEventArgs Gets the breakpoint that was updated Gets the type of update Holds the debugging information for a Monad Shell session Raises the BreakpointUpdated event Checks for command breakpoints Get a breakpoint by id, primarily for Enable/Disable/Remove-PSBreakpoint cmdlets. Returns breakpoints primarily for the Get-PSBreakpoint cmdlet. Implmentation of Enable-PSBreakpoint cmdlet. Implementation of Disable-PSBreakpoint cmdlet. Raises the DebuggerStop event Resumes execution after a breakpoint/step event has been handled This is the entry point to the debugger from the Get-PSCallStack cmdlet Event raised when the debugger hits a breakpoint or a step Event raised when a breakpoint is updated The frame is hidden due to the attribute. No breakpoints will be set and no stepping in/through. This class exposes the information about the debugger that is available via $PSDebugContext InvocationInfo of the command currently being executed If not empty, indicates that the execution was suspended because one or more breakpoints were hit. Otherwise, the execution was suspended as part of a step operation. A call stack item returned by the Get-PSCallStack cmdlet. Returns a formatted string containing the ScriptName and ScriptLineNumber Return a dictionary with the names and values of variables that are "local" to the frame. ToString override. File name of the current location, or null if the frame is not associated to a script Line number of the current location, or 0 if the frame is not associated to a script The InvocationInfo of the command The position information for the current position in the frame. Null if the frame is not associated with a script. The name of the function associated with this frame. Base class for all Adapters This is the place to look every time you create a new Adapter. Consider if you should implement each of the virtual methods here. The base class deals with errors and performs additional operations before and after calling the drived virtual methods. tracer for this and derivate classes Returns the TypeNameHierarchy out of an object object to get the TypeNameHierarchy from Returns the cached typename, if it can be cached, otherwise constructs a new typename. By default, we don't return interned values, adapters can override if they choose. object to get the TypeNameHierarchy from Returns null if memberName is not a member in the adapter or the corresponding PSMemberInfo object to retrieve the PSMemberInfo from name of the member to be retrieved The PSMemberInfo corresponding to memberName from obj Retrieves all the members available in the object. The adapter implementation is encouraged to cache all properties/methods available in the first call to GetMember and GetMembers so that subsequent calls can use the cache. In the case of the .NET adapter that would be a cache from the .NET type to the public properties and fields available in that type. In the case of the DirectoryEntry adapter, this could be a cache of the objectClass to the properties available in it. object to get all the member information from all members in obj Returns the value from a property coming from a previous call to GetMember PSProperty coming from a previous call to GetMember The value of the property Sets the value of a property coming from a previous call to GetMember PSProperty coming from a previous call to GetMember value to set the property with instructs the adapter to convert before setting, if the adapter suports conversion Returns true if the property is settable property to check true if the property is settable Returns true if the property is gettable property to check true if the property is gettable Returns the name of the type corresponding to the property's value PSProperty obtained in a previous GetMember True if the result is for display purposes only the name of the type corresponding to the member Returns the string representation of the property in the object property obtained in a previous GetMember the string representation of the property in the object Returns an array with the property attributes property we want the attributes from an array with the property attributes Called after a non null return from GetMember to try to call the method with the arguments the non empty return from GetMethods invocation constraints the arguments to use the return value for the method Called after a non null return from GetMember to try to call the method with the arguments the non empty return from GetMethods the arguments to use the return value for the method Called after a non null return from GetMember to return the overloads the return of GetMember Returns the string representation of the method in the object the string representation of the method in the object Returns the name of the type corresponding to the property's value property obtained in a previous GetMember the name of the type corresponding to the member It is not necessary for derived methods to override this. This method is called only if ParameterizedProperties are present. Returns true if the property is settable property to check true if the property is settable It is not necessary for derived methods to override this. This method is called only if ParameterizedProperties are present. Returns true if the property is gettable property to check true if the property is gettable It is not necessary for derived methods to override this. This method is called only if ParameterizedProperties are present. Called after a non null return from GetMember to return the overloads the return of GetMember It is not necessary for derived methods to override this. This method is called only if ParameterizedProperties are present. Called after a non null return from GetMember to get the property value the non empty return from GetMember the arguments to use the return value for the property It is not necessary for derived methods to override this. This method is called only if ParameterizedProperties are present. Called after a non null return from GetMember to set the property value the non empty return from GetMember the value to set property with the arguments to use It is not necessary for derived methods to override this. This method is called only if ParameterizedProperties are present. Returns the string representation of the property in the object property obtained in a previous GetMember the string representation of the property in the object It is not necessary for derived methods to override this. This method is called only if ParameterizedProperties are present. Compare the 2 methods, determining which method is better. 1 if method1 is better, -1 if method2 is better, 0 otherwise. Returns -1 if is less specific than (1 otherwise, or 0 if both are equally specific or non-comparable) Return the best method out of overlaoded methods. The best has the smallest type distance between the method's parameters and the given arguments. different overloads for a method invocation constraints arguments to check against the overloads if no best method, the error id to use in the error message if no best method, the error message (format string) to use in the error message true if the best method's last parameter is a params method Called in GetBestMethodAndArguments after a call to FindBestMethod to perform the type conversion, copying(varArg) and optional value setting of the final arguments. Auxilliary method in MethodInvoke to set newArguments[index] with the propper value used for the MethodException that might be thrown the complete array of arguments the complete array of new arguments the parameter to use the index in newArguments to set ordered and case insensitive hashtable Stores method related information. This structure should be used whenever a new type is adapted. For example, ManagementObjectAdapter uses this structure to store WMI method information. This constructor supports .net methods Stores parameter related information. This structure should be used whenever a new type is adapted. For example, ManagementObjectAdapter uses this structure to store method parameter information. This is the adapter used for all objects that don't match the appropriate types for other adapters. It uses reflection to retrieve property information. CLR reflection property cache for instance properties CLR reflection property cache for static properties CLR reflection method cache for instance methods CLR reflection method cache for static methods CLR reflection method cache for instance events CLR reflection method cache for static events Compare the signatures of the methods, returning true if the methods have the same signature. Adds an overload to a list of MethodInfo. Before adding to the list, the list is searched to make sure we don't end up with 2 functions with the same signature. This can happen when there is a newslot method. Called from GetMethodReflectionTable within a lock to fill the method cache table type to get methods from table to be filled bindingFlags to use Called from GetEventReflectionTable within a lock to fill the event cache table type to get events from table to be filled bindingFlags to use This method is necessary becausean overridden property in a specific class derived from a generic one will appear twice. The second time, it should be ignored. Called from GetPropertyReflectionTable within a lock to fill the property cache table type to get properties from table to be filled bindingFlags to use Called from GetProperty and GetProperties to populate the typeTable with all public properties and fields of type. type to load properties for Retrieves the table for static methods type to load methods for Retrieves the table for static events object containing properties to load in typeTable Called from GetProperty and GetProperties to populate the typeTable with all public properties and fields of type. type with properties to load in typeTable Retrieves the table for instance methods type with methods to load in typeTable Retrieves the table for instance events object containing methods to load in typeTable Returns true if a parameterized property should be in a PSMemberInfoCollection of type t Type of a PSMemberInfoCollection like the type of T in PSMemberInfoCollection of T true if a parameterized property should be in a collection Usually typeof(T).IsAssignableFrom(typeof(PSParameterizedProperty)) would work like it does for PSMethod and PSProperty, but since PSParameterizedProperty derives from PSMethodInfo and since we don't want to have ParameterizedProperties in PSMemberInfoCollection of PSMethodInfo we need this method. Returns null if memberName is not a member in the adapter or the corresponding PSMemberInfo object to retrieve the PSMemberInfo from name of the member to be retrieved The PSMemberInfo corresponding to memberName from obj Retrieves all the members available in the object. The adapter implementation is encouraged to cache all properties/methods available in the first call to GetMember and GetMembers so that subsequent calls can use the cache. In the case of the .NET adapter that would be a cache from the .NET type to the public properties and fields available in that type. In the case of the DirectoryEntry adapter, this could be a cache of the objectClass to the properties available in it. object to get all the member information from all members in obj Returns an array with the property attributes property we want the attributes from an array with the property attributes Returns the string representation of the property in the object property obtained in a previous GetMember the string representation of the property in the object Returns the value from a property coming from a previous call to GetMember PSProperty coming from a previous call to GetMember The value of the property Sets the value of a property coming from a previous call to GetMember PSProperty coming from a previous call to GetMember value to set the property with instructs the adapter to convert before setting, if the adapter suports conversion Returns true if the property is settable property to check true if the property is settable Returns true if the property is gettable property to check true if the property is gettable Returns the name of the type corresponding to the property's value PSProperty obtained in a previous GetMember True if the result is for display purposes only the name of the type corresponding to the member Calls constructor using the arguments and catching the appropriate exception final arguments to the constructor the return of the constructor Information about the method to call. Used for setting references. Original arguments in the method call. Used for setting references. if the constructor throws an exception Calls method on target using the arguments and catching the appropriate exception object we want to call the method on final arguments to the method Information about the method to call. Used for setting references. Original arguments in the method call. Used for setting references. the return of the method if the method throws an exception Converts a MethodBase[] into a MethodInformation[] the methods to be converted the MethodInformation[] corresponding to methods Calls the method best suited to the arguments on target. used for error messages object to call the method on method information corresponding to methods invocation constraints arguiments of the call the return of the method if the method throws an exception if we could not find a method for the given arguments Calls the method best suited to the arguments on target. the type being constructed, used for diagnostics and caching all overloads for the constructors arguments of the call the return of the method if the method throws an exception if we could not find a method for the given arguments this is a flavor of MethodInvokeDotNet to deal with a peculiarity of property setters: Tthe setValue is always the last parameter. This enables a parameter after a varargs or optional parameters and GetBestMethodAndArguments is not prepared for that. This method disregards the last parameter in its call to GetBestMethodAndArguments used in this case more for its "Arguments" side than for its "BestMethod" side, since there is only one method. Called after a non null return from GetMember to try to call the method with the arguments the non empty return from GetMethods the arguments to use the return value for the method Called after a non null return from GetMember to try to call the method with the arguments the non empty return from GetMethods invocation constraints the arguments to use the return value for the method Called after a non null return from GetMember to return the overloads the return of GetMember Returns the name of the type corresponding to the property's value property obtained in a previous GetMember the name of the type corresponding to the member Returns true if the property is settable property to check true if the property is settable Returns true if the property is gettable property to check true if the property is gettable Called after a non null return from GetMember to get the property value the non empty return from GetMember the arguments to use the return value for the property Called after a non null return from GetMember to set the property value the non empty return from GetMember the value to set property with the arguments to use Called after a non null return from GetMember to return the overloads Returns the string representation of the property in the object property obtained in a previous GetMember the string representation of the property in the object This is used by PSObject to support dotnet member lookup for the adapted objects. This class is created to avoid cluttering DotNetAdapter with if () { } blocks . Return a collection representing the object's members as returned by CLR reflection. Returns a member representing the as given by CLR reflection. Used only to add a COM style type name to a COM interop .NET type Adapter used for GetMember and GetMembers only. All other methods will not be called. Returns an array with the property attributes property we want the attributes from an array with the property attributes Returns the value from a property coming from a previous call to GetMember PSProperty coming from a previous call to GetMember The value of the property Sets the value of a property coming from a previous call to GetMember PSProperty coming from a previous call to GetMember value to set the property with instructs the adapter to convert before setting, if the adapter suports conversion Returns true if the property is settable property to check true if the property is settable Returns true if the property is gettable property to check true if the property is gettable Returns the name of the type corresponding to the property's value PSProperty obtained in a previous GetMember True if the result is for display purposes only the name of the type corresponding to the member Returns the string representation of the property in the object property obtained in a previous GetMember the string representation of the property in the object Called after a non null return from GetMember to try to call the method with the arguments the non empty return from GetMethods the arguments to use the return value for the method Called after a non null return from GetMember to return the overloads the return of GetMember adapter for properties in the inside PSObject if it has a null BaseObject Returns the TypeNameHierarchy out of an object object to get the TypeNameHierarchy from Returns null if memberName is not a member in the adapter or the corresponding PSMemberInfo object to retrieve the PSMemberInfo from name of the member to be retrieved The PSMemberInfo corresponding to memberName from obj Retrieves all the members available in the object. The adapter implementation is encouraged to cache all properties/methods available in the first call to GetMember and GetMembers so that subsequent calls can use the cache. In the case of the .NET adapter that would be a cache from the .NET type to the public properties and fields available in that type. In the case of the DirectoryEntry adapter, this could be a cache of the objectClass to the properties available in it. object to get all the member information from all members in obj adapter for properties inside a member set Returns null if memberName is not a member in the adapter or the corresponding PSMemberInfo object to retrieve the PSMemberInfo from name of the member to be retrieved The PSMemberInfo corresponding to memberName from obj Retrieves all the members available in the object. The adapter implementation is encouraged to cache all properties/methods available in the first call to GetMember and GetMembers so that subsequent calls can use the cache. In the case of the .NET adapter that would be a cache from the .NET type to the public properties and fields available in that type. In the case of the DirectoryEntry adapter, this could be a cache of the objectClass to the properties available in it. object to get all the member information from all members in obj Base class for all adapters that adapt only properties and retain .NET methods Returns null if propertyName is not a property in the adapter or the corresponding PSProperty with its adapterData set to information to be used when retrieving the property. object to retrieve the PSProperty from name of the property to be retrieved The PSProperty corresponding to propertyName from obj Retrieves all the properties available in the object. object to get all the property information from collection where the properties will be added Returns null if memberName is not a member in the adapter or the corresponding PSMemberInfo object to retrieve the PSMemberInfo from name of the member to be retrieved The PSMemberInfo corresponding to memberName from obj Retrieves all the members available in the object. The adapter implementation is encouraged to cache all properties/methods available in the first call to GetMember and GetMembers so that subsequent calls can use the cache. In the case of the .NET adapter that would be a cache from the .NET type to the public properties and fields available in that type. In the case of the DirectoryEntry adapter, this could be a cache of the objectClass to the properties available in it. object to get all the member information from all members in obj Deals with DataRow objects Retrieves all the properties available in the object. object to get all the property information from collection where the members will be added Returns null if propertyName is not a property in the adapter or the corresponding PSProperty with its adapterData set to information to be used when retrieving the property. object to retrieve the PSProperty from name of the property to be retrieved The PSProperty corresponding to propertyName from obj Returns the name of the type corresponding to the property PSProperty obtained in a previous DoGetProperty True if the result is for display purposes only the name of the type corresponding to the property Returns true if the property is settable property to check true if the property is settable Returns true if the property is gettable property to check true if the property is gettable Returns the value from a property coming from a previous call to DoGetProperty PSProperty coming from a previous call to DoGetProperty The value of the property Sets the value of a property coming from a previous call to DoGetProperty PSProperty coming from a previous call to DoGetProperty value to set the property with instructs the adapter to convert before setting, if the adapter suports conversion Deals with DataRowView objects Retrieves all the properties available in the object. object to get all the property information from collection where the members will be added Returns null if propertyName is not a property in the adapter or the corresponding PSProperty with its adapterData set to information to be used when retrieving the property. object to retrieve the PSProperty from name of the property to be retrieved The PSProperty corresponding to propertyName from obj Returns the name of the type corresponding to the property PSProperty obtained in a previous DoGetProperty True if the result is for display purposes only the name of the type corresponding to the property Returns true if the property is settable property to check true if the property is settable Returns true if the property is gettable property to check true if the property is gettable Returns the value from a property coming from a previous call to DoGetProperty PSProperty coming from a previous call to DoGetProperty The value of the property Sets the value of a property coming from a previous call to DoGetProperty PSProperty coming from a previous call to DoGetProperty value to set the property with instructs the adapter to convert before setting, if the adapter suports conversion Deals with XmlNode objects Returns the TypeNameHierarchy out of an object object to get the TypeNameHierarchy from Retrieves all the properties available in the object. object to get all the property information from collection where the members will be added Returns null if propertyName is not a property in the adapter or the corresponding PSProperty with its adapterData set to information to be used when retrieving the property. object to retrieve the PSProperty from name of the property to be retrieved The PSProperty corresponding to propertyName from obj Returns true if the property is settable property to check true if the property is settable Returns true if the property is gettable property to check true if the property is gettable Returns the value from a property coming from a previous call to DoGetProperty PSProperty coming from a previous call to DoGetProperty The value of the property Sets the value of a property coming from a previous call to DoGetProperty PSProperty coming from a previous call to DoGetProperty value to set the property with instructs the adapter to convert before setting, if the adapter suports conversion Returns the name of the type corresponding to the property PSProperty obtained in a previous DoGetProperty True if the result is for display purposes only the name of the type corresponding to the property Auxilliary in GetProperty to perform case sensitive and case insensitve searches in the child nodes XmlNode to extract property from property to look for type pf comparison to perform the corresponding XmlNode or null if not present Deals with DirectoryEntry objects Returns null if memberName is not a member in the adapter or the corresponding PSMemberInfo object to retrieve the PSMemberInfo from name of the member to be retrieved The PSMemberInfo corresponding to memberName from obj Retrieves all the members available in the object. The adapter implementation is encouraged to cache all properties/methods available in the first call to GetMember and GetMembers so that subsequent calls can use the cache. In the case of the .NET adapter that would be a cache from the .NET type to the public properties and fields available in that type. In the case of the DirectoryEntry adapter, this could be a cache of the objectClass to the properties available in it. object to get all the member information from all members in obj Returns the value from a property coming from a previous call to GetMember PSProperty coming from a previous call to GetMember The value of the property Sets the value of a property coming from a previous call to GetMember PSProperty coming from a previous call to GetMember value to set the property with instructs the adapter to convert before setting, if the adapter suports conversion Returns true if the property is settable property to check true if the property is settable Returns true if the property is gettable property to check true if the property is gettable Returns the name of the type corresponding to the property's value PSProperty obtained in a previous GetMember True if the result is for display purposes only the name of the type corresponding to the member Called after a non null return from GetMember to try to call the method with the arguments the non empty return from GetMethods the arguments to use the return value for the method Returns the string representation of the method in the object the string representation of the method in the object Internal wrapper for third-party adapters (PSPropertyAdapter) Returns the TypeNameHierarchy out of an object Retrieves all the properties available in the object. Returns null if propertyName is not a property in the adapter or the corresponding PSProperty with its adapterData set to information to be used when retrieving the property. Ensures that the adapter and base object are set in the given PSAdaptedProperty Returns true if the property is settable Returns true if the property is gettable Returns the value from a property coming from a previous call to DoGetProperty Sets the value of a property coming from a previous call to DoGetProperty Returns the name of the type corresponding to the property The type this instance is adapting The type of the external adapter User-defined property adapter This class is used to expose a simplified version of the type adapter API Returns the type hiercharchy for the given object Returns a list of the adapted properties Returns a specific property, or null if the base object does not contain the given property Returns true if the given property is settable Returns true if the given property is gettable Returns the value of a given property Sets the value of a given property Returns the type for a given property Implements Adapter for the COM objects. Constructor for the ComAdapter typeinfo for the com object we are adapting Returns the TypeNameHierarchy out of an object object to get the TypeNameHierarchy from Returns null if memberName is not a member in the adapter or the corresponding PSMemberInfo object to retrieve the PSMemberInfo from name of the member to be retrieved The PSMemberInfo corresponding to memberName from obj Retrieves all the members available in the object. The adapter implementation is encouraged to cache all properties/methods available in the first call to GetMember and GetMembers so that subsequent calls can use the cache. In the case of the .NET adapter that would be a cache from the .NET type to the public properties and fields available in that type. In the case of the DirectoryEntry adapter, this could be a cache of the objectClass to the properties available in it. object to get all the member information from all members in obj Returns an array with the property attributes property we want the attributes from an array with the property attributes Returns the value from a property coming from a previous call to DoGetProperty PSProperty coming from a previous call to DoGetProperty The value of the property Sets the value of a property coming from a previous call to DoGetProperty PSProperty coming from a previous call to DoGetProperty value to set the property with instructs the adapter to convert before setting, if the adapter suports conversion Returns true if the property is settable property to check true if the property is settable Returns true if the property is gettable property to check true if the property is gettable Returns the name of the type corresponding to the property PSProperty obtained in a previous DoGetProperty True if the result is for display purposes only the name of the type corresponding to the property get the property signature. property object whose signature we want string representing the signature of the property Called after a non null return from GetMethodData to try to call the method with the arguments the non empty return from GetMethods the arguments to use the return value for the method Called after a non null return from GetMethodData to return the overloads the return of GetMethodData Returns the name of the type corresponding to the property's value property obtained in a previous GetMember the name of the type corresponding to the member Returns true if the property is settable property to check true if the property is settable Returns true if the property is gettable property to check true if the property is gettable Called after a non null return from GetMember to get the property value the non empty return from GetMember the arguments to use the return value for the property Called after a non null return from GetMember to set the property value the non empty return from GetMember the value to set property with the arguments to use Returns the string representation of the property in the object property obtained in a previous GetMember the string representation of the property in the object Called after a non null return from GetMember to return the overloads the return of GetMember Summary description for IDispatch. Defines a method in the COM object. Initializes new instance of ComMethod class. Updates funcdesc for method information. index of funcdesc for method in type information. Returns the different method overloads signatures. Invokes the method on object represents the instance of the method we want to invoke parameters to be passed to the method returns the value of method call Defines the name of the method. Defines a property in the COM object. Initializes a new instance of ComProperty. reference to the ITypeInfo of the COM object name of the property being created. Retrieves the index of the FUNCDESC for the current property. Get value of this property instance of the object from which to get the property value value of the property Get value of this property instance of the object from which to get the property value parameters to get the property value value of the property Sets value of this property. instance of the object to which to set the property value value to set this property Sets the value of the property. instance of the object to which to set the property value value to set this property parameters to set this property. Updates the COM property with setter and getter information. functional descriptor for property getter or setter index of function descriptor in type information Returns the property signature string property signature Defines the name of the property. Defines the type of the property. Defines whether the property has parameters or not. Returns the number of parameters in this property. This is applicable only for parameterized properties. Defines whether this property is settable. Defines whether this property is gettable. A Wrapper class for COM object's Type Information Member variables. Constructor ITypeInfo object being wrapped by this object Initializes the typeinfo object Get the typeinfo interface for the given comobject. reference to com object for which we are getting type information. ComTypeInfo object which wraps the ITypeInfo interface of the given COM object Get TypeAttr for the given type information. reference to ITypeInfo from which to get TypeAttr Get the IDispatch Typeinfo from CoClass typeinfo. Reference to the type info to which the type descriptor belongs ITypeInfo reference to the Dispatch interface Collection of properties in the COM object. Collection of methods in the COM object. Returns the string of the GUID for the type information. Defines a utility class that is used by COM adapter. Gets Method Signature from FuncDesc describing the method. ITypeInfo interface of the object FuncDesc which defines the method True if this is a property put; these properties take their return type from their first paramenter signature of the method Gets the name of the method or property defined by funcdesc ITypeInfo interface of the type FuncDesc of property of method name of the method or property Gets the name of the custom type defined in the type library ITypeInfo interface of the type reference to the custom type name of the custom type This function gets a string representation of the Type Descriptor This is used in generating signature for Properties and Methods. Reference to the type info to which the type descriptor belongs reference to type descriptor which is being converted to string from string representation of the type descriptor Determine .net type for the given type descriptor COM type descriptor to convert type represented by the typedesc Converts a FuncDesc out of GetFuncDesc into a MethodInformation Obtains the parameter information for a given FuncDesc Converts a MethodBase[] into a MethodInformation[] the ComMethodInformation[] corresponding to methods IInspectable represents the base interface for all WinRT types. Any run time class exposed through WInRT language projections like C#, VB.Net, C++ and JavaScript would have implemented the IInspectable interface. This interface is needed on long term basis to efficiently support identifying WinRT type instances created in Powershell session. Hence being included as part of SMA. The only purpose of this interface is to identify if the created object is of WinRT type. Users should not implement this interface for any custom functionalities. This is like a PInvoke. WinRT team have defined IInspectable in the COM layer. Through PInvoke this interface is being used in the managed layer. Helper class for WinRT types. Defines a base class implemented when you need to customize the type conversion for a target class. There are two ways of associating the PSTypeConverter with its target class: - Through the type configuration file. - By applying a TypeConverterAttribute to the target class. Unlike System.ComponentModel.TypeConverter, PSTypeConverter can be applied to a family of types (like all types derived from System.Enum). PSTypeConverter has two main differences from TypeConverter: - It can be applied to a family of types and not only the one type as in TypeConverter. In order to do that ConvertFrom and CanConvertFrom receive destinationType to know to which type specifically we are converting sourceValue. - ConvertTo and ConvertFrom receive formatProvider and ignoreCase. Other differences to System.ComponentModel.TypeConverter: - There is no ITypeDescriptorContext. - This class is abstract Determines if the converter can convert the parameter to the parameter. value supposedly *not* of the types supported by this converted to be converted to the parameter one of the types supported by this converter to which the parameter should be converted True if the converter can convert the parameter to the parameter, otherwise false. Determines if the converter can convert the parameter to the parameter. value supposedly *not* of the types supported by this converted to be converted to the parameter one of the types supported by this converter to which the parameter should be converted True if the converter can convert the parameter to the parameter, otherwise false. Converts the parameter to the parameter using formatProvider and ignoreCase value supposedly *not* of the types supported by this converted to be converted to the parameter one of the types supported by this converter to which the parameter should be converted to The format provider to use like in IFormatable's ToString true if case should be ignored the parameter converted to the parameter using formatProvider and ignoreCase if no conversion was possible Converts the parameter to the parameter using formatProvider and ignoreCase value supposedly *not* of the types supported by this converted to be converted to the parameter one of the types supported by this converter to which the parameter should be converted to The format provider to use like in IFormatable's ToString true if case should be ignored the parameter converted to the parameter using formatProvider and ignoreCase if no conversion was possible Returns true if the converter can convert the parameter to the parameter value supposedly from one of the types supported by this converter to be converted to the parameter type to convert the parameter, supposedly not one of the types supported by the converter True if the converter can convert the parameter to the parameter, otherwise false. Returns true if the converter can convert the parameter to the parameter value supposedly from one of the types supported by this converter to be converted to the parameter type to convert the parameter, supposedly not one of the types supported by the converter True if the converter can convert the parameter to the parameter, otherwise false. Converts the parameter to the parameter using formatProvider and ignoreCase value supposedly from one of the types supported by this converter to be converted to the parameter type to convert the parameter, supposedly not one of the types supported by the converter The format provider to use like in IFormatable's ToString true if case should be ignored sourceValue converted to the parameter using formatProvider and ignoreCase if no conversion was possible Converts the parameter to the parameter using formatProvider and ignoreCase value supposedly from one of the types supported by this converter to be converted to the parameter type to convert the parameter, supposedly not one of the types supported by the converter The format provider to use like in IFormatable's ToString true if case should be ignored sourceValue converted to the parameter using formatProvider and ignoreCase if no conversion was possible Enables a type that only has conversion from string to be converted from all other types through string It is permitted to subclass but there is no established scenario for doing this, nor has it been tested. This will return false only if sourceValue is string value to convert from ignored false only if sourceValue is string Converts to destinationType by first converting sourceValue to string and then converting the result to destinationType. The value to convert from The type this converter is associated with The IFormatProvider to use true if case should be ignored sourceValue converted to destinationType When no conversion was possible Returns false, since this converter is not designed to be used to convert from the type associated with the converted to other types. The value to convert from The value to convert from false Throws NotSupportedException, since this converter is not designed to be used to convert from the type associated with the converted to other types. The value to convert from The value to convert from The IFormatProvider to use true if case should be ignored This method does not return a value. NotSupportedException is always thrown The ranking of versions for comparison purposes (used in overload resolution.) A larger value means the conversion is better. Note that the lower nibble is all ones for named conversion ranks. This allows for conversions with rankings in between the named values. For example, int=>string[] is value dependent, if the conversion from int=>string succeeds, then an array is created, otherwise we try some other conversion. The int=>string[] conversion should be worse than int=>string, but it is probably better than many other conversions, so we want it to be only slightly worse than int=>string. ValueDependent is a flag, but we don't mark the enum as flags because it really isn't a flags enum. To make debugging easier, the "in between" conversions are all named, though there are no references in the code. They all use the suffix S2A which means "scalar to array". Defines language support methods Retrieves the IEnumerable of obj or null if the language does not consider obj to be IEnumerable IEnumerable or IEnumerable-like object Retrieves the IEnumerator of obj or null if the language does not consider obj as capable of returning an IEnumerator IEnumerable or IEnumerable-like object When the act of getting the enumerator throws an exception This method takes a an arbitrary object and wraps it in a PSDataCollection of PSObject. This simplifies interacting with the PowerShell workflow activities. Used to compare two objects for equality converting the second to the type of the first, if required. first object object to compare first to true if first is equal to the second Used to compare two objects for equality converting the second to the type of the first, if required. first object object to compare first to used only if first and second are strings to specify the type of string comparison true if first is equal to the second Used to compare two objects for equality converting the second to the type of the first, if required. first object object to compare first to used only if first and second are strings to specify the type of string comparison the format/culture to be used. If this parameter is null, CultureInfo.InvariantCulture will be used. true if first is equal to the second Compare first and second, converting second to the type of the first, if necessary. first comparison value second comparison value less than zero if first is smaller than second, more than zero if it is greater or zero if they are the same does not implement IComparable or cannot be converted to the type of . Compare first and second, converting second to the type of the first, if necessary. first comparison value second comparison value Used if both values are strings less than zero if first is smaller than second, more than zero if it is greater or zero if they are the same does not implement IComparable or cannot be converted to the type of . Compare first and second, converting second to the type of the first, if necessary. first comparison value second comparison value Used if both values are strings Used in type conversions and if both values are strings less than zero if first is smaller than second, more than zero if it is greater or zero if they are the same does not implement IComparable or cannot be converted to the type of . Returns true if the language considers obj to be true obj to verify if it is true true if obj is true Internal routine that determines if an object meets any of our criteria for null. The object to test true if the object is null Auxilliary for the cases where we want a new PSObject or null Table of the largest safe type to which both types can be converted without exceptions. This table is used for numeric comparisons. The 4 entries marked as not used, are explicitly dealt with in NumericCompareDecimal. NumericCompareDecimal exists because doubles and singles can throw an exception when converted to decimal. The order of lines and columns cannot be changed since NumericCompare depends on it. Necessary not to return an integer type code for enums Emulates the "As" C# language primitive, but will unwrap the PSObject if required. The type for which to convert The object from which to convert An object of the specified type, if the conversion was successful. Returns null otherwise. Verifies if type is a signed integer type code to check true if type is a signed integer, false otherwise Verifies if type is an unsigned integer type code to check true if type is an unsigned integer, false otherwise Verifies if type is integer type code to check true if type is integer, false otherwise Verifies if type is a floating point number type code to check true if type is floating point, false otherwise Verifies if type is an integer or floating point number type code to check true if type is integer or floating point, false otherwise Verifies if type is a CIM intrinsic type type code to check true if type is CIM intrinsic type, false otherwise Verifies if type is one of the boolean types type to check true if type is one of boolean types, false otherwise Verifies if type is one of switch parameter types type to check true if type is one of switch parameter types, false otherwise Verifies if type is one of boolean or switch parameter types type to check true if type if one of boolean or switch parameter types, false otherwise Do the necessary conversions when using property or array assignment to a generic dictionary: $dict.Prop = value $dict[$Prop] = value The property typically won't need conversion, but it could. The value is more likely in need of conversion. The dictionary that potentially implement The object representing the key The value to assign backupTypeTable: Used by Remoting Rehydration Logic. While Deserializing a remote object, LocalPipeline.ExecutionContextFromTLS() might return null..In which case this TypeTable will be used to do the conversion. A type IsPublic if IsPublic or (IsNestedPublic and is nested in public type(s)) This routine converts a string into a Type object using the msh rules. A string representing the name of the type to convert The exception, if one happened, trying to find the type A type if the conversion was successful, null otherwise. Converts valueToConvert to resultType A null valueToConvert can be converted to : string - returns "" char - returns '\0' numeric types - returns 0 converted to the appropriate type boolean - returns LanguagePrimitives.IsTrue(null) PSObject - returns new PSObject()) array - returns an array with null in array[0] non value types - returns null The following conversions are considered language standard and cannot be customized: - from derived to base class - returns valueToConvert intact - to PSObject - returns PSObject.AsPSObject(valueToConvert) - to void - returns AutomationNull.Value - from array/IEnumerable to array - tries to convert array/IEnumerable elements - from object of type X to array of X - returns an array with object as its only element - to bool - returns LanguagePrimitives.IsTrue(valueToConvert) - to string - returns a string representation of the object. In the particular case of a number to string, the conversion is culture invariant. - from IDictionary to Hashtable - uses the Hashtable constructor - to XmlDocument - creates a new XmlDocument with the string representation of valueToConvert - from string to char[] - returns ((string)valueToConvert).ToCharArray() - from string to RegEx - creates a new RegEx with the string - from string to Type - looks up the type in the minishell's assemblies - from empty string to numeric - returns 0 converted to the appropriate type - from string to numeric - returns a culture invariant conversion - from ScriptBlock to Delegate - returns a delegate wrapping that scriptblock. - from Integer to Enumeration - Uses Enum.ToObject - to WMI - Instantiate a WMI instance using System.Management.ManagementObject - to WMISearcher - returns objects from running WQL query with the string representation of valueToConvert. The query is run using ManagementObjectSearcher Class. - to WMIClass - returns ManagementClass represented by the string representation of valueToConvert. - to ADSI - returns DirectoryEntry represented by the string representation of valueToConvert. - to ADSISearcher - return DirectorySearcher representd by the string representation of valueToConvert. If none of the cases above is true, the following is considered in order: 1) TypeConverter and PSTypeConverter 2) the Parse methods if the valueToConvert is a string 3) Constructors in resultType that take one parameter with type valueToConvert.GetType() 4) Implicit and explicit cast operators 5) IConvertible If any operation above throws an exception, this exception will be wrapped into a PSInvalidCastException and thrown resulting in no further conversion attempt. value to be converted and returned type to convert valueToConvert converted value if resultType is null if the conversion failed Converts valueToConvert to resultType possibly considering formatProvider A null valueToConvert can be converted to : string - returns "" char - returns '\0' numeric types - returns 0 converted to the appropriate type boolean - returns LanguagePrimitives.IsTrue(null) PSObject - returns new PSObject()) array - returns an array with null in array[0] non value types - returns null The following conversions are considered language standard and cannot be customized: - from derived to base class - returns valueToConvert intact - to PSObject - returns PSObject.AsPSObject(valueToConvert) - to void - returns AutomationNull.Value - from array/IEnumerable to array - tries to convert array/IEnumerable elements - from object of type X to array of X - returns an array with object as its only element - to bool - returns LanguagePrimitives.IsTrue(valueToConvert) - to string - returns a string representation of the object. In the particular case of a number to string, the conversion is culture invariant. - from IDictionary to Hashtable - uses the Hashtable constructor - to XmlDocument - creates a new XmlDocument with the string representation of valueToConvert - from string to char[] - returns ((string)valueToConvert).ToCharArray() - from string to RegEx - creates a new RegEx with the string - from string to Type - looks up the type in the minishell's assemblies - from empty string to numeric - returns 0 converted to the appropriate type - from string to numeric - returns a culture invariant conversion - from ScriptBlock to Delegate - returns a delegate wrapping that scriptblock. - from Integer to Enumeration - Uses Enum.ToObject If none of the cases above is true, the following is considered in order: 1) TypeConverter and PSTypeConverter 2) the Parse methods if the valueToConvert is a string 3) Constructors in resultType that take one parameter with type valueToConvert.GetType() 4) Implicit and explicit cast operators 5) IConvertible If any operation above throws an exception, this exception will be wrapped into a PSInvalidCastException and thrown resulting in no further conversion attempt. value to be converted and returned type to convert valueToConvert To be used in custom type conversions, to call parse and to call Convert.ChangeType converted value if resultType is null if the conversion failed Generic convertto that simplifies workfing with workflow. The type of object to return Sets result to valueToConvert converted to resultType. This method is a variant of ConvertTo that does not throw exceptions if the conversion fails. value to be converted and returned result of the conversion. This is valid only if the return is true. false for conversion failure, true for success Sets result to valueToConvert converted to resultType considering formatProvider for custom conversions, calling the Parse method and calling Convert.ChangeType. This method is a variant of ConvertTo that does not throw exceptions if the conversion fails. value to be converted and returned governing conversion of types result of the conversion. This is valid only if the return is true. false for conversion failure, true for success Sets result to valueToConvert converted to resultType. This method is a variant of ConvertTo that does not throw exceptions if the conversion fails. value to be converted and returned type to convert valueToConvert result of the conversion. This is valid only if the return is true. false for conversion failure, true for success Sets result to valueToConvert converted to resultType considering formatProvider for custom conversions, calling the Parse method and calling Convert.ChangeType. This method is a variant of ConvertTo that does not throw exceptions if the conversion fails. value to be converted and returned type to convert valueToConvert governing conversion of types result of the conversion. This is valid only if the return is true. false for conversion failure, true for success There might be many cast operators in a Type A that take Type A. Each operator will have a different return type. Because of that we cannot call GetMethod since it would cause a AmbiguousMatchException. This auxilliar method calls GetMember to find the right method Either op_Excplicit or op_Implicit, at the moment the type to look for an operator Type of the only parameter the operator method should have Return type of the operator method A cast operator method, or null if not found backupTypeTable: Used by Remoting Rehydration Logic. While Deserializing a remote object, LocalPipeline.ExecutionCotextFromTLS() might return null..In which case this TypeTable will be used to do the conversion. the same as in the public version the same as in the public version true if we should perform any recursive calls to ConvertTo governing conversion of types Used by Remoting Rehydration Logic. While Deserializing a remote object, LocalPipeline.ExecutionCotextFromTLS() might return null..In which case this TypeTable will be used to do the conversion. the value converted if resultType is null if the conversion failed Figure conversion when following conditions are satisfied: 1. toType is a closed generic type and it has a constructor that takes IEnumerable[T], ICollection[T] or IList[T] 2. fromType is System.Array, System.Object[] or it's the same as the element type of toType This is a wrapper class that allows us to use the generic IEnumerable implementation of an object when we can't use it's non-generic implementation. Checks if the enumValue is defined or not in enumType. some enumeration supposed to be an integer Throws if the enumType enumeration has no negative values, but the enumValue is not defined in enumType. some enumeration supposed to be an integer the error id to be used when throwing an exception Throws if the enumType enumeration has no negative values, but the enumValue is not defined in enumType. The error id to be used when throwing an exception value to validate value to use while throwing an exception the enum type to validate the enumValue with. is used by those callers who want the exception to contain a different value than the one that is validated. This will enable callers to take different forms of input -> convert to enum using Enum.Object -> then validate using this method. Create a IList to hold all elements, and use the IList to create the object of the resultType. The reason for using IList is that it can work on constructors that takes IEnumerable[T], ICollection[T] or IList[T]. When get to this method, we know the fromType and the toType meet the following two conditions: 1. toType is a closed generic type and it has a constructor that takes IEnumerable[T], ICollection[T] or IList[T] 2. fromType is System.Array, System.Object[] or it's the same as the element type of toType Wraps an object providing alternate views of the available members and ways to extend them. Members can be methods, properties, parameterized properties, etc. It is permitted to subclass but there is no established scenario for doing this, nor has it been tested. The name of the member set for adapted members This needs to be Lower cased as it saves some comparision time elsewhere. The name of the member set for extended members This needs to be Lower cased as it saves some comparision time elsewhere. The name of the member set for the BaseObject's members This needs to be Lower cased as it saves some comparision time elsewhere. The PSObject's properties This needs to be Lower cased as it saves some comparision time elsewhere. a shortcut to .PSObject.TypeNames This needs to be Lower cased as it saves some comparision time elsewhere. A collection of delegates to get Extended/Adapated/Dotnet members based on the A filter to select Extended/Adapted/Dotnet view of the object A collection of delegates to get Extended/Adapated/Dotnet members based on the A filter to select Extended/Adapted/Dotnet view of the object Backup type table to use if there is no execution context associated with the current thread A collection of delegates to get Extended/Adapated/Dotnet properties based on the A filter to select Extended/Adapted/Dotnet view of the object A collection of delegates to get Extended/Adapated/Dotnet properties based on the A filter to select Extended/Adapted/Dotnet view of the object Backup type table to use if there is no execution context associated with the current thread Returns the adapter corresponding to obj.GetType() the adapter set corresponding to obj.GetType() Initializes a new instance of PSObject with an PSCustomObject BaseObject Initializes a new instance of PSObject wrapping obj (accessible through BaseObject). object we are wrapping if is null Creates a PSObject from an ISerializable context Serialization information for this instance The streaming context for this instance If this is non-null return this string as the ToString() for this wrapped object. This is the main field in the class representing the System.Object we are encapsulating Members from the adapter of the object before it was serialized Null for live objects but not null for deserialized objects Members from the adapter of the object before it was serialized Null for live objects but not null for deserialized objects Set to true when the BaseObject is PSCustomObject If obj is not an PSObject, it is returned. Otherwise, retrieves the first non PSObject or PSObject with CustomBaseObject in the PSObject - BaseObject chain. If obj is an PSObject it will be returned as is, otherwise a new PSObject will be created based on obj. object to be wrapped obj or a new PSObject whose BaseObject is obj if is null Returns an object that should be used as a key for getting 1) instance members and 2) type names - If base object is a PSCustomObject or a string or a type then the most nested wrapping PSObject is returned (the PSObject where immediateBaseObject=PSCustomObject/string/type) - Otherwise the base object is returned This is a temporary fix for Win8 : 254345 - Job Failed By Throwing ExtendedTypeSystemException. Returns the string representation of obj. ExecutionContext used to fetch the separator. object we are trying to call ToString on. If this is not an PSObject we try enumerating and if that fails we call obj.ToString. If this is an PSObject, we look for a brokered ToString. If it is not present, and the BaseObject is null we try listing the properties. If the BaseObject is not null we try enumerationg. If that fails we try the BaseObject's ToString. A string representation of the object When there is a brokered ToString but it failed, or when the ToString on obj throws an exception. Called from an PSObject instance ToString to provide a string representation for an object ExecutionContext used to fetch the separator. Typically either this or separator will be null. If both are null, " " is used. object we are trying to call ToString on. If this is not an PSObject we try enumerating and if that fails we call obj.ToString. If this is an PSObject, we look for a brokered ToString. If it is not present, and the BaseObject is null we try listing the properties. If the BaseObject is not null we try enumerationg. If that fails we try the BaseObject's ToString. The separator between elements, if this is an enumeration the format to be passed to ToString the formatProvider to be passed to ToString true if we should enumerate values or properties which would cause recursive calls to this method. Such recursive calls will have recurse set to false, limiting the depth. If recurse is false, this parameter is not considered. If it is true this parameter will determine how enumerators are going to be treated. A string representation of the object When there is a brokered ToString but it failed, or when the ToString on obj throws an exception. Returns the string representation for this object. A ToString CodeMethod or ScriptMethod will be used, if available. Enumerations items are concatenated using $ofs. the string representation for baseObject if an exception was thrown by the BaseObject's ToString Returns the string representation for this object. A ToString CodeMethod or ScriptMethod will be used, if available. Enumerations items are concatenated using $ofs. repassed to baseObject's IFormatable if present repassed to baseObject's IFormatable if present the string representation for baseObject if an exception was thrown by the BaseObject's ToString Returns a copy of this PSObject. This will copy the BaseObject if it is a value type, and use BaseObject.Clone() for the new PSObject, if the BaseObject is ICloneable. a copy of this object Compares the current instance with another object of the same type. An object to compare with this instance. A 32-bit signed integer that indicates the relative order of the comparands. The return value has these meanings: Value Meaning Less than zero This instance is less than obj. Zero This instance is equal to obj. Greater than zero This instance is greater than obj. If has a different type than this intance's BaseObject or if the BaseObject does not implement IComparable. Determines whether the specified Object is equal to the current Object. The Object to compare with the current Object. true if the specified Object is equal to the current Object; otherwise, false. Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table. A hash code for the current Object Implements the ISerializable contract for serializing a PSObject Serialization information for this instance The streaming context for this instance Used in the serialization dupplicate entry hashtable to detect when an PSObject has been serialized The System.Object implementation of GetHashCode true to make this PSObject as the owner of the memberset. PSObject to be used while replicating the owner for PSMemeberSet TypeTable to use if this PSObject.GetTypeTable() returns null. This will happen in the remoting scenario on the client/server side (where a LocalRunspace may not be present). TypeTable to use if this PSObject.GetTypeTable() returns null. This will happen in the remoting scenario on the client/server side (where a LocalRunspace may not be present). Used by Deserializer to deserialize a serialized object to a given type (as specified in the a types.ps1xml file) TypeTable to use if this PSObject.GetTypeTable() returns null. This will happen in the remoting scenario on the client/server side (where a LocalRunspace may not be present). This is only going to be called if SerializationMethod is SpecificProperties TypeTable to use if this PSObject.GetTypeTable() returns null. This will happen in the remoting scenario on the client side (where a LocalRunspace may not be present). A collection with only the specific properties to serialize This flag is set to true in deserialized shellobject Set base object object which is set as core If true, overwrite the type information This method is to be used only by Serialization code This is the adapter that will depend on the type of baseObject. This is the adapter that is used to resolve the base dotnet members for an adapted object. If an object is not adapted, this will be null. If an object is not adapted, InternalAdapter will use the dotnet adapter. So there is no point falling back to the same dotnet adapter. If an object is adapted, this adapter will be used to resolve the dotnet members. This is the adapter set that will contain the adapter of the baseObject and the ultimate .net member lookup adater. See for explanation. Gets the member collection Gets the Property collection, or the members that are actually properties. Gets the Method collection, or the members that are actually methods. Gets the object we are directly wrapping. If the ImmediateBaseObject is another PSObject, that PSObject will be returned. Gets the object we are wrapping. If the ImmediateBaseObject is another PSObject, this property will return its BaseObject. Gets the type names collection initially containing the object type hierarchy. Sets the to string value on deserialization This class is solely used by PSObject to support .net member lookup for all the adapters except for dotNetInstanceAdapter, mshMemberSetAdapter and mshObjectAdapter. If the original adapter is not one of those, then .net members are also exposed on the PSObject. This will have the following effect: 1. Every adapted object like xml, wmi, adsi will show adapted members as well as .net members. 2. Users will not need to access PSBase to access original .net members. 3. This will fix v1.0 ADSI adapter where most of the complaints were about discovering original .net members. Use of this class will allow us to customize the utlitmate .net member lookup. For example, XML adapter already exposes .net methods. Using this class you can choose exact .net adapter to support .net member lookup and avoid lookup duplication. This class is intended for internal use only. This property can be accessed only internally and hence no checks are performed on input. A class to the core types in PowerShell. A class to view and modify the type accelerators used by the PowerShell engine. Builtin type accelerators are read only, but user defined type accerators may be added. Add a type accelerator. The type accelerator name. The type of the type accelerator. Remove a type accelerator. True if the accelerator was removed, false otherwise. The accelerator to remove. This property is useful to tools that need to know what type accelerators are available (e.g. to allow for autocompletion.) The returned dictionary should be treated as read only. Changes made to the dictionary will not affect PowerShell scripts in any way. Use and to affect the type resolutin in PowerShell scripts. This type is introduced to provide a way to pass null into a .NET method that has a string parameter This overrides ToString() method and returns null. This is a private constructor, meaning no outsiders have access. This returns the singleton instance of NullString Deals with ManagementObject objects. This is a base class that interacts with other entities. Returns the TypeNameHierarchy using the __Derivation SystemProperties and dotnetBaseType. Returns the TypeNameHierarchy out of an ManagementBaseObject object to get the TypeNameHierarchy from TypeName is of the format ObjectType#__Namespace\\__Class Returns null if memberName is not a member in the adapter or the corresponding PSMemberInfo object to retrieve the PSMemberInfo from name of the member to be retrieved The PSMemberInfo corresponding to memberName from obj Retrieves all the members available in the object. The adapter implementation is encouraged to cache all properties/methods available in the first call to GetMember and GetMembers so that subsequent calls can use the cache. In the case of the .NET adapter that would be a cache from the .NET type to the public properties and fields available in that type. In the case of the DirectoryEntry adapter, this could be a cache of the objectClass to the properties available in it. object to get all the member information from all members in obj Called after a non null return from GetMember to try to call the method with the arguments the non empty return from GetMethods the arguments to use the return value for the method Called after a non null return from GetMember to return the overloads the return of GetMember Returns true if the property is settable property to check true if the property is settable Returns true if the property is gettable property to check true if the property is gettable Returns the name of the type corresponding to the property PSProperty obtained in a previous DoGetProperty True if the result is for display purposes only the name of the type corresponding to the property Returns the value from a property coming from a previous call to DoGetProperty PSProperty coming from a previous call to DoGetProperty The value of the property Sets the value of a property coming from a previous call to DoGetProperty. This method will only set the property on a particular instance. If you want to update the WMI store, call Put(). PSProperty coming from a previous call to DoGetProperty value to set the property with instructs the adapter to convert before setting, if the adapter suports conversion Returns the string representation of the property in the object property obtained in a previous GetMember the string representation of the property in the object Returns an array with the property attributes property we want the attributes from an array with the property attributes Retrieves the table for instance methods object containing methods to load in typeTable. controls what methods are adapted. Populates methods of a ManagementClass in a CacheTable Class to get the method info from. Cachetable to update. controls what methods are adapted. Constructs a ManagementClass object from the supplied mgmtBaseObject. ManagementObject has scope, options, path which need to be carried over to the ManagementClass for retreiveing method/property/parameter metadata Gets the object type associated with a CimType:object PropertyData representing a parameter typeof(object)#EmbeddedObjectTypeName if one found typeof(object) otherwise This helps users of WMI in identifying exactly what type the underlying WMI provider will accept. Gets the dotnet type of a given PropertyData PropertyData input. A string representing dotnet type. Checks whether a given MethodData is static or not. true, if static This method relies on the qualifier "static" Decode parameter information from the supplied object. A ManagementBaseObject describing the parameters. A sorted list to store parameter information. Should not throw exceptions Gets WMI method information. Decodes only input parameters. Retrieves all the properties available in the object. object to get all the property information from collection where the members will be added Adds method information of the ManagementObject. This is done by accessing the ManagementClass corresponding to this ManagementObject. All the method information is cached for a particular ManagementObject. PSMemberInfo Object for which the members need to be retrieved. Method information is added to this. Get a method object given method name PSMemberInfo Object for which the method is required. Name of the method PsMemberInfo if method exists. Null otherwise. Returns null if propertyName is not a property in the adapter or the corresponding PSProperty with its adapterData set to information to be used when retrieving the property. object to retrieve the PSProperty from name of the property to be retrieved The PSProperty corresponding to propertyName from obj Method information is cached for every unique ManagementClassPath created/used. This structure stores information such as MethodDefinition as displayed by Get-Member cmdlet, original MethodData and computed method information such as whether a method is static etc. Deals with ManagementClass objects. Adapts only static methods and SystemProperties of a ManagemetnClass object. Invokes method reperesented by using supplied arguments. ManagementObject on which the method is invoked. Method data. Method arguments. Adds method information of the ManagementClass. Only static methods are added for an object of type ManagementClass PSMemberInfo Object for which the members need to be retrieved. Method information is added to this. Returns method information for a ManagementClass method. PSMethod if method exists and is static. Null otherwise. Deals with ManagementObject objects. This class do not adapt static methods Invokes method reperesented by using supplied arguments. ManagementObject on which the method is invoked. Method data. Method arguments. Adds method information of the ManagementObject. Only instance methods are added for a ManagementObject. PSMemberInfo Object for which the members need to be retrieved. Method information is added to this. Returns method information for a ManagementObject method. PSMethod if method exists and is not static. Null otherwise. Enumerates all possible types of members An alias to another member A property defined as a reference to a method A property from the BaseObject A prorperty defined by a Name-Value pair A property defined by script language A set of properties A method from the BaseObject A method defined as a reference to another method A method defined as a script A member that acts like a Property that takes parameters. This is not consider to be a property or a method. A set of members All events All dynamic members (where PowerShell cannot know the type of the member) All property member types All method member types All member types Enumerator for all possible views available on a PSObject. Extended methods / properties Adapted methods / properties Base methods / properties All methods / properties Match options No options Hidden members should be displayed Only include members with property set to true Serves as the base class for all members of an PSObject Initializes a new instance of an PSMemberInfo derived class Allows a derived class to set the member name... returns a new PSMemberInfo that is a copy of this PSMemberInfo a new PSMemberInfo that is a copy of this PSMemberInfo Gets the member type Gets the member name True if this is one of the reserved members True if the member should be hidden when searching with PSMemberInfoInternalCollection's Match or enumerating a collection. This should not be settable as it would make the count of hidden properties in PSMemberInfoInternalCollection invalid. For now, we are carefully setting this.isHidden before adding the members toPSObjectMembersetCollection. In the future, we might need overload for all PSMemberInfo constructors to take isHidden. True if this member has been added to the instance as opposed to coming from the adapter or from type data Gets and Sets the value of this member When getting the value of a property throws an exception. This exception is also thrown if the property is an and there is no Runspace to run the script. When setting the value of a property throws an exception. This exception is also thrown if the property is an and there is no Runspace to run the script. When some problem other then getting/setting the value happened Gets the type of the value for this member When there was a problem getting the property Serves as a base class for all members that behave like properties. Initializes a new instance of an PSPropertyInfo derived class Gets true if this property can be set Gets true if this property can be read Serves as an alias to another member It is permitted to subclass but there is no established scenario for doing this, nor has it been tested. Returns the string representation of this property This property as a string Initializes a new instance of PSAliasProperty setting the name of the alias and the name of the member this alias refers to. name of the alias name of the member this alias refers to for invalid arguments Initializes a new instance of PSAliasProperty setting the name of the alias, the name of the member this alias refers to and the type to convert the referenced member's value. name of the alias name of the member this alias refers to the type to convert the referenced member's value for invalid arguments returns a new PSMemberInfo that is a copy of this PSMemberInfo a new PSMemberInfo that is a copy of this PSMemberInfo Gets the name of the member this alias refers to Gets the member this alias refers to Gets the the type to convert the referenced member's value. It might be null when no conversion is done. Gets the member type Gets the type of the value for this member When the alias has not been added to an PSObject or the alias has a cycle or an aliased member is not present Gets true if this property can be set When the alias has not been added to an PSObject or the alias has a cycle or an aliased member is not presen Gets true if this property can be read When the alias has not been added to an PSObject or the alias has a cycle or an aliased member is not present Gets and Sets the value of this member When the alias has not been added to an PSObject or the alias has a cycle or an aliased member is not present When getting the value of a property throws an exception When setting the value of a property throws an exception Serves as a property implemented with references to methods for getter and setter. It is permitted to subclass but there is no established scenario for doing this, nor has it been tested. Returns the string representation of this property This property as a string Called from TypeTableUpdate before SetSetterFromTypeTable is called Called from TypeTableUpdate after SetGetterFromTypeTable is called Used from TypeTable with the internal constructor Used from TypeTable with the internal constructor Used from TypeTable to delay setting getter and setter Initializes a new instance of the PSCodeProperty class as a read only property. name of the property This should be a public static non void method taking one PSObject parameter. if namme is null or empty or getterCodeReference is null if getterCodeReference doesn't have the right format. Initializes a new instance of the PSCodeProperty class. Setter or getter can be null, but both cannot be null. name of the property This should be a public static non void method taking one PSObject parameter. This should be a public static void method taking 2 parameters, where the first is an PSObject. when methodForGet and methodForSet are null if: - getterCodeReference doesn't have the right format, - setterCodeReference doesn't have the right format, - both getterCodeReference and setterCodeReference are null. returns a new PSMemberInfo that is a copy of this PSMemberInfo a new PSMemberInfo that is a copy of this PSMemberInfo Gets the method used for the properties' getter. It might be null. Gets the method used for the properties' setter. It might be null. Gets the member type Gets true if this property can be set Gets true if this property can be read Gets and Sets the value of this member When getting and there is no getter or when the getter throws an exception When setting and there is no setter or when the setter throws an exception Gets the type of the value for this member If there is no property getter Used to access the adapted or base properties from the BaseObject Returns the string representation of this property This property as a string used by the adapters to keep intermediate data used between DoGetProperty and DoGetValue or DoSetValue This will be either instance.adapter or instance.clrAdapter Constructs a property from a serialized value name of the property value of the property Constructs this proprerty name of the property adapter used in DoGetProperty object passed to DoGetProperty adapter specific data for invalid arguments returns a new PSMemberInfo that is a copy of this PSMemberInfo a new PSMemberInfo that is a copy of this PSMemberInfo Gets the member type Gets or sets the value of this property When getting the value of a property throws an exception When setting the value of a property throws an exception Gets true if this property can be set Gets true if this property can be read Gets the type of the value for this member A property created by a user-defined PSPropertyAdapter Creates a property for the given base object name of the property an adapter can use this object to keep any arbitrary data it needs for invalid arguments Copy an adapted property. Gets the object the property belongs to Gets the data attached to this property Serves as a property that is a simple name-value pair. Returns the string representation of this property This property as a string Initiializes a new instance of the PSNoteProperty class. name of the property value of the property for an empty or null name returns a new PSMemberInfo that is a copy of this PSMemberInfo a new PSMemberInfo that is a copy of this PSMemberInfo Gets PSMemberTypes.NoteProperty Gets true since the value of an PSNoteProperty can always be set Gets true since the value of an PSNoteProperty can always be obtained Gets or sets the value of this property Gets the type of the value for this member Serves as a property that is a simple name-value pair. It is permitted to subclass but there is no established scenario for doing this, nor has it been tested. Returns the string representation of this property This property as a string Initiializes a new instance of the PSVariableProperty class. This is a subclass of the NoteProperty that wraps a variable instead of a simple value. The variable to wrap for an empty or null name returns a new PSMemberInfo that is a copy of this PSMemberInfo, Note that it returns another reference to the variable, not a reference to a new variable... a new PSMemberInfo that is a copy of this PSMemberInfo Gets PSMemberTypes.NoteProperty True if the underlying variable is settable... Gets true since the value of an PSNoteProperty can always be obtained Gets or sets the value of this property Gets the type of the value for this member Serves as a property implemented with getter and setter scripts. It is permitted to subclass but there is no established scenario for doing this, nor has it been tested. Returns the string representation of this property This property as a string Initializes an instance of the PSScriptProperty class as a read only property. name of the property script to be used for the property getter. $this will be this PSObject. for invalid arguments Initializes an instance of the PSScriptProperty class as a read only property. getterScript or setterScript can be null, but not both. Name of this property script to be used for the property getter. $this will be this PSObject. script to be used for the property setter. $this will be this PSObject and $args(1) will be the value to set. for invalid arguments Initializes an instance of the PSScriptProperty class as a read only property, using the text of the properties to support lazy initialization. Name of this property script to be used for the property getter. $this will be this PSObject. script to be used for the property setter. $this will be this PSObject and $args(1) will be the value to set. Language mode to be used during script block evaluation. for invalid arguments returns a new PSMemberInfo that is a copy of this PSMemberInfo a new PSMemberInfo that is a copy of this PSMemberInfo Gets the script used for the property getter. It might be null. Gets the script used for the property setter. It might be null. Gets the member type Gets true if this property can be set Gets true if this property can be read Gets and Sets the value of this property When getting and there is no getter, when the getter throws an exception or when there is no Runspace to run the script. When setting and there is no setter, when the setter throws an exception or when there is no Runspace to run the script. Gets the type of the value for this member. Currently this always returns typeof(object).FullName. If null then there are no constraints If null then there are no constraints Serves as a base class for all members that behave like methods. Initializes a new instance of a class derived from PSMethodInfo. Invokes the appropriate method overload for the given arguments and returns its result. arguments to the method return value from the method if arguments is null For problems finding an appropriate method for the arguments For exceptions invoking the method. This exception is also thrown for an when there is no Runspace to run the script. Gets a list of all the overloads for this method Gets the value of this member. The getter returns the PSMethodInfo itself. When setting the member This is not the returned value of the method even for Methods with no arguments. The getter returns this (the PSMethodInfo itself). The setter is not supported. Serves as a method implemented with a reference to another method. It is permitted to subclass but there is no established scenario for doing this, nor has it been tested. Returns the string representation of this member This property as a string Used from TypeTable Initializes a new instance of the PSCodeMethod class. name of the property this should be a public static method where the first parameter is an PSObject. for invalid arguments if the codeReference does not have the right format returns a new PSMemberInfo that is a copy of this PSMemberInfo a new PSMemberInfo that is a copy of this PSMemberInfo Invokes CodeReference method and returns its results. arguments to the method return value from the method if arguments is null When could CodeReference cannot match the given argument count or could not convert an argument to the type required For exceptions invoking the CodeReference Gets the method referenced by this PSCodeMethod Gets the member type Gets the definition for CodeReference Gets the type of the value for this member. Currently this always returns typeof(PSCodeMethod).FullName. Serves as a method implemented with a script It is permitted to subclass but there is no established scenario for doing this, nor has it been tested. Returns the string representation of this member This property as a string Initializes a new instance of PSScriptMethod name of the method script to be used when calling the method. for invalid arguments Used by TypeTable. TypeTable might be shared between multiple runspaces and ScriptBlock is not shareable. We decided to Clone as needed instead of Cloning whenever a shared TypeTable is attached to a Runspace to save on Memory. Invokes Script method and returns its results. arguments to the method return value from the method if arguments is null For exceptions invoking the Script or if there is no Runspace to run the script. returns a new PSMemberInfo that is a copy of this PSMemberInfo a new PSMemberInfo that is a copy of this PSMemberInfo Gets the script implementing this PSScriptMethod Gets a list of all the overloads for this method Gets the member type Gets the type of the value for this member. Currently this always returns typeof(object).FullName. Used to access the adapted or base methods from the BaseObject It is permitted to subclass but there is no established scenario for doing this, nor has it been tested. Returns the string representation of this member This property as a string Constructs this method name adapter to be used invoking baseObject for the methods adapterData from adapter.GetMethodData for invalid arguments Constructs a PSMethod name adapter to be used invoking baseObject for the methods adapterData from adapter.GetMethodData true if this member is a special member, false otherwise. for invalid arguments returns a new PSMemberInfo that is a copy of this PSMemberInfo a new PSMemberInfo that is a copy of this PSMemberInfo Invokes the appropriate method overload for the given arguments and returns its result. arguments to the method return value from the method if arguments is null For problems finding an appropriate method for the arguments For exceptions invoking the method Invokes the appropriate method overload for the given arguments and returns its result. constraints arguments to the method return value from the method if arguments is null For problems finding an appropriate method for the arguments For exceptions invoking the method Gets the member type Gets a list of all the overloads for this method Gets the type of the value for this member. This always returns typeof(PSMethod).FullName. True if the method is a special method like GET/SET property accessor methods. Used to access parameterized properties from the BaseObject It is permitted to subclass but there is no established scenario for doing this, nor has it been tested. Returns the string representation of this member This property as a string Constructs this parameterized proprerty name of the property adapter used in DoGetMethod object passed to DoGetMethod adapter specific data for invalid arguments Invokes the getter method and returns its result arguments to the method return value from the method if arguments is null When getting the value of a property throws an exception Invokes the setter method value to set this property with arguments to the method if arguments is null When setting the value of a property throws an exception returns a new PSMemberInfo that is a copy of this PSMemberInfo a new PSMemberInfo that is a copy of this PSMemberInfo Gets true if this property can be set Gets true if this property can be read Returns a collection of the definitions for this property Gets the type of the value for this member. Gets the member type Serves as a set of members Returns the string representation of this member This property as a string Initializes a new instance of PSMemberSet with no initial members name for the member set for invalid arguments Initializes a new instance of PSMemberSet with all the initial members in name for the member set members in the member set for invalid arguments Used to create the Extended MemberSet name of the memberSet object associated with this memberset for invalid arguments returns a new PSMemberInfo that is a copy of this PSMemberInfo a new PSMemberInfo that is a copy of this PSMemberInfo Gets a flag indicating whether the memberset will inherit members of the memberset of the same name in the "parent" class. Gets the internal member collection Gets the member collection Gets the Property collection, or the members that are actually properties. Gets the Method collection, or the members that are actually methods. Gets the member type. For PSMemberSet the member type is PSMemberTypes.MemberSet. Gets the value of this member. The getter returns the PSMemberSet itself. When trying to set the property Gets the type of the value for this member. This returns typeof(PSMemberSet).FullName. This MemberSet is used internally to represent the memberset for properties PSObject, PSBase, PSAdapted members of a PSObject. Having a specialized memberset enables delay loading the members for these members. This saves time loading the members of a PSObject. This is added to improve hosting PowerShell's PSObjects in a ASP.Net GridView Control Constructs the specialized member set. Should be one of PSObject, PSBase, PSAdapted original PSObject to use to generate members Generates the members when needed. Serves as a list of property names It is permitted to subclass but there is no established scenario for doing this, nor has it been tested. Returns the string representation of this member This property as a string Initializes a new instance of PSPropertySet with a name and list of property names name of the set name of the properties in the set for invalid arguments returns a new PSMemberInfo that is a copy of this PSMemberInfo a new PSMemberInfo that is a copy of this PSMemberInfo Gets the property names in this property set Gets the member type Gets the PSPropertySet itself. When setting the member Gets the type of the value for this member. This returns typeof(PSPropertySet).FullName. Used to access the adapted or base events from the BaseObject It is permitted to subclass but there is no established scenario for doing this, nor has it been tested. Returns the string representation of this member This property as a string Constructs this event The actual event for invalid arguments returns a new PSMemberInfo that is a copy of this PSMemberInfo a new PSMemberInfo that is a copy of this PSMemberInfo Gets the member type Gets the value of this member. The getter returns the actual .NET event that this type wraps. When setting the member Gets the type of the value for this member. This always returns typeof(PSMethod).FullName. A dynamic member /// This class is used in PSMemberInfoInternalCollection and ReadOnlyPSMemberInfoCollection Returns all members in memberList matching name and memberTypes Members to look for member with the correct types and name. Name of the members to look for. The name might contain globbing characters WildcardPattern out of name type of members we want to retrieve A collection of members of the right types and name extracted from memberList. for invalid arguments Serves as the collection of members in an PSObject or MemberSet Initializes a new instance of an PSMemberInfoCollection derived class Adds a member to this collection member to be added When: adding a member to an PSMemberSet from the type configuration file or adding a member with a reserved member name or trying to add a member with a type not compatible with this collection or a member by this name is already present for invalid arguments Adds a member to this collection member to be added flag to indicate that validation has already been done on this new member. Use only when you can guarantee that the input will not cause any of the errors normally caught by this method. When: adding a member to an PSMemberSet from the type configuration file or adding a member with a reserved member name or trying to add a member with a type not compatible with this collection or a member by this name is already present for invalid arguments Removes a member from this collection name of the member to be removed When: removing a member from an PSMemberSet from the type configuration file removing a member with a reserved member name or trying to remove a member with a type not compatible with this collection for invalid arguments Returns all members in the collection matching name name of the members to be return. May contain wildcard characters. all members in the collection matching name for invalid arguments Returns all members in the collection matching name and types name of the members to be return. May contain wildcard characters. type of the members to be searched. all members in the collection matching name and types for invalid arguments Returns all members in the collection matching name and types name of the members to be return. May contain wildcard characters. type of the members to be searched. match options all members in the collection matching name and types for invalid arguments Gets the general enumerator for this collection the enumerator for this collection Gets the specific enumerator for this collection. the enumerator for this collection Gets the member in this collection matching name. If the member does not exist, null is returned. name of the member to look for the member matching name for invalid arguments Serves as a read only collection of members It is permitted to subclass but there is no established scenario for doing this, nor has it been tested. Initializes a new instance of ReadOnlyPSMemberInfoCollection with the given members for invalid arguments Returns all members in the collection matching name name of the members to be return. May contain wildcard characters. all members in the collection matching name for invalid arguments Returns all members in the collection matching name and types name of the members to be return. May contain wildcard characters. type of the members to be searched. all members in the collection matching name and types for invalid arguments Gets the general enumerator for this collection the enumerator for this collection Gets the specific enumerator for this collection. the enumerator for this collection Return the member in this collection matching name. If the member does not exist, null is returned. name of the member to look for the member matching name for invalid arguments Gets the number of elements in this collection Returns the 0 based member identified by index index of the member to retrieve for invalid arguments Collection of members Constructs this collection Adds a member to the collection by replacing the one with the same name Adds a member to this collection member to be added when a member by this name is already present for invalid arguments Adds a member to this collection member to be added flag to indicate that validation has already been done on this new member. Use only when you can guarantee that the input will not cause any of the errors normally caught by this method. when a member by this name is already present for invalid arguments Removes a member from this collection name of the member to be removed When removing a member with a reserved member name for invalid arguments Returns all members in the collection matching name name of the members to be return. May contain wildcard characters. all members in the collection matching name for invalid arguments Returns all members in the collection matching name and types name of the members to be return. May contain wildcard characters. type of the members to be searched. all members in the collection matching name and types for invalid arguments Returns all members in the collection matching name and types name of the members to be return. May contain wildcard characters. type of the members to be searched. match options all members in the collection matching name and types for invalid arguments Gets the specific enumerator for this collection. This virtual works around the difficulty of implementing interfaces virtually. the enumerator for this collection Returns the member in this collection matching name name of the member to look for the member matching name for invalid arguments The number of elements in this collection The number of elements in this collection not marked as Hidden Returns the 0 based member identified by index index of the member to retrieve for invalid arguments Adds member to the collection member to be added When member is an PSProperty or PSMethod adding a member to a MemberSet with a reserved name adding a member with a reserved member name or adding a member with a type not compatible with this collection a member with this name already exists trying to add a member to a static memberset for invalid arguments Adds member to the collection member to be added flag to indicate that validation has already been done on this new member. Use only when you can guarantee that the input will not cause any of the errors normally caught by this method. When member is an PSProperty or PSMethod adding a member to a MemberSet with a reserved name adding a member with a reserved member name or adding a member with a type not compatible with this collection a member with this name already exists trying to add a member to a static memberset for invalid arguments Auxiliary to add members from types.xml Adds member to the collection member to be added flag to indicate that validation has already been done on this new member. Use only when you can guarantee that the input will not cause any of the errors normally caught by this method. When adding a member with a reserved member name or adding a member with a type not compatible with this collection a member with this name already exists trying to add a member to a static memberset for invalid arguments Removes the member named name from the collection Name of the member to be removed When trying to remove a member with a type not compatible with this collection When trying to remove a member from a static memberset When trying to remove a member from a MemberSet with a reserved name for invalid arguments Method which checks if the is reserved and if so it will ensure that the particular reserved member is loaded into the objects member collection. Caller should ensure that name is not null or empty. Name of the member to check and load (if needed). Returns all members in the collection matching name name of the members to be return. May contain wildcard characters. all members in the collection matching name for invalid arguments Returns all members in the collection matching name and types name of the members to be return. May contain wildcard characters. type of the members to be searched. all members in the collection matching name and types for invalid arguments Returns all members in the collection matching name and types name of the members to be return. May contain wildcard characters. type of the members to be searched. search options all members in the collection matching name and types for invalid arguments Gets the specific enumerator for this collection. This virtual works around the difficulty of implementing interfaces virtually. the enumerator for this collection Returns the name corresponding to name or null if it is not present name of the member to return for invalid arguments Enumerable for this class Constructs this instance to enumerate over members members we are enumerating Moves to the next element in the enumeration false if there are no more elements to enumerate true otherwise Not supported Current PSMemberInfo in the enumeration for invalid arguments Serves as a placeholder BaseObject when PSObject's constructor with no parameters is used. To prevent other instances than SelfInstance Returns an empty string Please keep in sync with SerializationMethod from C:\e\win7_powershell\admin\monad\nttargets\assemblies\logging\ETW\Manifests\Microsoft-Windows-PowerShell-Instrumentation.man Contains auxilliary ToString CodeMethod implementations for some types ToString implementation for PropertyValueCollection instance of PSObject wrapping a PropertyValueCollection ToString implementation for XmlNode instance of PSObject wrapping an XmlNode ToString implementation for XmlNodeList instance of PSObject wrapping an XmlNodeList ToString implementation for Type instance of PSObject wrapping a Type Contains CodeMethod implementations for some adapted types like: 1. DirectoryEntry Related Code Methods (a) Convert from DE LargeInteger to Int64. (b) Convert from DE Dn-With-Binary to string. Converts instance of LargeInteger to .net Int64. Instance of PSObject wrapping DirectoryEntry object Instance of PSObject wrapping LargeInteger instance Converted Int64. Converts instance of DN-With-Binary to .net String Instance of PSObject wrapping DirectoryEntry object Instance of PSObject wrapping DN-With-Binary object Converted string. Serves as the arguments for events triggered by exceptions in the SetValue method of The sender of this event is an object of type . It is permitted to subclass but there is no established scenario for doing this, nor has it been tested. Initializes a new instance of setting the value of of the exception that triggered the associated event. Exception that triggered the associated event Gets and sets a indicating if the SetValue method of should throw the exception associated with this event. The default value is true, indicating that the Exception associated with this event will be thrown. Gets the exception that triggered the associated event. Serves as the arguments for events triggered by exceptions in the GetValue method of The sender of this event is an object of type . It is permitted to subclass but there is no established scenario for doing this, nor has it been tested. Initializes a new instance of setting the value of of the exception that triggered the associated event. Exception that triggered the associated event Gets and sets a indicating if the GetValue method of should throw the exception associated with this event. Gets the Exception that triggered the associated event. Gets and sets the value that will serve as a replacement to the return of the GetValue method of . If this property is not set to a value other than null then the exception associated with this event is thrown. Serves as the property information generated by the GetProperties method of . It is permitted to subclass but there is no established scenario for doing this, nor has it been tested. This method has no effect for . CanResetValue returns false. This parameter is ignored for Returns false to indicate that ResetValue has no effect. The component to test for reset capability. false Returns true to indicate that the value of this property needs to be persisted. The component with the property to be examined for persistence. true Gets the current value of the property on a component. The component with the property for which to retrieve the value. The value of a property for a given component. If the property has not been found in the component or an exception has been thrown when getting the value of the property. This Exception will only be thrown if there is no event handler for the GettingValueException event of the that created this . If there is an event handler, it can prevent this exception from being thrown, by changing the ShouldThrow property of from its default value of true to false. If is null. if is not an or an . Sets the value of the component to a different value. The component with the property value that is to be set. The new value. If the property has not been found in the component or an exception has been thrown when setting the value of the property. This Exception will only be thrown if there is no event handler for the SettingValueException event of the that created this . If there is an event handler, it can prevent this exception from being thrown, by changing the ShouldThrow property of from its default value of true to false. If is null. if is not an or an . Gets the collection of attributes for this member. Gets a value indicating whether this property is read-only. Gets the type of the component this property is bound to. This property returns the type. Gets the type of the property value. Provides information about the properties for an object of the type . Initializes a new instance of the that provides property information about . The this class retrieves property information from. Returns a collection of property descriptors for the represented by this type descriptor. A PropertyDescriptorCollection containing the property descriptions for the represented by this type descriptor. Returns a filtered collection of property descriptors for the represented by this type descriptor. An array of attributes to use as a filter. This can be a null reference (Nothing in Visual Basic). A PropertyDescriptorCollection containing the property descriptions for the represented by this type descriptor. Determines whether the Instance property of is equal to the current Instance. The Object to compare with the current Object. true if the Instance property of is equal to the current Instance; otherwise, false. Provides a value for hashing algorithms. A hash code for the current object Returns the default property for this object. An that represents the default property for this object, or a null reference (Nothing in Visual Basic) if this object does not have properties Returns a type converter for this object. A that is the converter for this object, or a null reference (Nothing in Visual Basic) if there is no for this object. Returns the object that this value is a member of. A that represents the property whose owner is to be found. An object that represents the owner of the specified property. Returns the default event for this object. An that represents the default event for this object, or a null reference (Nothing in Visual Basic) if this object does not have events. Returns the events for this instance of a component. An that represents the events for this component instance. Returns the events for this instance of a component using the attribute array as a filter. An array of type that is used as a filter. An that represents the events for this component instance that match the given set of attributes. Returns a collection of type for this object. An with the attributes for this object. Returns the class name of this object. The class name of the object, or a null reference (Nothing in Visual Basic) if the class does not have a name. Returns the name of this object. The name of the object, or a null reference (Nothing in Visual Basic) if object does not have a name. Returns an editor of the specified type for this object. A that represents the editor for this object. An object of the specified type that is the editor for this object, or a null reference (Nothing in Visual Basic) if the editor cannot be found. Occurs when there was an exception setting the value of a property. The ShouldThrow property of the allows subscribers to prevent the exception from being thrown. Occurs when there was an exception getting the value of a property. The ShouldThrow property of the allows subscribers to prevent the exception from being thrown. Gets the this class retrieves property information from. Retrieves a to provides information about the properties for an object of the type . Initializes a new instance of Retrieves a to provide information about the properties for an object of the type . The type of object for which to retrieve the type descriptor. If this parameter is not noll and is not the , the return of this method will be null. An instance of the type. If instance is null or has a type other than , this method returns null. An that can provide property information for the type , or null if is not null, but has a type other than . Occurs when there was an exception setting the value of a property. The ShouldThrow property of the allows subscribers to prevent the exception from being thrown. Occurs when there was an exception getting the value of a property. The ShouldThrow property of the allows subscribers to prevent the exception from being thrown. Internal class to provide a Hashtable key out of a Collection of strings preserving the evaluation of the key Copy constructor (deep copy) Construct an optionally readonly list of strings. This exception is used by TypeTable constructor to indicate errors occured during construction time. This is the default constructor. This constructor takes a localized error message. A localized error message. This constructor takes a localized message and an inner exception. Localized error message. Inner exception. This constructor takes a colletion of errors occurred during construction time. The errors that occured This constructor is required by serialization. Serializes the exception data. serialization information streaming context Set the default ErrorRecord. The specific TypeTable load errors. TypeData represent a Type Definition Initialize a TypeData instance by providing the typeName Initialize a TypeData instance by providing a Type Return a TypeData that is a copy of this one Get the TypeName Get the members of this TypeData instance. The Key of the dictionary is the member's name, and the Value is a TypeMemberData instance. The type converter The type adapter Set to true if override the existing definition The serializationMethod The targetTypeForDeserialization The serializationDepth The defaultDisplayProperty The InheritPropertySerializationSet The stringSerializationSource The defaultDisplayPropertySet The defaultKeyPropertySet The PropertySerializationSet TypeMemberData is the base class for type members. The type members derived from this class are: NotePropertyData, AliasPropertyData, ScriptPropertyData, CodePropertyData, ScriptMethodData, CodeMethodData TypeMemberData constructor Return a TypeMemberData that is a copy of this one. The name of the member NotePropertyData represents a NoteProperty definition NotePropertyData constructor Return a new NotePropertyData that is a copy of this one The value of this NoteProperty Set true if the member is supposed to be hidden AliasPropertyData represents a AliasProperty definition AliasPropertyData constructor AliasPropertyData constructor Return a new AliasPropertyData that is a copy of this one The name of the referenced member Specify the Type to which the referenced member value will be converted to Set true if the member is supposed to be hidden ScriptPropertyData represents a ScriptProperty definition Initialize the ScriptPropertyData as a read only property ScriptPropertyData constructor Return a new ScriptPropertyData that is a copy of this one The getter ScriptBlock The setter ScriptBlock Set true if the member is supposed to be hidden CodePropertyData represents a CodeProperty definition Initialize the CodePropertyData as a read only property CodePropertyData constructor Return a CodePropertyData that is a copy of this one The getter code reference The setter code reference Set true if the member is supposed to be hidden ScriptMethodData represents a ScriptMethod definition ScriptMethodData constructor Return a ScriptMethodData that is a copy of this one The script method CodeMethodData represents a CodeMethodData definition CodeMethodData constructor Return a CodeMethodData that is a copy of this one The code reference PropertySetData represent a PropertySet definition PropertySetData constructor Return a new PropertySetData that is a copy of this one The referenced properties The PropertySet name A class that keeps the information from types.ps1xml files in a cache table Table from type name list into PSMemberInfoInternalCollection Table from type name list into Collection of strings Table from type name into PSMemberInfoInternalCollection points to a Hashtable from type name to type converter points to a Hashtable from type name to type adapter Issue appropriate errors and remove members as necessary if: - The serialization settings do not fall into one of the combinations of the table below - If the serialization settings notes' values cannot be converted to the propper type - If serialization settings members are of the wrong member type - DefaultDisplayPropertySet is not an PSPropertySet - DefaultDisplayProperty is not an PSPropertyInfo - DefaultKeyPropertySet is not an PSPropertySet SerializationMethod InheritPropertySerializationSet PropertySerializationSet SerializationDepth StringSerializationSource --------------------- ------------------------------- ------------------------ ------------------- --------------------------- String must NOT be present must NOT be present must NOT be present optional SpecificProperties optional must be present optional optional AllPublicProperties must NOT be present must NOT be present optional optional Helper for ProcessTypeConverter/ProcessTypeAdapter. Attempts to create an instance of the given type and returns true on success. If the function fails 'instanceException' may include additional information about the failure (or be null if there is no additional information) Helper for ProcessTypeConverter/ProcessTypeAdapter from TypeData returns the node names joined in a string Skips everything untill the end tag of nodeName Called from ReadNode to process a StartElement the child node, or null if there is no child node Called from ReadNode to process an End Element considering that context.reader is past the beginning of node reads node Constructor that creates a TypeTable from a set of type files. Type files to load for type information. 1. Path {0} is not fully qualified. Specify a fully qualified type file path. 1. There were errors loading TypeTable. Look in the Errors property to get detailed error messages. Load types.ps1xml, typesv3.ps1xml into the typetable if caller doesn't have permission to read the PowerShell registry key TypeTable Gets the default types files available in PowerShell list of type files Constructor that creates a TypeTable from a set of type files. Type files to load for type information. Authorization manager to perform signature checks before reading ps1xml files (or null of no checks are needed) Host passed to . Can be null if no interactive questions should be asked. 1. Path {0} is not fully qualified. Specify a fully qualified type file path. 1. There were errors loading TypeTable. Look in the Errors property to get detailed error messages. The first type in the type hierarchy is guaranteed to have SpecificProperties null if this should not be serialized with SpecificProperties Gets the MemberInfoCollection for types. This method will cache its return value for future reference to the same types. list of types to get the member from Gets the type converter for the typeName type name with the converter the type converter for the typeName or null, if there is no type converter Execute an action for every type name in the type table that has a type converter. The action to execute Gets the type adapter for the given type the type adapter or null, if there is no adapter Load a PSMemberInfo instance to the passed-in TypeData Helper function to convert an object to a specific type Load the standard members into the passed-in TypeData Get all Type configurations, return a Dictionary with typeName as the key, TypeData as the value Clone the TypeTable by doing a shallow copy of all the members. Indicate that the clone of this TypeTable instance should not be marked as "Shared", even if this TypeTable instance itself is a shared TypeTable. If unshared is True, return an unshared clone of this TypeTable instance If unshared is False, return a clone that is exactly the same as this TypeTable instance. Clear the TypeTable. Load the specified file and report the errors in Type file to load. File should be a fully-qualified path. Authorization manager to perform signature checks before reading ps1xml files (or null of no checks are needed) Host passed to . Can be null if no interactive questions should be asked. Indicate if the file failed to be loaded Helper method to load content for a module. Helper method to update with module file contents. Module contents Module name Module file path Whether the module contents are fully trusted Errors Adds the to the current TypeTable's type file list. The TypeTable will not reflect the change until Update is called. if true, is prepended to the current TypeTable's type file list. if false, it will be appended. 1. Path {0} is not fully qualified. Specify a fully qualified type file path. Removes the from the current TypeTable's type file list. The TypeTable will not reflect the change until Update is called. Update the TypeTable by adding a TypeData instance. throw when the argument is null throw when there were failures during the update a TypeData instance to update the TypeTable Remove all type information related to the type name. throw when the argument is null or empty throw if there were failures when remove the type the name of the type to remove from TypeTable Update typetable from psSnapinTypes, this method will always rebuild the typetable. The psSnapinTypes contain files and strong type data Authorization manager to perform signature checks before reading ps1xml files (or null of no checks are needed) Host passed to . Can be null if no interactive questions should be asked. True if the format data has been pre-validated (build time, manual testing, etc) so that validation can be skipped at runtime. 1. The TypeTable cannot be updated becasue the TypeTable might have been created outside of the Runspace. Entry created to make reflection-based test suites happy. DO NOT USE THIS ENTRY The path to the file to load A place to put the errors... If true, reset the table to empty... Authorization manager to perform signature checks before reading ps1xml files (or null of no checks are needed) Host passed to . Can be null if no interactive questions should be asked. Indicate if the file cannot be loaded due to the security reason 1. The TypeTable cannot be updated becasue the TypeTable might have been created outside of the Runspace. Update type data from a specific file... The name of the module or snapin that this file is associated with. The path to the file to load A place to put the errors... If true, reset the table to empty... Authorization manager to perform signature checks before reading ps1xml files (or null of no checks are needed) Host passed to . Can be null if no interactive questions should be asked. True if the format data has been pre-validated (build time, manual testing, etc) so that validation can be skipped at runtime. Indicate if the file cannot be loaded due to security reason 1. The TypeTable cannot be updated becasue the TypeTable might have been created outside of the Runspace. Update typetable from a collection of strong type data Update typetable from a specific strong type data Update current TypeTable with the type data from the supplied 1. The TypeTable cannot be updated becasue the TypeTable might have been created outside of the Runspace. Defines the exception thrown for all Extended type system related errors Initializes a new instance of ExtendedTypeSystemException with the message set to typeof(ExtendedTypeSystemException).FullName Initializes a new instance of ExtendedTypeSystemException setting the message the exception's message Initializes a new instance of ExtendedTypeSystemException setting the message and innerException the exception's message the exceptions's inner exception Recommended constructor for the class String that uniquely identifies each thrown Exception The inner exception, null for none Resource string Arguments to the resource string Initializes a new instance of ExtendedTypeSystemException with serialization parameters serialization information streaming context Defines the exception thrown for Method related errors Initializes a new instance of MethodException with the message set to typeof(MethodException).FullName Initializes a new instance of MethodException setting the message the exception's message Initializes a new instance of MethodException setting the message and innerException the exception's message the exceptions's inner exception Recommended constructor for the class String that uniquely identifies each thrown Exception The inner exception Resource String Arguments to the resource string Initializes a new instance of MethodException with serialization parameters serialization information streaming context Defines the exception thrown for Method invocation exceptions Initializes a new instance of MethodInvocationException with the message set to typeof(MethodInvocationException).FullName Initializes a new instance of MethodInvocationException setting the message the exception's message Initializes a new instance of MethodInvocationException setting the message and innerException the exception's message the exceptions's inner exception Recommended constructor for the class String that uniquely identifies each thrown Exception The inner exception Resource String Arguments to the resource string Initializes a new instance of MethodInvocationException with serialization parameters serialization information streaming context Defines the exception thrown for errors getting the value of properties Initializes a new instance of GetValueException with the message set to typeof(GetValueException).FullName Initializes a new instance of GetValueException setting the message the exception's message Initializes a new instance of GetValueException setting the message and innerException the exception's message the exceptions's inner exception Recommended constructor for the class String that uniquely identifies each thrown Exception The inner exception Resource String Arguments to the resource string Initializes a new instance of GetValueException with serialization parameters serialization information streaming context Defines the exception thrown for errors getting the value of properties Initializes a new instance of GetValueException with the message set to typeof(GetValueException).FullName Initializes a new instance of GetValueException setting the message the exception's message Initializes a new instance of GetValueException setting the message and innerException the exception's message the exceptions's inner exception Recommended constructor for the class String that uniquely identifies each thrown Exception The inner exception Resource String Arguments to the resource string Initializes a new instance of GetValueException with serialization parameters serialization information streaming context Defines the exception thrown for exceptions thrown by property getters Initializes a new instance of GetValueInvocationException with the message set to typeof(GetValueInvocationException).FullName Initializes a new instance of GetValueInvocationException setting the message the exception's message Initializes a new instance of GetValueInvocationException setting the message and innerException the exception's message the exceptions's inner exception Recommended constructor for the class String that uniquely identifies each thrown Exception The inner exception Resource String Arguments to the resource string Initializes a new instance of GetValueInvocationException with serialization parameters serialization information streaming context Defines the exception thrown for errors setting the value of properties Initializes a new instance of SetValueException with the message set to typeof(SetValueException).FullName Initializes a new instance of SetValueException setting the message the exception's message Initializes a new instance of SetValueException setting the message and innerException the exception's message the exceptions's inner exception Recommended constructor for the class String that uniquely identifies each thrown Exception The inner exception Resource String Arguments to the resource string Initializes a new instance of SetValueException with serialization parameters serialization information streaming context Defines the exception thrown for exceptions thrown by property setters Initializes a new instance of SetValueInvocationException with the message set to typeof(SetValueInvocationException).FullName Initializes a new instance of SetValueInvocationException setting the message the exception's message Initializes a new instance of SetValueInvocationException setting the message and innerException the exception's message the exceptions's inner exception Recommended constructor for the class String that uniquely identifies each thrown Exception The inner exception Resource String Arguments to the resource string Initializes a new instance of SetValueInvocationException with serialization parameters serialization information streaming context Defines the exception thrown for type conversion errors Populates a with the data needed to serialize the PSInvalidCastException object. The to populate with data. The destination for this serialization. Initializes a new instance of PSInvalidCastException with serialization parameters serialization information streaming context Initializes a new instance of PSInvalidCastException with the message set to typeof(PSInvalidCastException).FullName Initializes a new instance of PSInvalidCastException setting the message the exception's message Initializes a new instance of PSInvalidCastException setting the message and innerException the exception's message the exceptions's inner exception Gets the ErrorRecord associated with this exception Define type for a reference object in Monad scripting language. This class is used to describe both kinds of references: a. reference to a value: _value will be holding the value being referenced. b. reference to a variable: _value will be holding a PSVariable instance for the variable to be referenced. A reference is created in following ways, a. value reference $a = [ref] 3 [ref] $a = 3 [ref] $a = $b b. variable reference $a = [ref] $b Create an instance of PSReference. Get and set value of PSReference. If underlining object is a value, the object itself will be operated on. If underlining object is a variable, the variable will be operated on. CabinetExtractor interface, implemented by CabinetExtractor in native code to handle the extraction of cabinet files. Extracts a cabinet file cabinet file name cabinet directory name, must be back slash terminated destination directory name, must be back slash terminated Disposes the instance Abstract class which defines a CabinetExtractor loader. An implementation of this class will be instantiated onetime from the C++/CLI assembly using reflection The C++/CLI implementation of this class needs to be static Used to create a CabinetExtractor class Static constructor Provider a CabinetExtractor instance Tracer instance Dummy cabinet extractor implementation Extracts a cabinet file cabinet file name cabinet directory name, must be back slash terminated destination directory name, must be back slash terminated Disposes the instance The MamlUtil class. Takes Name value from maml2 and overrides it in maml1. Takes Name value from maml2 and overrides it in maml1. Adds common properties like PSSnapIn,ModuleName from maml2 to maml1 Prepend - Modify Syntax element in maml1 using the Syntax element from maml2. Prepend - Modify DetailedDescription element in maml1 using the DetailedDescription element from maml2. Override - Modify Parameters element in maml1 using the Parameters element from maml2. This will copy parameters from maml2 that are not present in maml1. Prepend - Modify Notes element in maml1 using the Notes element from maml2. Get propery info. Prepend property value. Should Override the maml1 value from maml2 instead of prepend. Ensure property info path exists. The ProviderCommandHelpInfo class. Class HelpInfo keeps track of help information to be returned by help system. HelpInfo includes information in following aspect, a. Name: the target name for help b. Category: what category the help belongs to This class will be derived to track help info for different help categories like, AliasHelpInfo CommandHelpInfo ProviderHelpInfo etc. In general, there will be a specific helpInfo child class for each kind of help provider. Constructor for HelpInfo Returs help information for a parameter(s) identified by pattern pattern to search for parameters A collection of parameters that match pattern The base method returns an empty list. Returns the Uri used by get-help cmdlet to show help online. Null if no Uri is specified by the helpinfo or a valid Uri. Specified Uri is not valid. Returns true if help content in help info matches the pattern contained in . The underlying code will usually run pattern.IsMatch() on content it wants to search. Add common help properties to the helpObject which is in PSObject format. Intrinsic help properties include properties like, Name, Synopsis HelpCategory etc. Since help object from different help category has different format, it is needed that we generate these basic information uniformly in the help object itself. This function is normally called at the end of each child class constructor. Update common help user-defined properties of the help object which is in PSObject format. Call this function to update Mshobject after it is created. This function wont create new properties.This will update only user-defined properties created in Name for help info Name for help info Synopsis for help info Synopsis for help info Component for help info. Component for help info Role for help info. Role for help ino Functionality for help info. Functionality for help info Help category for help info Help category for help info Forward help category for this help info If this is not HelpCategory.None, then some other help provider (as specified in the HelpCategory bit pattern) need to process this helpInfo before it can be returned to end user. Help category to forward this helpInfo to Target object in forward-help-provider that should process this HelpInfo. This will serve as auxilliary information to be passed to forward help provider. In the case of AliasHelpInfo, for example, it needs to be forwarded to CommandHelpProvider to fill in detailed helpInfo. In that case, ForwardHelpCategory will be HelpCategory.Command and the help target is the cmdlet name that matches this alias. forward target object name Full help object for this help item. Full help object for this help item Short help object for this help item. Short help object for this help item This is for tracking the set of errors happened during the parsing of of this helpinfo. Help info. Constructor for ProviderCommandHelpInfo. Get parameter. Returns the Uri used by get-help cmdlet to show help online. Returns only the first uri found under RelatedLinks. Null if no Uri is specified by the helpinfo or a valid Uri. The Name property. The Synopsis property. The HelpCategory property. The FullHelp property. The Component property. The Role property. The Functionality property. The ProviderContext class. Requested path. Create a new instance of ProviderContext. Get provider specific help info. Requested path. This class implements get-help command Default constructor for the GetHelpCommand class Implements the BeginProcessing() method for get-help command Implements the ProcessRecord() method for get-help command Change as per user request. This method creates a new type to the existing typenames depending on Detailed,Full,Example parameteres and adds this new type(s) to the top of the list. Full help object to transform. Transformed help object with new TypeNames. If Detailed and Full are not specified, nothing is changed. Gets the paramater info for patterns identified Parameter property. Writes the parameter info(s) to the output stream. An error is thrown if a parameter with a given pattern is not found. HelpInfo Object to look for the parameter. Validates input parameters Category specified by the user If the request cant be serviced. Helper method used to Write the help object onto the output stream or show online help (URI extracted from the HelpInfo) object. Opens the Uri. System's default application will be used to show the uri. Checks if we can connect to the internet Target to search for help Path to provider location that user is curious about. List of help categories to search for help List of Component's to search on. List of Functionality's to search on. List of Role's to search on. Changes the view of HelpObject returned Currently we support following views: 1. Reminder (Default - Experienced User) 2. Detailed (Beginner - Beginning User) 3. Full (All Users) 4. Examples 5. Parameters Currently we support these views only for Cmdlets. A SnapIn developer can however change these views. Changes the view of HelpObject returned Currently we support following views: 1. Reminder (Default - Experienced User) 2. Detailed (Beginner - Beginning User) 3. Full (All Users) 4. Examples 5. Parameters Currently we support these views only for Cmdlets. A SnapIn developer can however change these views. Changes the view of HelpObject returned Currently we support following views: 1. Reminder (Default - Experienced User) 2. Detailed (Beginner - Beginning User) 3. Full (All Users) 4. Examples Currently we support these views only for Cmdlets. A SnapIn developer can however change these views. Parameter name. Support WildCard strings as supported by WildcardPattern class. This parameter,if true, will direct get-help cmdlet to navigate to a URL (stored in the command MAML file under the uri node). Gets and sets a value indicatuing whether the help should be displayed in a separate window Help Views Helper methods used as powershell extension from a types file. Verifies if the InitialSessionState of the current process Retrieves the HelpUri given a CommandInfo instance. CommandInfo instance wrapped as PSObject null if is not a CommandInfo type. null if HelpUri could not be retrieved either from CommandMetadata or help content. Monad help is an architecture made up of three layers: 1. At the top is get-help commandlet from where help functionality is accessed. 2. At the middel is the help system which collects help objects based on user's request. 3. At the bottom are different help providers which provide help contents for different kinds of information requested. Class HelpSystem implements the middle layer of Monad Help. HelpSystem will provide functionalitys in following areas, 1. Initialization and management of help providers 2. Help engine: this will invoke different providers based on user's request. 3. Help API: this is the API HelpSystem provide to get-help commandlet. Initialization: Initialization of different help providers needs some context information like "ExecutionContext" Help engine: By default, HelpInfo will be retrieved in two phase: exact-match phase and search phase. Exact-match phase: help providers will be called in appropriate order to retrieve HelpInfo. If a match is found, help engine will stop and return the one and only HelpInfo retrieved. Search phase: all relevant help providers will be called to retrieve HelpInfo. (Order doesn't matter in this case) Help engine will not stop until all help providers are called. Behaviour of help engine can be modified based on Help API parameters in following ways, 1. limit the number of HelpInfo to be returned. 2. specify which providers will be used. 3. general help info returned in case the search target is empty. 4. default help info (or hint) returned in case no match is found. Help Api: Help Api is the function to be called by get-help commandlet. Following information needs to be provided in Help Api paramters, 1. search target: (which can be one or multiple strings) 2. help type: limit the type of help to be searched. 3. included fields: the fields to be included in the help info 4. excluded fields: the fields to be excluded in the help info 5. max number of results to be returned: 6. scoring algorithm for help results? 7. help reason: help can be directly invoked by end user or as a result of some command syntax error. [gxie, 7-25-04]: included fields, excluded fields and help reason will be handled in get-help commandlet. Help API's are internal. The only way to access help is by invoking the get-help command. To support the scenario where multiple monad engine running in one process. It is required that each monad engine has its one help system instance. Currently each ExecutionContext has a help system instance as its member. Help Providers: The basic contract for help providers is to provide help based on the search target. The result of help provider invocation can be three things: a. Full help info. (in the case of exact-match and single search result) b. Short help info. (in the case of multiple search result) c. Partial help info. (in the case of some commandlet help info, which should be supplemented by provider help info) d. Help forwarding info. (in the case of alias, which will change the target for alias) Help providers may need to provide functionality in following two area, a. caching and indexing to boost performance b. localization Constructor for HelpSystem. Execution context for this help system Initialize help system with an execution context. If the execution context matches the execution context of current singleton HelpSystem object, nothing needs to be done. Otherwise, a new singleton HelpSystem object will be created with the new execution context. Get Help api function. This is the basic form of the Help API using help request. Variants of this function are defined below, which will create help request object on fly. helpRequest object An array of HelpInfo object Gets the search paths for external snapins/modules that are currently loaded. If the current shell is single-shell based, then the returned search path contains all the directories of currently active PSSnapIns/modules. a collection of strings representing locations Get help based on the target, help type, etc Help eninge retrieve help based on following schemes, 1. if help target is empty, get default help 2. if help target is not a search pattern, try to retrieve exact help 3. if help target is a search pattern or step 2 returns no helpInfo, try to search for help (Search for pattern in command name followed by pattern match in help content) 4. if step 3 returns exact one helpInfo object, try to retrieve exact help. Help request object An array of HelpInfo object Get help that exactly match the target. If the helpInfo returned is not complete, we will forward the helpInfo object to appropriate help provider for further processing. (this is implemented by ForwardHelp) Help request object HelpInfo object retrieved. Can be Null. Forward help to the help provider with type forwardHelpCategory. This is used in the following known scenarios so far 1. Alias: helpInfo returned by Alias is not what end user needed. The real help can be retrieved from Command help provider. Help request object Never returns null. helpInfos is not null or emtpy. Get the default help info (normally when help target is empty). Get help that exactly match the target help request object An IEnumerable of HelpInfo object Initialize help providers. Currently we hardcode the sequence of help provider initialization. In the longer run, we probably will load help providers based on some provider catalog. That will allow new providers to be defined by customer. Start a trace frame for a help file Trace an error within a help frame, which is tracked by help tracer itself. Trace a collection of errors within a help frame, which is tracked by help tracer itself. Before each help request is serviced, current thread culture will validate against the current culture of help system. If there is a miss match, each help provider will be notified of the culture change. Reset help providers providers. This normally corresponds to help culture change. Normally help providers will remove cached help content to make sure new help requests will be served with content of right culture. ExecutionContext for the help system. Different help providers will depend on this to retrieve session related information like session state and command discovery objects. This is for tracking the last set of errors happened during the help search. This is the help category to search for help for the last command. help category to search for help VerboseHelpErrors is used in the case when end user is interested to know all errors happened during a help search. This property is false by default. If this property is turned on (by setting session variable "VerboseHelpError"), following two behaviours will be different, a. Help errors will be written to error pipeline regardless the situation. (Normally, help errors will be written to error pipeline if there is no help found and there is no wildcard in help search target). b. Some additional warnings, including maml processing warnings, will be written to error pipeline. return the list of help providers initialized a list of help providers The error tracer for this help system Help progress info This is the structure to keep track of HelpProvider Info. Constructor assembly that contains this help provider the class that implements this help provider help category of this help provider Help categories Undefined help category Alias help Cmdlet help Provider help General keyword help FAQ's Glossary and term definitions Help that is contained in help file Help from a script block Help for a function Help for a filter Help for an external script (i.e. for a *.ps1 file) All help categories. Default Help Help for a Workflow Class HelpProvider defines the interface to be implemented by help providers. Help Providers: The basic contract for help providers is to provide help based on the search target. The result of help provider invocation can be three things: a. Full help info. (in the case of exact-match and single search result) b. Short help info. (in the case of multiple search result) c. Partial help info. (in the case of some commandlet help info, which should be supplemented by provider help info) d. Help forwarding info. (in the case of alias, which will change the target for alias) Help providers may need to provide functionality in following two area, a. caching and indexing to boost performance b. localization Basic properties of a Help Provider 1. Name 2. Type 3. Assembly Help Provider Interface 1. Initialize: 2. ExactMatchHelp: 3. SearchHelp: 4. ProcessForwardedHelp Constructor for HelpProvider Retrieve help info that exactly match the target. help request object List of HelpInfo objects retrived Search help info that match the target search pattern. help request object If true, searches for pattern in the help content. Individual provider can decide which content to search in. If false, seraches for pattern in the command names. a collection of help info objects Process a helpinfo forwarded over by another help provider. HelpProvider can choose to process the helpInfo or not, 1. If a HelpProvider chooses not to process the helpInfo, it can return null to indicate helpInfo is not processed. 2. If a HelpProvider indeed processes the helpInfo, it should create a new helpInfo object instead of modifying the passed-in helpInfo object. This is very important since the helpInfo object passed in is usually stored in cache, which can used in later queries. helpInfo passed over by another HelpProvider help request object Reset help provider. Normally help provider are reset after a help culture change. Report help file load errors. Currently three cases are handled, 1. IOException: not able to read the file 2. SecurityException: not authorized to read the file 3. XmlException: xml schema error. This will be called either from search help or exact match help to find the error. Each Shell ( minishell ) will have its own path specified by the registry HKLM\software\microsoft\msh\1\ShellIds\<ShellID>\path. Every help provider should search this path for content. string representing base directory of the executing shell. Helper function which checks whether PSSnapIns are supported in current invocation. true if supported,false otherwise. Gets the search paths. If the current shell is single-shell based, then the returned search path contains all the directories of currently active PSSnapIns a collection of string representing locations Name for the help provider Name for the help provider Derived classes should set this. Help category for the help provider Help category for the help provider Derived classes should set this. Class HelpProviderWithCache provides a pseudo implementation of HelpProvider at which results are cached in a hashtable so that later retrieval can be faster. Constructor for HelpProviderWithCache _helpCache is a hashtable to stores helpInfo This hashtable is made case-insensitive so that helpInfo can be retrieved case insensitively. Exact match help for a target. Help request object The HelpInfo found. Null if nothing is found This is for implementing custom match algorithm. target to search key used in cache table Do exact match help for a target. Derived class can choose to either override ExactMatchHelp method to DoExactMatchHelp method. If ExactMatchHelp is overriden, initial cache checking will be disabled by default. If DoExactMatchHelp is overriden, cache check will be done first in ExactMatchHelp before the logic in DoExactMatchHelp is in place. help request object Search help for a target help request object If true, searches for pattern in the help content. Individual provider can decide which content to search in. If false, seraches for pattern in the command names. a collection of help info objects Create a wildcard pattern based on a target. Here we provide the default implementation of this, covering following two cases a. if target has wildcard pattern, return as it is. b. if target doesn't have wildcard pattern, postfix it with * Child class of this one may choose to override this function. target string wild card pattern created Do search help. This is for child class to override. Child class can choose to override SearchHelp of DoSearchHelp depending on whether it want to reuse the logic in SearchHelp for this class. help request object a collection of help info objects Add an help entry to cache. the key of the help entry helpInfo object as the value of the help entry Get help entry from cache the key for the help entry to retrieve the HelpInfo in cache corresponding the key specified This will reset the help cache. Normally this corresponds to a help culture change. This is for child class to indicate that it has implemented a custom way of match. Is cached fully loaded? If cache is fully loaded, search/exactmatch Help can short cut the logic in various help providers to get help directly from cache. This indicator is usually set by help providers derived from this class. Class MamlCommandHelpInfo keeps track of help information to be returned by command help provider. Class BaseCommandHelpInfo provides common functionality for extracting information from FullHelp property. Returns the Uri used by get-help cmdlet to show help online. Returns only the first uri found under RelatedLinks. Null if no Uri is specified by the helpinfo or a valid Uri. Specified Uri is not valid. Returns true if help content in help info matches the pattern contained in . The underlying code will usually run pattern.IsMatch() on content it wants to search. Cmdlet help info looks for pattern in Synopsis and DetailedDescription Returs help information for a parameter(s) identified by pattern pattern to search for parameters A collection of parameters that match pattern Name of command. Name of command Synopsis for this command help. Synopsis for this command help Help category for this command help, which is constantly HelpCategory.Command. Help category for this command help Detailed Description string of this cmdlet help info. Constructor for custom HelpInfo object construction This is used by the CommandHelpProvider class to generate the default help UX when no help content is present. Constructor for MamlCommandHelpInfo. This constructor will call the corresponding constructor in CommandHelpInfo so that xmlNode will be converted a mamlNode. This constructor is intentionally made private so that the only way to create MamlCommandHelpInfo is through static function Load(XmlNode node) where some sanity check is done. Override the FullHelp PSObject of this provider-specific HelpInfo with generic help. Add user-defined command help data to command help. User defined data object Create a MamlCommandHelpInfo object from an XmlNode. xmlNode that contains help info help category this maml object fits into MamlCommandHelpInfo object created Given a PSObject, this method will traverse through the objects properties, extracts content from properities that are of type System.String, appends them together and returns. Returns true if help content in help info matches the pattern contained in . The underlying code will usually run pattern.IsMatch() on content it wants to search. Cmdlet help info looks for pattern in Synopsis and DetailedDescription Full help object for this help item. Full help object for this help item. Examples string of this cmdlet help info. Notes string of this cmdlet help info. Component for this command. Role for this command Functionality for this command Class CommandHelpProvider implement the help provider for commands. Command Help information are stored in 'help.xml' files. Location of these files can be found from through the engine execution context. Constructor for CommandHelpProvider Gets the help file name from a workflow ExactMatchHelp implementation for this help provider. ExactMatchHelp is overrided instead of DoExactMatchHelp to make sure all help item retrival will go through command discovery. Because each help file can contain multiple help items for different commands. Directly retrieve help cache can result in a invalid command to contain valid help item. Forcing each ExactMatchHelp to go through command discovery will make sure helpInfo for invalid command will not be returned. help request object This is a hashtable to track which help files are loaded already. This will avoid one help file getting loaded again and again. (Which should not happen unless some commandlet is pointing to a help file that actually doesn't contain the help for it). Finds a help file associated with the given cmdlet Load help file for HelpInfo objects. The HelpInfo objects will be put into help cache. 1. Needs to pay special attention about error handling in this function. Common errors include: file not found and invalid xml. None of these error should cause help search to stop. 2. a helpfile cache is used to avoid same file got loaded again and again. Process user defined help data by finding the corresponding helpInfo and inserting necessary helpdata info to command help. PSSnapIn Name for the current help file. Gets the HelpInfo object corresponding to the command. help file identifier (either name of PSSnapIn or simply full path to help file) Name of the command. HelpInfo object. Gets the HelpInfo object corresponding to the CommandInfo. help file identifier (simply full path to help file) HelpInfo object. Tries to get the help for command from cache. If help content is not found in cache, then constructs an HelpInfo object using CmdletInfo.Definition. HelpInfo object representing help for the command. Used to retrieve helpinfo by removing the prefix from the noun portion of a command name. Import-Module and Import-PSSession supports changing the name of a command by suppling a custom prefix. In those cases, the help content is stored by using the original command name (without prefix) as the key. This method retrieves the help content by suppressing the prefix and then making a copy of the help contnet + change the name and then returns the copied help content. Copied help content or null if no help content is found. Prepends mshsnapin id to the cmdlet name and adds the result to help cache. PSSnapIn name that this cmdlet belongs to. Name of the cmdlet. Help object for the cmdlet. Check whether a HelpItems node indicates that the help content is authored using maml schema. This covers two cases: a. If the help file has an extension .maml. b. If HelpItems node (which should be the top node of any command help file) has an attribute "schema" with value "maml", its content is in maml schema Search help for a specific target. help request object If true, searches for pattern in the help content of all cmdlets. Otherwise, seraches for pattern in the cmdlet names. Check if a helpInfo object matches the component/role/functionality criteria from helpRequest. Checks whether matches any of the patterns present in content to search in. string patterns to look for. true if contains any of the patterns present in false otherwise. Process helpInfo forwarded over from other other providers, specificly AliasHelpProvider. This can return more than 1 helpinfo object. HelpInfo that is forwarded over Help request object The result helpInfo objects after processing This will reset the help cache. Normally this corresponds to a help culture change. Gets a command searcher used for ExactMatch help lookup. Gets a command searcher used for searching help. Name of this provider Name of this provider Help category for this provider, which is a constant: HelpCategory.Command. Help category for this provider This is the class to track the user-defined Help Data which is separate from the commandHelp itself. Legally, user-defined Help Data should be within the same file as the corresponding commandHelp and it should appear after the commandHelp. Stores help information related to Alias Commands. Initializes a new instance of the AliasHelpInfo class. The constructor is private. The only way to create an AliasHelpInfo object is through static method Creates an AliasHelpInfo instance based on an AliasInfo object. This is the only way to create AliasHelpInfo object from outside this class. AliasInfo object for which to create AliasHelpInfo object. AliasHelpInfo object. Returns the name of alias help. Name of alias help. Returns synopsis of alias help. Synopsis of alias help. Help category for alias help. This is always HelpCategory.Alias Help category for alias help Returns full help object for alias help. Full help object of alias help. Implements the help provider for alias help. Unlike other help providers, AliasHelpProvider directly inherits from HelpProvider instead of HelpProviderWithCache. This is because alias can be created/removed/updated in a Microsoft Command Shell session. And thus caching may result in old alias being cached. The real information for alias is stored in command help. To retrieve the real help information, help forwarding is needed. Initializes a new instance of AliasHelpProvider class. Session state for current Microsoft Command Shell session _sessionState is mainly used for alias help search in the case of wildcard search patterns. This is currently not achievable through _commandDiscovery. Command Discovery object for current session. _commandDiscovery is mainly used for exact match help for alias. The AliasInfo object returned from _commandDiscovery is essential in creating AliasHelpInfo. Exact match an alias help target. This will a. use _commandDiscovery object to retrieve AliasInfo object. b. Create AliasHelpInfo object based on AliasInfo object help request object help info found Search an alias help target. This will, a. use _sessionState object to get a list of alias that match the target. b. for each alias, retrive help info as in ExactMatchHelp. help request object If true, searches for pattern in the help content. Individual provider can decide which content to search in. If false, seraches for pattern in the command names. a IEnumerable of helpinfo object Name of alias help provider Name of alias help provider Help category of alias help provider, which is a constant: HelpCategory.Alias. Help category of alias help provider. Class HelpFileHelpInfo keeps track of help information to be returned by command help provider. Constructor for HelpFileHelpInfo This is made private intentally so that the only way to create object of this type is through GetHelpInfo(string name, string text, string filename) help topic name help text file name that contains the help text Get help info based on name, text and filename help topic name help text file name that contains the help text HelpFileHelpInfo object created based on information provided Get the text corresponding to a line in input text. text to get the line for line number the part of string in text that is in specified line Name for the help info Name for the help info Synopsis for the help info Synopsis for the help info Help category for the help info Help category for the help info Full help object for this help info Full help object for this help info Class HelpFileHelpProvider implement the help provider for help.txt kinds of help contents. Help File help information are stored in '.help.txt' files. These files are located in the Monad / CustomShell Path as well as in the Application Base of PSSnapIns Constructor for HelpProvider Load help file based on the file path. file path to load help from Help info object loaded from the file This will reset the help cache. Normally this corresponds to a help culture change. This is a hashtable to track which help files are loaded already. This will avoid one help file getting loaded again and again. Name of the provider Name of the provider Help category of the provider Help category of the provider Class DefaultHelpProvider implement the help provider for commands. Command Help information are stored in 'help.xml' files. Location of these files can be found from CommandDiscovery. Constructor for HelpProvider help request object Class ProviderHelpInfo keeps track of help information to be returned by command help provider. Constructor for HelpProvider Returns true if help content in help info matches the pattern contained in . The underlying code will usually run pattern.IsMatch() on content it wants to search. Provider help info looks for pattern in Synopsis and DetailedDescription Create providerHelpInfo from an xmlNode xml node that contains the provider help info the providerHelpInfo object created Name of the provider for which this provider help info is for. Name of the provider Synopsis in the provider help info Synopsis in the provider help info Detailed description in the provider help info Detailed description in the provider help info Help category for this provider help info, which is constantly HelpCategory.Provider Help category for this provider help info Full help object for this provider help info Full help object for this provider help info Class ProviderHelpProvider implement the help provider for commands. Provider Help information are stored in 'help.xml' files. Location of these files can be found from CommandDiscovery. Constructor for HelpProvider Do exact match help based on the target. help request object This is a hashtable to track which help files are loaded already. This will avoid one help file getting loaded again and again. (Which should not happen unless some provider is pointing to a help file that actually doesn't contain the help for it). Load help file provided. This will load providerHelpInfo from help file into help cache. providerInfo for which to locate help. Search for provider help based on a search target. help request object If true, searches for pattern in the help content. Individual provider can decide which content to search in. If false, seraches for pattern in the command names. This will reset the help cache. Normally this corresponds to a help culture change. Name of this help provider. Name of this help provider. Help category of this provider. Help category of this provider MamlNode is an xml node in MAML schema. Maml schema includes formatting oriented tags like para, list etc, which needs to be taken care of during display. As a result, xml node in Maml schema can't be converted into PSObject directly with XmlNodeAdapter. MamlNode class provides logic in converting formatting tags into the format accetable by monad format and output engine. Following three kinds of formating tags are supported per our agreement with Maml team, 1. para, para text here 2. list, listItem Text here 3. definition list, definition term text here definition text here After processing, content of these three tags will be converted into textItem and its derivations, 1. para => paraTextItem para text here 2. list => a list of listTextItem's (which can be ordered or unordered) * text for list item 1 * text for list item 2 3. definitionList => a list of defintionTextItem's definition term here defintion text here Constructor for HelpInfo Convert an xmlNode into an PSObject. There are four scenarios, 1. Null xml, this will return an PSObject wrapping a null object. 2. Atomic xml, which is an xmlNode with only one simple text child node atomic xml text In this case, an PSObject that wraps string "atomic xml text" will be returned with following properties attribute => name 3. Composite xml, which is an xmlNode with structured child nodes, but not a special case for Maml formating. single child node text dup child node text 1 dup child node text 2 In this case, an PSObject will base generated based on an inside PSObject, which in turn has following properties a. property "singleChildNode", with its value an PSObject wrapping string "single child node text" b. property "dupChildNode", with its value an PSObject array wrapping strings for two dupChildNode's The outside PSObject will have property, a. property "attribute", with its value an PSObject wrapping string "attribute" 4. Maml formatting xml, this is a special case for Composite xml, for example para 1 list item 1 list item 2 term 1 definition list item 1 term 2 definition list item 2 In this case, an PSObject based on an PSObject array will be created. The inside PSObject array will contain following items . a MamlParaTextItem based on "para 1" . a MamlUnorderedListItem based on "list item 1" . a MamlUnorderedListItem based on "list item 2" . a MamlDefinitionListItem based on "definition list item 1" . a MamlDefinitionListItem based on "definition list item 2" The outside PSObject will have a property attribute => "value" Get inside PSObject created based on inside nodes of xmlNode. The inside PSObject will be based on null. It will created one property per inside node grouping by node names. For example, for xmlNode like, get-item note 1 note 2 It will create an PSObject based on null, with following two properties . property 1: name="name" value=an PSObject to wrap string "get-item" . property 2: name="note" value=an PSObject array with following two PSObjects 1. PSObject wrapping string "note 1" 2. PSObject wrapping string "note 2" This is for getting inside properties of an XmlNode. Properties are stored in a hashtable with key as property name and value as property value. Inside node with same node names will be grouped into one property with property value as an array. For example, for xmlNode like, get-item note 1 note 2 It will create an PSObject based on null, with following two properties . property 1: name="name" value=an PSObject to wrap string "get-item" . property 2: name="note" value=an PSObject array with following two PSObjects 1. PSObject wrapping string "note 1" 2. PSObject wrapping string "note 2" Since we don't know whether an node name will be used more than once, We are making each property value is an array (PSObject[]) to start with. At the end, SimplifyProperties will be called to reduce PSObject[] containing only one element to PSObject itself. Removes unsupported child nodes recursively from the given xml node so that they wont spoil the format. Node whose children are verified for maml. This is for adding a property into a property hashtable. As mentioned in comment of GetInsideProperties, property values stored in property hashtable is an array to begin with. The property value to be added is an mshObject whose base object can be an PSObject array itself. In that case, each PSObject in the array will be added separately into the property value array. This case can only happen when an node with maml formatting node inside is treated. The side effect of this is that the properties for outside mshObject will be lost. An example of this is that, After the processing, PSObject corresponding to command will have an property with name "description" and a value of an PSObject array created based on maml formatting node inside "description" node. The attribute of description node "attrib1" will be lost. This seems to be OK with current practice of authoring monad command help. property hastable property name property value This is for simplifying property value array of only one element. As mentioned in comments for GetInsideProperties, this is needed to reduce an array of only one PSObject into the PSObject itself. A side effect of this function is to turn property values from ArrayList into PSObject[]. An xmlNode is atomic if it contains no structured inside nodes. Check whether an xmlNode contains childnodes which is for maml formatting. Check whether a node is for maml formatting. This include following nodes, a. para b. list c. definitionList Check whether an mshObject is created from a maml formatting node. Convert an xmlNode containing maml formatting nodes into an PSObject array. For example, for node, para 1 list item 1 list item 2 term 1 definition list item 1 term 2 definition list item 2 In this case, an PSObject based on an PSObject array will be created. The inside PSObject array will contain following items . a MamlParaTextItem based on "para 1" . a MamlUnorderedListItem based on "list item 1" . a MamlUnorderedListItem based on "list item 2" . a MamlDefinitionListItem based on "definition list item 1" . a MamlDefinitionListItem based on "definition list item 2" Gets the number of para nodes Write an error to helpsystem to indicate an invalid maml child node. Write an error to help system to indicate an invalid child node count. Convert a para node into an mshObject. For example, para text In this case, an PSObject of type "MamlParaTextItem" will be created with following property a. text="para text" Convert a list node into an PSObject array. For example, text for list item 1 text for list item 2 In this case, an array of PSObject, each of type "MamlOrderedListText" will be created with following two properties, a. tag=" 1. " or " 2. " b. text="text for list item 1" or "text for list item 2" In the case of unordered list, similiar PSObject will created with type to be "MamlUnorderedListText" and tag="*" Check whether a list is ordered or not. Convert an listItem node into an PSObject with property "tag" and "text" Convert definitionList node into an array of PSObject, an for each definitionListItem node inside this node. Convert an definitionListItem node into an PSObject For example term text definiton text In this case, an PSObject of type "definitionListText" will be created with following properties a. term="term text" b. definition="definition text" Get the text for definition. The will treat some intermediate nodes like "definition" and "para" This is for getting preformatted text from an xml document. Normally in xml document, preformatted text will be indented by a fix amount based on its position. The task of this function is to remove that fixed amount from the text. For example, in xml, void function() { // call some other function here; } we can find that the preformatted text are indented unanimously by 4 spaces because of its position in xml. After massaging in this function, the result text will be, void function { // call some other function here; } please notice that the indention is reduced. Trim empty lines from the either end of an string array. lines to trim an string array with empty lines trimed on either end Get mininum indentation of a paragraph Get indetation of a line, i.e., number of spaces at the beginning of the line. Test whether a line is empty. A line is empty if it contains only white spaces. Underline xmlNode for this MamlNode object mshObject which is converted from XmlNode. This is for tracking the set of errors happened during the parsing of maml text. The exception that is thrown when there is no help category matching a specific input string. Initializes a new instance of the HelpCategoryInvalidException class. The name of help category that is invalid. Initializes a new instance of the HelpCategoryInvalidException class. Initializes a new instance of the HelpCategoryInvalidException class. The name of help category that is invalid. The inner exception of this exception Creates an internal error record based on helpCategory. Initializes a new instance of the HelpCategoryInvalidException class. Serialization information. Streaming context. Populates a with the data needed to serialize the HelpCategoryInvalidException object. The to populate with data. The destination for this serialization. Gets ErrorRecord embedded in this exception. ErrorRecord instance Gets name of the help category that is invalid. Name of the help category. Gets exception message for this exception. Error message. The exception that is thrown when there is no help found for a topic. Initializes a new instance of the HelpNotFoundException class with the give help topic. The help topic for which help is not found. Initializes a new instance of the HelpNotFoundException class. Initializes a new instance of the HelpNotFoundException class with the given help topic and associated exception. The help topic for which help is not found. The inner exception. Creates an internal error record based on helpTopic. The ErrorRecord created will be stored in the _errorRecord member. Initializes a new instance of the HelpNotFoundException class. Serialization information. Streaming context. Populates a with the data needed to serialize the HelpNotFoundException object. The to populate with data. The destination for this serialization. Gets ErrorRecord embedded in this exception. ErrorRecord instance. Gets help topic for which help is not found. Help topic. Gets exception message for this exception. Error message. Class HelpProviderWithFullCache provides a pseudo implementation of HelpProvider at which results are fully cached in a hashtable after initial cache load. This class is different from HelpProviderWithCache class in the sense that help contents for this provider can be loaded once and be used for later search. So logically class derived from this class only need to provide a way to load and initialize help cache. Constructor for HelpProviderWithFullCache Exact match help for a target. This function will be sealed right here since this is no need for children class to override this member. help request object The HelpInfo found. Null if nothing is found Do exact match help for a target. This member is sealed right here since children class don't need to override this member. help request object Search help for a target. This function will be sealed right here since this is no need for children class to override this member. help request object If true, searches for pattern in the help content. Individual provider can decide which content to search in. If false, seraches for pattern in the command names. a collection of help info objects Do search help. This function will be sealed right here since this is no need for children class to override this member. help request object a collection of help info objects Load cache for later searching for help. This is the only member child class need to override for help search purpose. This function will be called only once (usually this happens at the first time when end user request some help in the target help category). Class FaqHelpProvider implement the help provider for faq's. Faq Help information are stored in 'faq.xml' files. These files are located in the Monad / CustomShell Path as well as in the Application Base of PSSnapIns Constructor for FaqHelpProvider Load cache for faq help's Load help file for HelpInfo objects. The HelpInfo objects will be put into help cache. 1. Needs to pay special attention about error handling in this function. Common errors include: file not found and invalid xml. None of these error should cause help search to stop. This will reset the help cache. Normally this corresponds to a help culture change. This is a hashtable to track which help files are loaded already. This will avoid one help file getting loaded again and again. Name of this provider Name of this provider Help category for this provider, which is a constant: HelpCategory.FAQ. Help category for this provider Class FaqHelpInfo keeps track of help information to be returned by faq help provider. Constructor for FaqHelpInfo This constructor is can be called only from constructors of derived class for FaqHelpInfo. The only way to to create a FaqHelpInfo is through static function Load(XmlNode node) where some sanity check is done. Returns true if help content in help info matches the pattern contained in . The underlying code will usually run pattern.IsMatch() on content it wants to search. FAQ help info looks for pattern in Synopsis and Answers Create a FaqHelpInfo object from an XmlNode. xmlNode that contains help info FaqHelpInfo object created Name of faq. Name of faq Synopsis for this faq help. Synopsis for this faq help Help category for this faq help, which is constantly HelpCategory.FAQ. Help category for this faq help Full help object for this help item. Full help object for this help item. Answers string of this FAQ help info. Class GlossaryHelpProvider implement the help provider for glossary's. Glossary Help information are stored in 'glossary.xml' files. These files are located in the Monad / CustomShell Path as well as in the Application Base of PSSnapIns Constructor for GlossaryHelpProvider This is for implementing CustomMatch algorithm to be used in HelpProviderWithCache for matching a help target with keys in help cache. For each glossary entry, it can contain multiple terms. The key stored in help cache is a concatenation of keys. For example, if there are two terms "foo" and "bar", the key to be used in help cache will be "foo, bar". Because of this mangling, key "foo, bar" should match both "foo" and "bar". target to search key used in cache table Load cache for glossary help's Load help file for HelpInfo objects. The HelpInfo objects will be put into help cache. 1. Needs to pay special attention about error handling in this function. Common errors include: file not found and invalid xml. None of these error should cause help search to stop. This will reset the help cache. Normally this corresponds to a help culture change. This is a hashtable to track which help files are loaded already. This will avoid one help file getting loaded again and again. Name of this provider Name of this provider Help category for this provider, which is a constant: HelpCategory.Command. Help category for this provider Class GlossaryHelpInfo keeps track of help information to be returned by glossary help provider. Constructor for GlossaryHelpInfo This constructor is can be called only from constructors of derived class for GlossaryHelpInfo. The only way to to create a GlossaryHelpInfo is through static function Load(XmlNode node) where some sanity check is done. Create a GlossaryHelpInfo object from an XmlNode. xmlNode that contains help info GlossaryHelpInfo object created Name of glossary. Name of glossary Synopsis for this glossary help. Synopsis for this glossary help Help category for this glossary help, which is constantly HelpCategory.Glossary. Help category for this glossary help Full help object for this help item. Full help object for this help item. Class GeneralHelpProvider implement the help provider for general help topics. General Help information are stored in 'concept.xml' files. These files are located in the Monad / CustomShell Path as well as in the Application Base of PSSnapIns Constructor for GeneralHelpProvider Load cache for general help's Load help file for HelpInfo objects. The HelpInfo objects will be put into help cache. 1. Needs to pay special attention about error handling in this function. Common errors include: file not found and invalid xml. None of these error should cause help search to stop. This will reset the help cache. Normally this corresponds to a help culture change. This is a hashtable to track which help files are loaded already. This will avoid one help file getting loaded again and again. Name of this provider Name of this provider Help category for this provider, which is a constant: HelpCategory.Command. Help category for this provider Class GeneralHelpInfo keeps track of help information to be returned by general help provider. Constructor for GeneralHelpInfo This constructor is can be called only from constructors of derived class for GeneralHelpInfo. The only way to to create a GeneralHelpInfo is through static function Load(XmlNode node) where some sanity check is done. Create a GeneralHelpInfo object from an XmlNode. xmlNode that contains help info GeneralHelpInfo object created Name of help content. Name of help content Synopsis for this general help. Synopsis for this general help Help category for this general help, which is constantly HelpCategory.General. Help category for general help Full help object for this help item. Full help object for this help item. HelpErrorTracer is a class to help tracing errors happened during loading help content for a help topic. This class tracks help context information like help topic, help category and help file, which are usually not available when an error happens at down level. Following is how this class can be used. using(HelpErrorTracer.Trace(helpTopic, helpCategory, helpFile)) { InsideFunctionCall(); } At this moment, a TraceFrame instance, which is disposable, will be created. In inside function calls and the calls down on the call stack, error can be traced by calling, HelpErrorTracer.TraceError(errorRecord) At this moment, the errorRecord will be temporarily stored with in TraceFrame instance. When the TraceFrame instance is disposed, all errorRecords stored will be dumped into HelpSystem.LastErrors with context information attached. This tracks all live TraceFrame objects, which forms a stack. This is the API to use for starting a help trace scope This is the api function used for adding errorRecords to TraceFrame's error pool. This is the api function used for adding errorRecords to TraceFrame's error pool. Track whether help error tracer is turned on. TraceFrame class track basic context information for current help activity. TraceFrame instance exists in a scope governed by using statement. It is possible that a new TraceFrame instance will be created in the scope of another TraceFrame instance. The scopes of various live TraceFrame instances form a stack which is similiar to call stacks of normal C# functions. This is why we call this class a "TraceFrame" TraceFrame itself implements IDisposable interface to guarrentee a chance to write errors into system error pool when execution gets out of its scope. During disposal time, errorRecords accumulated will be written to system error pool together with error context information collected at instance creation. Constructor. Here help context information will be collected. This is a interface for code in trace frame scope to add errorRecord into accumulative error pool. This is a interface for code in trace frame scope to add errorRecord's into accumulative error pool. This is where we dump ErrorRecord's accumulated to help system error pool together with some context information. Help request is a set of data to be passed into monad help engine for requesting help contents. Help request track information including 1. target 2. category filter 3. provider 4. dynamic parameters 5. components 6. functionalities 7. roles Upon getting a help request, help engine will validate the help request and send the request to necessary help providers for processing. Constructor for HelpRequest Create a copy of current help request object. Following validation will be done, (in order) 1. If everything is empty, do default help. 2. If target is empty, set it to be provider if currently doing provider help only. Otherwise, set it to be * 3. If any special parameters like component, role, functionality are specified, do command help only. 4. If command help is requested, search for alias also. 5. If help category is none, set it to be all. 6. Don't do default help. Defines which provider the user seeking help is curious about. Target for help. Help category filter Provider for this help. If provider is set and helpCategory is 'Provider', provider help will be returned. (Also the value of target will be set to this one). If provider is set and helpCategory is 'Command', this will add provider specific help to provider. Maximum number of result to return for this request. Component filter for command help. Role filter for command help. Functionality filter for command help. Keeps track of get-help cmdlet call origin. It can be called directly by the user or indirectly by a script that a user calls. Constructor. It is private so that MUIFileSearcher is used only internal for this class. To access functionality in this class, static api should be used. A constructor to make searchMode optional. _uniqueMatches is used to track matches already found during the search process. This is useful for ignoring duplicates in the case of unique search. search for files using the target, searchPaths member of this class. Search for files of a particular pattern under a particular directory. This will do MUI search in which appropriate language directories are searched in order. A help file is located in 3 steps 1. If file itself contains a path itself, try to locate the file from path. LocateFile will fail if this file doesn't exist. 2. Try to locate the file from searchPaths. Normally the searchPaths will contain the cmdlet/provider assembly directory if currently we are searching help for cmdlet and providers. 3. Try to locate the file in the default PowerShell installation directory. Helper method which returns the default monad installation path based on ShellID registry key. string representing path. If ShellID is not defined or Path property is not defined returns null. Search for files in default search paths. Search for files in specified search paths. Locate a file in default search paths Get the file in different search paths corresponding to current culture. The file name to search is the filename part of path parameter. (Normally path parameter should contain only the filename part. But it is possible for RunspaceConfiguration to directly specify a hard coded path for help file there). This is the path to the file. If it has a path, we need to search under that path first Additional search paths Search target. It can be 1. a file name 2. a search pattern It can also include a path, in that case, 1. the path will be searched first for the existense of the files. Search path as provided by user. Search mode for this file search. Result of the search. This enum defines different search mode for the MUIFileSearcher Parses help comments and turns them into HelpInfo objects Create the maml xml after a successful analysis of the comments. The xml node for the command constructed Split the text in the comment token into multiple lines, appending commentLines. A single line or multiline comment token Collect the text of a section. Stop collecting the section when a new directive is found (even if it is an unknown directive). The comment block, as a list of lines. The text of the help section, with 'i' left on the last line collected. Look for special comments indicating the comment block is meant to be used for help. The list of comments to process True if any special comments are found, false otherwise. The analysis of the comments finds the component, functionality, and role fields, but those fields aren't added to the xml because they aren't children of the command xml node, they are under a sibling of the command xml node and apply to all command nodes in a maml file. The helpInfo object to set the fields on. Analyze a block of comments to determine if it is a special help block. The block of comments to analyze. true if the block is our special comment block for help, false otherwise. Class MamlCommandHelpInfo keeps track of help information to be returned by command help provider. Class ScriptCommandHelpProvider implement the help provider for Functions/ExternalScripts. This class does the same thing as CommandHelpProvider except for decision making: whether a particular command is Function/Script or not. Command Help information are stored in 'help.xml' files. Location of these files can be found from through the engine execution context. Constructor for CommandHelpProvider Gets a command searcher used for ExactMatch help lookup. Gets a command searcher used for searching help. Help category for this provider, which is a constant: HelpCategory.Command. Help category for this provider Class HelpFileHelpInfo keeps track of help information to be returned by command help provider. Constructor for SyntaxHelpInfo Get help info based on name, text and filename help topic name help text help category SyntaxHelpInfo object created based on information provided Name for the help info Name for the help info Synopsis for the help info Synopsis for the help info Full help object for this help info Full help object for this help info Positional parameter comparer The help object builder class attempts to create a full HelpInfo object from a CmdletInfo object. This is used to generate the default UX when no help content is present in the box. This class mimics the exact same structure as that of a MAML node, so that the default UX does not introduce regressions. Generates a HelpInfo PSObject from a CmdletInfo object command info HelpInfo PSObject Adds the details properties HelpInfo object command name command noun command verb type name for help synopsis Adds the syntax properties HelpInfo object command name parameter sets common parameters common workflow parameters type name for help Add the syntax item properties HelpInfo object cmdlet name, you can't get this from parameterSets a collection of parameter sets common parameters common workflow parameters type name for help Add the syntax parameters properties (these parameters are used to create the syntax section) HelpInfo object a collection of parameters in display order ie., Postional followed by Named Mandatory (in alpha numeric) followed by Named (in alpha numeric) common parameters common workflow Name of the parameter set for which the syntax is generated Adds a parameter value group (for enums) object parameter group values Add the parameters properties (these parameters are used to create the parameters section) HelpInfo object parameters common parameters common workflow parameters type name for help Adds the parameter properties HelpInfo object parameter name parameter aliases is dynamic parameter? parameter type parameter attributes Name of the parameter set for which the syntax is generated Adds the parameterType properties HelpInfo object the type of a parameter the attributes of the parameter (needed to look for PSTypeName) Adds the parameterValue properties HelpInfo object the type of a parameter the attributes of the parameter (needed to look for PSTypeName) Adds the InputTypes properties HelpInfo object command parameters Adds the OutputTypes properties HelpInfo object output types Adds the aliases properties HelpInfo object command name execution context Adds the remarks properties HelpInfo object Adds the related links properties Gets the parameter attribute from parameter metadata parameter attributes parameter attributes Gets the validate set attribute from parameter metadata parameter attributes parameter attributes Gets the pipeline input type parameter attribute pipeline input type Checks if a set of parameters contains any of the common parameters parameters to check true if it contains common parameters, false otherwise Checks if a parameter is a common parameter parameter name true if it is a common parameter, false if not Checks if a parameter is a common workflow parameter parameter name true if it is a common parameter, false if not Checks if the module contains HelpInfoUri The base class of all updatable help system cmdlets (Update-Help, Save-Help) Handles help system progress events event sender event arguments Static constructor Checks if a module is a system module, a module is a system module if it exists in the metadata cache. module name true if system module, false if not Class constructor command type Gets a list of modules from the given pattern execution context pattern to search check only loaded modules do not generate errors for modules without HelpInfoUri a list of modules Handles Ctrl+C End processing Main cmdlet logic Processes a module with potential globbing module name with globbing Processes a single module with multiple cultures module to process Process a single module with a given culture module to process culture to use true if the module has been processed, false if not Gets a list of modules from the given pattern pattern to match check only loaded modules skip errors a list of modules Checks if it is necessary to update help ModuleInfo current HelpInfo.xml new HelpInfo.xml current culture force update true if it is necessary to update help, false if not Checks if the user has attempted to update more than once per day per module module name path to help info help info file name current time (UTC) if -Force is specified true if we are okay to update, false if not Resolves a given path to a list of directories path to resolve resolve recursively? Treat the path / start path as a literal path?/// a list of directories Resolves a given path to a list of directories recursively path to resolve a list of directories Validates the provider of the path, only FileSystem provider is accepted. path to validate Loggs a command message message to log Processes an exception for help cmdlets module name culture info exception to check Specifies the languages to update Gets or sets the credential parameter Directs System.Net.WebClient whether or not to use default credentials Forces the operation to complete Represents each supported culture Class constructor culture info version info Culture version Supported culture This class represents the HelpInfo metadata XML Class constructor unresolved help content URI supported UI cultures Checks if the other HelpInfo has a newer version HelpInfo object to check culture to check true if the other HelpInfo is newer, false if not Checks if a culture is supported culture to check true if supported, false if not Gets a string representation of the supported cultures supported cultures in string Gets the culture version culture info culture version Unresolved URI Link to the actual help content Supported UI cultures Updatable help system internal representation of the PSModuleInfo class Class constructor module name module GUID module path HelpInfo URI Gets the combined HelpContent.zip name current culture HelpContent name Gets the combined HelpInfo.xml name HelpInfo name Module name Module GUID Module path HelpInfo URI Updatable help system exception Class constructor FullyQualifiedErrorId exception message category target object inner exception Class constructor serialization info streaming context Fully qualified error id Error category Target object Exception context Class constructor exception to wrap Creates an error record from this context command type error record Gets the exception message A list of modules A list of UI cultures Gets the help system exception Enumeration showing Update or Save help Progress event arguments Class constructor module name progress status progress percentage Class constructor module name command type progress status progress percentage Progress status Progress percentage Module name Command type This class implements the Updatable Help System common operations Class constructor Disposes the help system Gets the current UIculture (includes the fallback chain) a list of cultures Gets an internal help URI internal module information help content culture internal help uri representation Gets the HelpInfo xml from the given URI command type HelpInfo URI module name module GUID current UI culture HelpInfo object Sends a standard HTTP request to get the resolved URI (potential FwLinks) base URI resolved URI HelpInfo.xml schema Creates a HelpInfo object XML text module name module GUID current UI cultures overrides the path contained within HelpInfo.xml HelpInfo object Creates a valid xml document input xml schema namespace xml schema validation event handler HelpInfo or HelpContent? Handles HelpInfo XML validation events event sender event arguments Handles Help content MAML validation events event sender event arguments Cancels all asynchronous download operations Downloads and installs help content command type execution context destination paths file names culture to update help content uri path of the maml XSDs files installed true if the operation succeeded, false if not Downloads the help cotent command type destination path help content uri combined file name culture name true if the operation succeeded, false if not Installs HelpInfo.xml culture updated version updated help content uri destination name combined file name forces the file to copy Removes the read only attribute Installs (unzips) the help content command type execution context source directory destination paths help content file name temporary path current culture path of the maml XSDs files installed Directory pointed by (if any) will be deleted. Unzips to help content to a given location execution context source path destination path Validates all XML files within a given path path containing files to validate destination paths culture name path of the maml XSDs installed files Loads string from the given path cmdlet instance path to load credential string loaded Gets the default source path from GP Sets the DisablePromptToUpdatableHelp regkey Checks if it is necessary to prompt to update help Handles the download completion event event sender event arguments Handles the download progress changed event event sender event arguments Help system errors Controls the updatable help system drive Disposes the class Gets the drive name This class represents a help system URI Class constructor module name module guid UI culture resolved URI Module name Module GUID UI Culture Resolved URI This class implements the Update-Help cmdlet Class constructor Begin processing Main cmdlet logic Process a single module with a given culture module to process culture to use true if the module has been processed, false if not Throws PathMustBeValidContainers exception Specifies the modules to update Specifies the paths to update from Specifies the literal path to save updates to Scans paths recursively This class implements the Save-Help cmdleto Class constructor Validation Process a single module with a given culture module to process culture to use true if the module has been processed, false if not Specifies the paths to save updates to Specifies the literal path to save updates to Specifies the modules to update Base class for AsyncResult objects that are returned by various Async operations supported by RunspacePool , PowerShell types Constructor Instace Id of the object creating this instance A AsyncCallback to call once the async operation completes. A user supplied state object Marks the async operation as completed. Exception occured. null if no exception occured Release the asyncResult without calling the callback. Signal wait handle of this async result. Wait for the operation to complete and throw the exception if any. This always returns false Gets an indication whether the asynchronous operation has completed. This is not supported and returns null. Gets a System.Threading.WaitHandle that is used to wait for an asynchronous operation to complete. Instance Id of the object owning this async result. Gets the exception that occurred while processing the async operation. User supplied callback. SyncObject Provides a description of a choice for use by . Initializes an new instance of ChoiceDescription and defines the Label value. The label to identify this field description is null or empty. Initializes an new instance of ChoiceDescription and defines the Label and HelpMessage values. The label to identify this field description. The help message for this field. is null or empty. is null. Gets a short, human-presentable message to describe and identify the choice. Think Button label. Note that the special character & (ampersand) may be embedded in the label string to identify the next character in the label as a "hot key" (aka "keyboard accelerator") that the Console.PromptForChoice implementation may use to allow the user to quickly set input focus to this choice. The implementation of is responsible for parsing the label string for this special character and rendering it accordingly. For examples, a choice named "Yes to All" might have "Yes to &All" as it's label. Gets and sets the help message for this field. Set to null. This should be a few sentences to describe the field, suitable for presentation as a tool tip. Avoid placing including formatting characters such as newline and tab. Defines a Command object which can be added to object for invocation. Initializes a new instance of Command class using specified command parameter. Name of the command or script contents command is null Initializes a new instance of Command class using specified command parameter. The command name or script contents True if this command represents a script, otherwise; false. command is null Constructor The command name or script contents True if this command represents a script, otherwise; false. if true local scope is used to run the script command command is null Copy constructor for clone operations The source instance. Creates a new that is a copy of the current instance. A new that is a copy of this instance. for diagnostic purposes Merges this commands resutls Pipeline stream to be redirected. Pipeline stream in to which myResult is merged myResult parameter is not PipelineResultTypes.Error or toResult parameter is not PipelineResultTypes.Output Currently only operation supported is to merge error of command to output of command. Set the merge settings on commandProcessor Create a CommandProcessorBase for this Command The collection of paramters that have been added. The command string passed in at ctor time. The command info passed in at ctor time. Does this instance represent a script? This is used for script commands (i.e. _isScript is true). If _useLocalScope is true, script is run in LocalScope. If null, it was unspecified and a suitable default is used (true for non-script, false for script). Note that the public property is bool, not bool? (from V1), so it should probably be deprecated, at least for internal use. Creates a Command object from a PSObject property bag. PSObject has to be in the format returned by ToPSObjectForRemoting method. PSObject to rehydrate Command rehydrated from a PSObject property bag Thrown if the PSObject is null. Thrown when the PSObject is not in the expected format Returns this object as a PSObject property bag that can be used in a remoting protocol data object. PowerShell remoting protocol version This object as a PSObject property bag Gets the set of parameters for this command. This property is used to add positional or named parameters to the command. Access the command string. The command name, if is false; otherwise; the script contents Access the commandInfo. The command info object Access the value indicating if this represents a script. Access the value indicating if LocalScope is to be used for running this script command. True if this command is a script and localScope is used for executing the script This value is always false for non-script commands Access the actual value indicating if LocalScope is to be used for running this script command. Needed for serialization in remoting. Checks if the current command marks the end of a statement (see PowerShell.AddStatement()) Sets this command as the mergepoint for previous unclaimed commands' results Currently only supported operation is to merge Output and Error. Currently only supported operation is to merge Output and Error. Attempt to set the property to something other than PipelineResultTypes.Error | PipelineResultTypes.Output results in this exception. Internal accessor for _mergeInstructions. It is used by serialization code Enum defining the types of streams coming out of a pipeline Default streaming behavior Success output Error output Warning information stream Verbose information stream Debug information stream All streams Redirect to nothing. Defines a collection of Commands. This collection is used by to define elements of pipeline. Make the default constructor internal Adds a new command for given string command is null. Adds a new script command script contents scriptContents is null. Adds a new scrip command for given script script contents if true local scope is used to run the script command scriptContents is null. Gets the string represenation of the command collection to be used for history. string representing the command(s) Exception thrown when state of the runspace is different from expected state of runspace. Initializes a new instance of InvalidRunspaceStateException Initializes a new instance of InvalidRunspaceStateException with a specified error message. The message that describes the error. Initializes a new instance of the InvalidRunspaceStateException class with a specified error message and a reference to the inner exception that is the cause of this exception. The message that describes the error. The exception that is the cause of the current exception. Initializes a new instance of the InvalidRunspaceStateException with a specified error message and current and expected state. The message that describes the error. Current state of runspace Expected states of runspace Initializes a new instance of the class with serialized data. The that holds the serialized object data about the exception being thrown. The that contains contextual information about the source or destination. State of the runspace when exception was thrown. States of the runspace expected in method which throws this exception. Access CurrentState of the runspace. This is the state of the runspace when exception was thrown. Expected state of runspace by the operation which has thrown this exception. Defines various states of runspace. Beginning state upon creation A runspace is being established. The runspace is established and valid. The runspace is closed or has not been established. The runspace is being closed The runspace has been disconnected abnormally. The runspace is being disconnected. The runspace is disconnected. The runspace is Connecting. These options control whether a new thread is created when a command is executed within a runspace Use the default options: UseNewThread for local Runspace, ReuseThread for local RunspacePool, server settings for remote Runspace and RunspacePool Creates a new thread for each invocation Creates a new thread for the first invocation and then re-uses that thread in subsequent invocations. Doesn’t create a new thread; the execution occurs on the thread that calls Invoke. This option is not valid for asynchronous calls Defines type which has information about RunspaceState and Exception associated with RunspaceState Constructor for state changes not resulting from an error. The state of the runspace. Constructor for state changes with an optional error The state of runspace. A non-null exception if the state change was caused by an error, otherwise; null. Copy constructor to support cloning. The source RunspaceStateInfo override for ToString() Clones current object Cloned object State of runspace The reason for the state change, if caused by an error. The state of the runspace. The reason for the state change, if caused by an error. The value of this property is non-null if the state changed due to an error. Otherwise, the value of this property is null. Defines Event arguments passed to RunspaceStateEvent handler event. Constructs RunspaceStateEventArgs using RunspaceStateInfo The information about current state of the runspace. runspaceStateInfo is null RunspaceStateInfo when event raised. Information about state of the runspace This value indicates the state of the runspace after the change. Enum to indicate whether a Runspace is busy or available The Runspace is not been in the Opened state The Runspace is available to execute commands The Runspace is available to execute nested commands The Runspace is busy executing a command Defines the event arguments passed to the AvailabilityChanged event. Whether the Runspace is available to execute commands Defines runspace capabilities. No additional capabilites beyond a default runspace. Runspace and remoting layer supports disconnect/connect feature. Public interface to Msh Runtime. Provides APIs for creating pipelines, access session state etc. Explicit default constructor Used to store Runspace reference on per thread basis. Used by various PowerShell engine features to get access to TypeTable etc. Returns protocol version that the remote server uses for PS remoting Raises the AvailabilityChanged event Used to raise the AvailabilityChanged event when the state of the currently executing pipeline changes The possible pipeline states are NotStarted Running Disconnected Stopping Stopped Completed Failed Used to update the runspace availability when the state of the currently executing PowerShell instance changes The possible invocation states are NotStarted Running Stopping Stopped Completed Failed Used to update the runspace availability event when the state of the runspace changes The possible runspace states are: BeforeOpen Opening Opened Closed Closing Broken Used to update the runspace availability from Enter/ExitNestedPrompt and the debugger Raises the AvailabilityChanged event Queries the server for disconnected runspaces and creates an array of runspace objects associated with each disconnected runspace on the server. Each runspace object in the returned array is in the Disconnected state and can be connected to the server by calling the Connect() method on the runspace. Connection object for the target server. Array of Runspace objects each in the Disconnected state. Queries the server for disconnected runspaces and creates an array of runspace objects associated with each disconnected runspace on the server. Each runspace object in the returned array is in the Disconnected state and can be connected to the server by calling the Connect() method on the runspace. Connection object for the target server. Client host object. Array of Runspace objects each in the Disconnected state. Queries the server for disconnected runspaces and creates an array of runspace objects associated with each disconnected runspace on the server. Each runspace object in the returned array is in the Disconnected state and can be connected to the server by calling the Connect() method on the runspace. Connection object for the target server. Client host object. TypeTable object. Array of Runspace objects each in the Disconnected state. Disconnects the runspace synchronously. Disconnects the remote runspace and any running command from the server machine. Any data generated by the running command on the server is cached on the server machine. This runspace object goes to the disconnected state. This object can be reconnected to the server by calling the Connect() method. If the remote runspace on the server remains disconnected for the IdleTimeout value (as defined in the WSManConnectionInfo object) then it is closed and torn down on the server. RunspaceState is not Opened. Disconnects the runspace asynchronously. Disconnects the remote runspace and any running command from the server machine. Any data generated by the running command on the server is cached on the server machine. This runspace object goes to the disconnected state. This object can be reconnected to the server by calling the Connect() method. If the remote runspace on the server remains disconnected for the IdleTimeout value (as defined in the WSManConnectionInfo object) then it is closed and torn down on the server. RunspaceState is not Opened. Connects the runspace to its remote counterpart synchronously. Connects the runspace object to its corresponding runspace on the target server machine. The target server machine is identified by the connection object passed in during construction. The remote runspace is identified by the internal runspace Guid value. RunspaceState is not Disconnected. Connects a runspace to its remote counterpart asynchronously. Connects the runspace object to its corresponding runspace on the target server machine. The target server machine is identified by the connection object passed in during construction. The remote runspace is identified by the internal runspace Guid value. RunspaceState is not Disconnected. Creates a PipeLine object in the disconnected state for the currently disconnected remote running command associated with this runspace. Pipeline object in disconnected state. Creates a PowerShell object in the disconnected state for the currently disconnected remote running command associated with this runspace. PowerShell object in disconnected state. Returns Runspace capabilities. RunspaceCapability Opens the runspace synchronously. Runspace must be opened before it can be used. RunspaceState is not BeforeOpen Open the runspace Asynchronously. RunspaceState is not BeforeOpen Close the runspace synchronously. Attempts to execute pipelines after a call to close will fail. RunspaceState is BeforeOpen or Opening Close the runspace Asynchronously. Attempts to execute pipelines after a call to close will fail. RunspaceState is BeforeOpen or Opening Create an empty pipeline An empty pipeline Creates a pipeline for specified command string A valid command string A pipline pre-filled with a object for specified command parameter. command is null Create a pipeline from a command string. A valid command string if true command is added to history A pipline pre-filled with a object for specified command parameter. command is null Creates a nested pipeline. Nested pipelines are needed for nested prompt scenario. Nested prompt requires that we execute new pipelines( child pipelines) while current pipeline (lets call it parent pipeline) is blocked. Creates a nested pipeline. A valid command string if true command is added to history A pipline pre-filled with Command specified in commandString. command is null Returns the currently executing pipeline, or null if no pipeline is executing Private data to be used by applications built on top of PowerShell. Local runspace is created with application private data set to an empty . Remote runspace gets its application private data from the server (set when creating a remote runspace pool) Calling this method on a remote runspace will block until the data is received from the server. The server will send application private data before reaching state. Runspaces that are part of a inherit application private data from the pool. A method that runspace pools can use to propagate application private data into runspaces Disposes this runspace instance. Dispose will close the runspace if not closed already. Protected dispose which can be overridden by derived classes. Sets the base transaction for the runspace; any transactions created on this runspace will be nested to this instance The base transaction This overload uses RollbackSeverity.Error; i.e. the transaction will be rolled back automatically on a non-terminating error or worse Sets the base transaction for the runspace; any transactions created on this runspace will be nested to this instance The base transaction The severity of error that causes PowerShell to automatically rollback the transaction Clears the transaction set by SetBaseTransaction() Resets the variable table for the runspace to the default state. Gets and sets the default Runspace used to evaluate scripts The Runspace used to set this property should not be shared between different threads. ApartmentState of the thread used to execute commands within this Runspace Any updates to the value of this property must be done before the Runspace is opened An attempt to change this property was made after opening the Runspace This property determines whether a new thread is create for each invocation Any updates to the value of this property must be done before the Runspace is opened An attempt to change this property was made after opening the Runspace The thread options cannot be changed to the requested value Return version of this runspace Retrieve information about current state of the runspace Gets the current availability of the Runspace RunspaceConfiguration information for this runspace. InitialSessionState information for this runspace. Get unqiue id for this instance of runspace. It is primarily used for logging purposes Gets execution context. Runspace is not opened. Skip user profile on engine initialization Connection information for remote Runspaces, null for local Runspaces ConnectionInfo originally supplied by the user Manager for JobSourceAdapters registered in this runspace. Engine activity id (for ETW tracing) Event raised when RunspaceState changes. Event raised when the availability of the Runspace changes. Returns true if there are any subscribers to the AvailabilityChanged event Gets session state proxy Gets the execution context Returns true if the internal host is in a nested prompt Gets the debugger Gets the event manager This class provides subset of functionality provided by session state. Set a variable in session state. The name of the item to set. The new value of the item being set. name is null Runspace is not open. Another SessionStateProxy call or another pipeline is in progress. Get a variable out of session state. name of variable to look up The value of the specified variable. name is null Runspace is not open. Another SessionStateProxy call or another pipeline is in progress. Get the list of applications out of session state. Runspace is not open. Another SessionStateProxy call or another pipeline is in progress. Get the list of scripts out of session state. Runspace is not open. Another SessionStateProxy call or another pipeline is in progress. Get the APIs to access drives out of session state Runspace is not open. Another SessionStateProxy call or another pipeline is in progress. Get/Set the language mode out of session state. Runspace is not open. Another SessionStateProxy call or another pipeline is in progress. Get the module info out of session state. Runspace is not open. Another SessionStateProxy call or another pipeline is in progress. Get the APIs to access paths and locations out of session state. Runspace is not open. Another SessionStateProxy call or another pipeline is in progress. Get the APIs to access a provider out of session state. Runspace is not open. Another SessionStateProxy call or another pipeline is in progress. Get the APIs to access variables out of session state. Runspace is not open. Another SessionStateProxy call or another pipeline is in progress. Get the APIs to build script blocks and execute script out of session state. Runspace is not open. Another SessionStateProxy call or another pipeline is in progress. Gets the instance of the provider interface APIs out of session state. Runspace is not open. Another SessionStateProxy call or another pipeline is in progress. Runspaces is base class for different kind of Runspaces. There should be a class derived from it for each type of Runspace. Types of Runspace which we support are Local, X-AppDomain, X-Process and X-Machine. Construct an instance of an Runspace using a custom implementation of PSHost. The explicit PSHost implementation Host is null. host is null. configuration information for this minshell. Construct an instance of an Runspace using a custom implementation of PSHost. The explicit PSHost implementation Host is null. host is null. configuration information for this runspace instance. Construct an instance of an Runspace using a custom implementation of PSHost. The explicit PSHost implementation configuration information for this runspace instance. If true, don't make a copy of the initial session state object. Host is null. host is null. Open the runspace synchronously. RunspaceState is not BeforeOpen Open the runspace Asynchronously. RunspaceState is not BeforeOpen Opens the runspace. If true runspace is opened synchronously else runspaces is opened asynchronously RunspaceState is not BeforeOpen Derived class's open implementation Close the runspace synchronously. Attempts to execute pipelines after a call to close will fail. RunspaceState is BeforeOpen or Opening Close the runspace Asynchronously. Attempts to execute pipelines after a call to close will fail. RunspaceState is BeforeOpen or Opening Close the runspace If true runspace is closed synchronously else runspaces is closed asynchronously RunspaceState is BeforeOpen or Opening If SessionStateProxy has some method call in progress Derived class's close implementation If true runspace is closed synchronously else runspaces is closed asynchronously Disconnects the runspace synchronously. Disconnects the runspace asynchronously. Connects a runspace to its remote counterpart synchronously. Connects a runspace to its remote counterpart asynchronously. Creates a pipeline object in the Disconnected state. Pipeline Creates a powershell object in the Disconnected state. PowerShell Returns Runspace capabilities. RunspaceCapability Create an empty pipeline An empty pipeline Createa a pipeline froma command string A valid command string A pipline pre-filled with Commands specified in commandString. command is null Create a pipeline from a command string. A valid command string if true command is added to history A pipline pre-filled with Commands specified in commandString. command is null Creates a nested pipeline. Nested pipelines are needed for nested prompt scenario. Nested prompt requires that we execute new pipelines( child pipelines) while current pipeline (lets call it parent pipeline) is blocked. Creates a nested pipeline. A valid command string if true command is added to history A pipline pre-filled with Commands specified in commandString. command is null Create a pipeline from a command string A valid command string or String.Empty. if true command is added to history True for nested pipeline A pipline pre-filled with Commands specified in commandString. Raises the AvailabilityChanged event This is queue of all the state change event which have occured for this runspace. RaiseRunspaceStateEvents raises event for each item in this queue. We don't raise events from with SetRunspaceState because SetRunspaceState is often called from with in the a lock. Raising event with in a lock introduces chances of deadlock in GUI applications. Set the new runspace state. the new state An exception indicating the state change is the result of an error, otherwise; null. Sets the internal runspace state information member variable. It also adds RunspaceStateInfo to a queue. RaiseRunspaceStateEvents raises event for each item in this queue. Set the current runspace state - no error the new state Raises events for changes in runspace state. Add the pipeline to list of pipelines in execution. Pipeline to add to the list of pipelines in execution Thrown if the runspace is not in the Opened state. . Thrown if is null. Remove the pipeline from list of pipelines in execution. Pipeline to remove from the list of pipelines in execution Thrown if is null. Waits till all the pipelines running in the runspace have finished execution. Stops all the running pipelines Gets the currently executing pipeline. Internal because it is needed by invoke-history This method stops all the pipelines which are nested under specified pipeline This method ensures that SessionStateProxy call is allowed and if allowed it sets a variable to disallow further SessionStateProxy or pipeline calls. SetVariable implementation. This class does the necessary checks to ensure that no pipeline or other SessionStateProxy calls are in progress. It delegates to derived class worker method for actual operation. GetVariable implementation. This class does the necessary checks to ensure that no pipeline or other SessionStateProxy calls are in progress. It delegates to derived class worker method for actual operation. Protected methods to be implemented by derived class. This does the acutal work of setting variable. Name of the variable to set The value to set it to Protected methods to be implemented by derived class. This does the actual work of getting variable. Returns SessionState proxy object. The host implemented PSHost interface runspaceConfiguration information for this runspace runspaceConfiguration information for this runspace Return version of this runspace Retrieve information about current state of the runspace Gets the current availability of the Runspace Object used for synchronization Information about the computer where this runspace is created Original Connection Info that the user passed Event raised when RunspaceState changes. Event raised when the availability of the Runspace changes. Returns true if there are any subscribers to the AvailabilityChanged event Retrieve the current state of the runspace. In RemoteRunspace, it is required to invoke pipeline as part of open call (i.e. while state is Opening). If this property is true, runspace state check is not performed in AddToRunningPipelineList call. List of pipeline which are currently executing in this runspace. Applications implementation. This class does the necessary checks to ensure that no pipeline or other SessionStateProxy calls are in progress. It delegates to derived class worker method for actual operation. Scripts implementation. This class does the necessary checks to ensure that no pipeline or other SessionStateProxy calls are in progress. It delegates to derived class worker method for actual operation. Protected methods to be implemented by derived class. This does the actual work of getting scripts. Protected methods to be implemented by derived class. This does the actual work of getting scripts. Protected methods to be implemented by derived class. This does the actual work of getting scripts. Protected methods to be implemented by derived class. This does the actual work of getting scripts. Protected methods to be implemented by derived class. This does the actual work of getting scripts. Protected methods to be implemented by derived class. This does the actual work of getting scripts. Protected methods to be implemented by derived class. This does the actual work of getting scripts. Protected methods to be implemented by derived class. This does the actual work of getting scripts. Protected methods to be implemented by derived class. This does the actual work of getting applications. Protected methods to be implemented by derived class. This does the actual work of getting scripts. Protected methods to be implemented by derived class. This does the actual work of getting scripts. Protected methods to be implemented by derived class. This does the actual work of getting scripts. Protected methods to be implemented by derived class. This does the actual work of getting scripts. Protected methods to be implemented by derived class. This does the actual work of getting scripts. Protected methods to be implemented by derived class. This does the actual work of getting scripts. Protected methods to be implemented by derived class. This does the actual work of getting scripts. Protected methods to be implemented by derived class. This does the actual work of getting scripts. Protected methods to be implemented by derived class. This does the actual work of getting scripts. Defines a factory class for creating Runspace objects. Static constructor Creates a runspace using host of type . This runspace is created using the information from EntryAssembly. A runspace object. Creates a runspace using specified host. This runspace is created using the configuration information from EntryAssembly. The explicit PSHost implementation. A runspace object Thrown when host is null. Creates a runspace using RunspaceConfiguration information for the runspace. A runspace object Thrown when runspaceConfiguration is null Creates a runspace using specified PSHost and RunspaceConfiguration Host implementation for runspace. RunspaceConfiguration information for the runspace. A runspace object Thrown when host is null Thrown when runspaceConfiguration is null Creates a runspace using InitialSessionState information for the runspace. A runspace object Thrown when initialSessionState is null Creates a runspace using specified PSHost and InitialSessionState Host implementation for runspace. InitialSessionState information for the runspace. A runspace object Thrown when host is null Thrown when initialSessionState is null Creates a runspace using specified PSHost and InitialSessionState Host implementation for runspace. InitialSessionState information for the runspace. A runspace object Thrown when host is null Thrown when initialSessionState is null Creates a RunspacePool using default RunspaceConfiguration with MaxRunspaces 1 and MinRunspaces 1. Creates a RunspacePool using default RunspaceConfiguration. limits the number of Runspaces that can exist in this pool. The minimum pool size is set to . The minimum number of Runspaces that exist in this pool. Should be greater than or equal to 1. The maximum number of Runspaces that can exist in this pool. Should be greater than or equal to 1. Maximum runspaces is less than 1. Minimum runspaces is less than 1. Creates a RunspacePool using the supplied . The minimum runspaces size is set to 1. The maximum runspaces size is set to 1. initialSessionState to use when creating a new Runspace in the pool. RunspaceConfiguration is null. Creates a RunspacePool using the supplied , and The minimum number of Runspaces that can exist in this pool. Should be greater than or equal to 1. The maximum number of Runspaces that can exist in this pool. Should be greater than or equal to 1. The explicit PSHost implementation. is null. A local runspacepool instance. Creates a RunspacePool using the supplied , and The minimum number of Runspaces that can exist in this pool. Should be greater than or equal to 1. The maximum number of Runspaces that can exist in this pool. Should be greater than or equal to 1. RunspaceConfiguration to use when creating a new Runspace in the pool. RunspaceConfiguration is null. The explicit PSHost implementation. is null. is null. Maximum runspaces is less than 1. Minimum runspaces is less than 1. Creates a RunspacePool using the supplied , and The minimum number of Runspaces that can exist in this pool. Should be greater than or equal to 1. The maximum number of Runspaces that can exist in this pool. Should be greater than or equal to 1. initialSessionState to use when creating a new Runspace in the pool. RunspaceConfiguration is null. The explicit PSHost implementation. is null. is null. Maximum runspaces is less than 1. Minimum runspaces is less than 1. Creates a RunspacePool on the specified remote computer. limits the number of Runspaces that can exist in this pool. The minimum pool size is set to . The minimum number of Runspace that should exist in this pool. Should be greater than 1. The maximum number of Runspaces that can exist in this pool. Should be greater than or equal to 1. RunspaceConnectionInfo object describing the remote computer on which this runspace pool needs to be created Maximum Pool size is less than 1. Minimum Pool size is less than 1. connectionInfo is null Creates a RunspacePool on the specified remote runspace computer. limits the number of Runspaces that can exist in this pool. The minimum pool size is set to . The minimum number of Runspace that should exist in this pool. Should be greater than 1. The maximum number of Runspaces that can exist in this pool. Should be greater than or equal to 1. Host associated with this runspace pool RunspaceConnectionInfo object describing the remote computer on which this runspace pool needs to be created Maximum Pool size is less than 1. Minimum Pool size is less than 1. connectionInfo is null Creates a RunspacePool on the specified remote runspace compuer. limits the number of Runspaces that can exist in this pool. The minimum pool size is set to . The minimum number of Runspace that should exist in this pool. Should be greater than 1. The maximum number of Runspaces that can exist in this pool. Should be greater than or equal to 1. The TypeTable to use while deserializing/serializing remote objects. TypeTable has the following information used by serializer: 1. SerializationMethod 2. SerailizationDepth 3. SpecificSerializationProperties TypeTable has the following inforamtion used by deserializer: 1. TargetTypeForDeserializaiton 2. TypeConverter If is null no custom serialization/deserialization can be done. Default PowerShell behavior will be used in this case. Host associated with this runspace pool RunspaceConnectionInfo object describing the remote computer on which this runspace pool needs to be created Maximum Pool size is less than 1. Minimum Pool size is less than 1. connectionInfo is null Creates a RunspacePool on the specified remote runspace compuer. limits the number of Runspaces that can exist in this pool. The minimum pool size is set to . The minimum number of Runspace that should exist in this pool. Should be greater than 1. The maximum number of Runspaces that can exist in this pool. Should be greater than or equal to 1. The TypeTable to use while deserializing/serializing remote objects. TypeTable has the following information used by serializer: 1. SerializationMethod 2. SerailizationDepth 3. SpecificSerializationProperties TypeTable has the following inforamtion used by deserializer: 1. TargetTypeForDeserializaiton 2. TypeConverter If is null no custom serialization/deserialization can be done. Default PowerShell behavior will be used in this case. Host associated with this runspace pool Application arguments the server can see in RunspaceConnectionInfo object describing the remote computer on which this runspace pool needs to be created Maximum Pool size is less than 1. Minimum Pool size is less than 1. connectionInfo is null The TypeTable to use while deserializing/serializing remote objects. TypeTable has the following information used by serializer: 1. SerializationMethod 2. SerailizationDepth 3. SpecificSerializationProperties TypeTable has the following inforamtion used by deserializer: 1. TargetTypeForDeserializaiton 2. TypeConverter The TypeTable to use while deserializing/serializing remote objects. TypeTable has the following information used by serializer: 1. SerializationMethod 2. SerailizationDepth 3. SpecificSerializationProperties TypeTable has the following inforamtion used by deserializer: 1. TargetTypeForDeserializaiton 2. TypeConverter Application arguments the server can see in This is the default host implementing PSHost offering minimal host capabilities. Runspace is the primary user of this class. Defines the properties and facilities providing by an application hosting an MSH . A hosting application derives from this class and overrides the abstract methods and properties. The hosting application creates an instance of its derived class and passes it to the CreateRunspace method. From the moment that the instance of the derived class (the "host class") is passed to CreateRunspace, the MSH runtime can call any of the methods of that class. The instance must not be destroyed until after the Runspace is closed. There is a 1:1 relationship between the instance of the host class and the Runspace instance to which it is passed. In other words, it is not legal to pass the same instance of the host class to more than one call to CreateRunspace. (It is perfectly legal to call CreateRunspace more than once, as long as each call is supplied a unique instance of the host class.) Methods of the host class can be called by the Runspace or any cmdlet or script executed in that Runspace in any order and from any thread. It is the responsibility of the hosting application to define the host class methods in a threadsafe fashion. An implementation of the host class should not depend on method execution order. The instance of the host class that is passed to a Runspace is exposed by the Runspace to the cmdlets, scripts, and providers that are executed in that Runspace. Scripts access the host class via the $Host built-in variable. Cmdlets access the host via the Host property of the Cmdlet base class. The powershell.exe spec states that 128 is the maximum nesting depth. Protected constructor which does nothing. Provided per .Net design guidelines section 4.3.1 Request by the engine to end the current engine runspace (to shut down and terminate the host's root runspace). This method is called by the engine to request the host shutdown the engine. This is invoked by the exit keyword or by any other facility by which a runspace instance wishes to be shut down. To honor this request, the host should stop accepting and submitting commands to the engine and close the runspace. The exit code accompanying the exit keyword. Typically, after exiting a runspace, a host will also terminate. The exitCode parameter can be used to set the host's process exit code. Instructs the host to interrupt the currently running pipeline and start a new, "nested" input loop, where an input loop is the cycle of prompt, input, execute. Typically called by the engine in response to some user action that suspends the currently executing pipeline, such as choosing the "suspend" option of a ConfirmProcessing call. Before calling this method, the engine should set various shell variables to the express the state of the interrupted input loop (current pipeline, current object in pipeline, depth of nested input loops, etc.) A non-interactive host may throw a "not implemented" exception here. If the UI property returns null, the engine should not call this method. Causes the host to end the currently running input loop. If the input loop was created by a prior call to EnterNestedPrompt, the enclosing pipeline will be resumed. If the current input loop is the top-most loop, then the host will act as though SetShouldExit was called. Typicalled called by the engine in response to some user action that resumes a suspended pipeline, such as with the 'continue-command' intrinsic cmdlet. Before calling this method, the engine should clear out the loop-specific variables that were set when the loop was created. If the UI Property returns a null, the engine should not call this method. Called by the engine to notify the host that it is about to execute a "legacy" command line application. A legacy application is defined as a console-mode executable that may do one or more of the following: . reads from stdin . writes to stdout . writes to stderr . uses any of the win32 console APIs Notifying the host allows the host to do such things as save off any state that might need to be restored when the legacy application terminates, set or remove break handler hooks, redirect stream handles, and so forth. The engine will always call this method and the NotifyEndApplication method in matching pairs. The engine may call this method several times in the course of a single pipeline. For instance, the pipeline: foo.exe | bar-cmdlet | baz.exe Will result in a sequence of calls similar to the following: NotifyBeginApplication - called once when foo.exe is started NotifyBeginApplication - called once when baz.exe is started NotifyEndApplication - called once when baz.exe terminates NotifyEndApplication - called once when foo.exe terminates Note that the order in which the NotifyEndApplication call follows the corresponding call to NotifyBeginApplication with respect to any other call to NotifyBeginApplication is not defined, and should not be depended upon. In other words, NotifyBeginApplication may be called several times before NotifyEndApplication is called. The only thing that is guaranteed is that there will be an equal number of calls to NotifyEndApplication as to NotifyBeginApplication. Called by the engine to notify the host that the execution of a legacy command has completed. Gets the hosting application's identification in some user-friendly fashion. This name can be referenced by scripts and cmdlets to identify the host that is executing them. The format of the value is not defined, but a short, simple string is recommended. In implementing this member, you should return some sort of informative string describing the nature your hosting application. For the default console host shipped by Microsoft this is ConsoleHost. The name identifier of the hosting application. if ($Host.Name -ieq "ConsoleHost") { write-host "I'm running in the Console Host" } Gets the version of the hosting application. This value should remain invariant for a particular build of the host. This value may be referenced by scripts and cmdlets. When implementing this member, it should return the product version number for the product that is hosting the Monad engine. The version number of the hosting application. Gets a GUID that uniquely identifies this instance of the host. The value should remain invariant for the lifetime of this instance. Gets the hosting application's implementation of the abstract base class. A host that does not want to support user interaction should return null. A reference to an instance of the hosting application's implementation of a class derived from , or null to indicate that user interaction is not supported. The implementation of this routine should return an instance of the appropriate implementation of PSHostUserInterface for this application. As an alternative, for simple scenarios, just returning null is sufficient. Gets the host's culture: the culture that the runspace should use to set the CurrentCulture on new threads A CultureInfo object representing the host's current culture. Returning null is not allowed. The runspace will set the thread current culture to this value each time it starts a pipeline. Thus, cmdlets are encouraged to use Thread.CurrentThread.CurrentCulture. Gets the host's UI culture: the culture that the runspace and cmdlets should use to do resource loading. The runspace will set the thread current ui culture to this value each time it starts a pipeline. A CultureInfo object representing the host's current UI culture. Returning null is not allowed. Used to allow the host to pass private data through a Runspace to cmdlets running inside that Runspace's runspace. The type and nature of that data is entirely defined by the host, but there are some caveats: The default implementation returns null. If the host is using an out-of-process Runspace, then the value of this property is serialized when crossing that process boundary in the same fashion as any object in a pipeline is serialized when crossing process boundaries. In this case, the BaseObject property of the value will be null. If the host is using an in-process Runspace, then the BaseObject property can be a non-null value a live object. No guarantees are made as to the app domain or thread that the BaseObject is accessed if it is accessed in the runspace. No guarantees of threadsafety or re-entrancy are made. The object set in the BaseObject property of the value returned by this method is responsible for ensuring its own threadsafety and re-entrance safety. Note that thread(s) accessing that object may not necessarily be the same from one access to the next. The return value should have value-semantics: that is, changes to the state of the instance returned are not reflected across processes. Ex: if a cmdlet reads this property, then changes the state of the result, that change will not be visible to the host if the host is in another process. Therefore, the implementation of get for this property should always return a unique instance. Used by hosting applications to notify PowerShell engine that it is being hosted in a console based application and the Pipeline execution thread should call SetThreadUILanguage(0). This propery is currently used by ConsoleHost only and in future releases we may consider exposing this publicly. Creates an instance based on the current culture and current UI culture Current culture for this host Current UI culture for this host See base class See base class On calling this method See base class On calling this method See base class See base class See base class See base class See base class See base class This property is not supported See base class See base class Provides a description of a field for use by . It is permitted to subclass but there is no established scenario for doing this, nor has it been tested. Initializes a new instance of FieldDescription and defines the Name value. The name to identify this field description is null or empty. Sets the ParameterTypeName, ParameterTypeFullName, and ParameterAssemblyFullName as a single operation. The Type that sets the properties. If is null. For use by remoting serialization. If is null. For use by remoting serialization. If is null. For use by remoting serialization. If is null. Gets the name of the field. Gets the short name of the parameter's type. The type name of the parameter If not already set by a call to , will be used as the type. Gets the full string name of the parameter's type. If not already set by a call to , will be used as the type. Gets the full name of the assembly containing the type identified by ParameterTypeFullName or ParameterTypeName If the assembly is not currently loaded in the hosting application's AppDomain, the hosting application needs to load the containing assembly to access the type information. AssemblyName is used for this purpose. If not already set by a call to , will be used as the type. A short, human-presentable message to describe and identify the field. If supplied, a typical implementation of will use this value instead of the field name to identify the field to the user. set to null. Note that the special character & (ampersand) may be embedded in the label string to identify the next character in the label as a "hot key" (aka "keyboard accelerator") that the implementation may use to allow the user to quickly set input focus to this field. The implementation of is responsible for parsing the label string for this special character and rendering it accordingly. For example, a field named "SSN" might have "&Social Security Number" as it's label. If no label is set, then the empty string is returned. Gets and sets the help message for this field. Set to null. This should be a few sentences to describe the field, suitable for presentation as a tool tip. Avoid placing including formatting characters such as newline and tab. Gets and sets whether a value must be supplied for this field Gets and sets the default value, if any, for the implementation of to pre-populate its UI with. This is a PSObject instance so that the value can be serialized, converted, manipulated like any pipeline object. It is up to the implementer of to decide if it can make use of the object in its presentation of the fields prompt. Gets the Attribute classes that apply to the field. In the case that is being called from the MSH engine, this will contain the set of prompting attributes that are attached to a cmdlet parameter declaration. Indicates if this field description was modified by the remoting protocol layer Used by the console host to determine if this field description was modified by the remoting protocol layer and take appropriate actions Indicates if this field description is coming from a remote host Used by the console host to not cast strings to an arbitrary type, but let the server-side do the type conversion Contains information about a single history entry Constructor Id of pipeline in which command associated with this history entry is executed command string status of pipeline execution startTime of execution endTime of execution Copy constructor to support cloning Override for ToString() method Sets Id Set status Set endtime Sets command Id of the pipeline corresponding to this history entry Id of the history entry CommandLine string ExecutionStatus of execution Start time of execution End time of execution Flag indicating an entry is present/cleared Retuns a clone of this object Id of this history entry. CommandLine string Execution status of assoicated pipeline Start time of execution of associated pipeline End time of execution of associated pipeline Cleared status of an entry This class implements history and provides APIs for adding and fetching entries from history Default history size Constructs history store Create a new history entry If true, the entry will not be added when the history is locked id for the new created entry. Use this id to fetch the entry. Returns -1 if the entry is not added This function is thread safe Udpate the history entry corresponding to id. id of history entry to be updated status to be updated endTime to be updated If true, the entry will not be added when the history is locked Gets entry from buffer for given id. This id should be the id returned by Add method. Id of the entry to be fetched entry corresponding to id if it is present else null Get count HistoryEntries history entries Get History Entries based on the WildCard Pattern value. If passed 0, returns all the values, else return on the basis of count. Clears the history entry from buffer for a given id. Id of the entry to be Cleared nothing gets the total number of entries added count of total entries added Adds an entry to the buffer. If buffer is full, overwrites oldest entry in the buffer Returns id for the entry. This id should be used to fetch the entry from the buffer Id starts from 1 and is incremented by 1 for each new entry Gets entry from buffer for given id. This id should be the id returned by Add method. Id of the entry to be fetched entry corresponding to id if it is present else null Gets the smallest id in the buffer Reallocates the buffer if history size changed Get the index for new entry Index for new entry Gets index in buffer for an entry with given Id Gets index in buffer for an entry with given Id using passed in capacity Increment number of entries in buffer by 1 Get the current history size buffer Capacity of circular buffer Number of entries in buffer currently total number of entries added till now including those which have been overwritten after buffer got full. This is also number of last entry added. Private object for synchronization return the ID of the next history item to be added This class Implements the get-history command Ids of entries to display Is Count parameter specified Count of entries to display. By default, count is the length of the history buffer. So "Get-History" returns all history entries. Implements the Processing() method for show/History command Ids of entries to display No of History Entries (starting from last) that are to be displayed. This class implements the Invoke-History command Invoke cmd can execute only one history entry. If multiple ids are provided, we throw error. Implements the BeginProcessing() method for eval/History command Helper function which gets history entry to invoke Id of history entry to execute. Commandline to execute. Parse Id parameter to populate _historyId and _commandLine Invoke-history is replaced in history by the command it executed. This replacement happens only if Invoke-History is single element in the pipeline. If there are more than one element in pipeline (ex A | Invoke-History 2 | B) then we cannot do this replacement. Accepts a string value indicating a previously executed command to re-execute. If string can be parsed to long, it will be used as HistoryId else as a string value indicating a previously executed command to re-execute. This string is the first n characters of the command that is to be re-executed. This class Implements the add-history command override for BeginProcessing override for ProcessRecord Convert mshObject that has has the properties of an HistoryInfo object in to HistoryInfo object. mshObject to be converted to HistoryInfo. HistoryInfo object if coversion is successful else null. This parameter specifies the current pipeline object A Boolean that indicates whether history objects should be passed to the next element in the pipeline. This Class implements the Clear History cmdlet id of a history entry commandline parameter count of the history entries a boolean variable to indicate if the count parameter specified switch parameter on the history entries Overriding Begin Processing Overriding Process Record Clears the session history based on the id parameter takes no parameters nothing Clears the session history based on the Commandline parameter takes no parameters nothing Clears the session history based on the input parametera id of the entry to be cleared count of entries to be cleared cmdline string to be cleared order of the entries nothing history obj array of historyinfo objects Specifies the ID of a command in the session history.Clear history clears the entries wit the specified ID(s) command line name of an entry in the session history Clears the specified number of history entries Specifies whether new entries to be cleared or the default old ones. Wraps PSHost instances to provide a shim layer between InternalCommand and the host-supplied PSHost instance. This class exists for the purpose of ensuring that an externally-supplied PSHost meets the minimum proper required implementation, and also to provide a leverage point at which the monad engine can hook the interaction between the engine, cmdlets, and that external host. That leverage may be necessary to manage concurrent access between multiple pipelines sharing the same instance of PSHost. This interface needs to be implemented by PSHost objects that want to support the PushRunspace and PopRunspace functionality. Called by the engine to notify the host that a runspace push has been requested. Called by the engine to notify the host that a runspace pop has been requested. True if a runspace is pushed; false otherwise. Returns the current runspace associated with this host. There should only be one instance of InternalHost per runspace (i.e. per engine), and all engine use of the host should be through that single instance. If we ever accidentally create more than one instance of InternalHost per runspace, then some of the internal state checks that InternalHost makes, like checking the nestedPromptCounter, can be messed up. To ensure that this constraint is met, I wanted to make this class a singleton. However, Hitesh rightly pointed out that a singleton would be appdomain-global, which would prevent having multiple runspaces per appdomain. So we will just have to be careful not to create extra instances of InternalHost per runspace. See base class See base class Internal proxy for EnterNestedPrompt See base class See base class Called by the engine to notify the host that the execution of a legacy command has completed. Gets the external host as an IHostSupportsInteractiveSession if it implements this interface; throws an exception otherwise. Called by the engine to notify the host that a runspace push has been requested. Called by the engine to notify the host that a runspace pop has been requested. Checks if the host is in a nested prompt true, if host in nested prompt false, otherwise Sets the reference to the external host and the internal UI to a temporary new host and its UI. This exists so that if the PowerShell/Pipeline object has a different host from the runspace it can set it's host during its invocation, and then revert it after the invocation is completed. and Reverts the temporary host set by SetHost. If no host was temporarily set, this has no effect. and See base class when the external host's Name is null or empty. See base class when the external host's Version is null. See base class when the external host's InstaceId is a zero Guid. See base class Interface to be used for interaction with internal host UI. InternalHostUserInterface wraps the host UI supplied during construction. Use this wrapper to access functionality specific to InternalHost. See base class when the external host's CurrentCulture is null. See base class If the external host's CurrentUICulture is null. See base class True if a runspace is pushed; false otherwise. Returns the current runspace associated with this host. Returns true if the external host reference is temporarily set to another host, masking the original host. Defines the lowest-level user interface functions that an interactive application hosting an MSH can choose to implement if it wants to support any cmdlet that does character-mode interaction with the user. It models an 2-dimensional grid of cells called a Buffer. A buffer has a visible rectangular region, called a window. Each cell of the grid has a character, a foreground color, and a background color. When the buffer has input focus, it shows a cursor positioned in one cell. Keystrokes can be read from the buffer and optionally echoed at the current cursor position. Protected constructor which does nothing. Provided per .Net design guidelines section 4.3.1 Reads a key stroke from the keyboard device, blocking until a keystroke is typed. Same as ReadKey(ReadKeyOptions.IncludeKeyDown | ReadKeyOptions.IncludeKeyUp) Key stroke when a key is pressed or released. $Host.UI.RawUI.ReadKey() Reads a key stroke from the keyboard device, blocking until a keystroke is typed. Either one of ReadKeyOptions.IncludeKeyDown and ReadKeyOptions.IncludeKeyUp or both must be specified. A bit mask of the options to be used to read the keyboard. Constants defined by Key stroke depending on the value of . Neither ReadKeyOptions.IncludeKeyDown nor ReadKeyOptions.IncludeKeyUp is specified. $option = [System.Management.Automation.Host.ReadKeyOptions]"IncludeKeyDown"; $host.UI.RawUI.ReadKey($option) Resets the keyboard input buffer. Copies the array into the screen buffer at the given origin, clipping such that cells in the array that would fall outside the screen buffer are ignored. The top left corner of the rectangular screen area to which is copied. A rectangle of objects to be copied to the screen buffer. Copies a given character to all of the character cells in the screen buffer with the indicated colors. The rectangle on the screen buffer to which is copied. If all elements are -1, the entire screen buffer will be copied with . The character and attributes used to fill . Provided for clearing regions -- less chatty than passing an array of cells. using System; using System.Management.Automation; using System.Management.Automation.Host; namespace Microsoft.Samples.MSH.Cmdlet { [Cmdlet("Clear","Screen")] public class ClearScreen : PSCmdlet { protected override void BeginProcessing() { Host.UI.RawUI.SetBufferContents(new Rectangle(-1, -1, -1, -1), new BufferCell(' ', Host.UI.RawUI.ForegroundColor, Host.UI.RawUI.BackgroundColor)) } } } Extracts a rectangular region of the screen buffer. The rectangle on the screen buffer to extract. An array of objects extracted from the rectangular region of the screen buffer specified by If the rectangle is completely outside of the screen buffer, a BufferCell array of zero rows and column will be returned. If the rectangle is partially outside of the screen buffer, the area where the screen buffer and rectangle overlap will be read and returned. The size of the returned array is the same as that of r. Each BufferCell in the non-overlapping area of this array is set as follows: Character is the space (' ') ForegroundColor to the current foreground color, given by the ForegroundColor property of this class. BackgroundColor to the current background color, given by the BackgroundColor property of this class. The resulting array is organized in row-major order for performance reasons. The screen buffer, however, is organized in column-major order -- e.g. you specify the column index first, then the row index second, as in (x, y). This means that a cell at screen buffer position (x, y) is in the array element [y, x]. Scroll a region of the screen buffer. Indicates the region of the screen to be scrolled. Indicates the upper left coordinates of the region of the screen to receive the source region contents. The target region is the same size as the source region. Indicates the region of the screen to include in the operation. If a cell would be changed by the operation but does not fall within the clip region, it will be unchanged. The character and attributes to be used to fill any cells within the intersection of the source rectangle and clipping rectangle that are left "empty" by the move. Determines the number of BufferCells a substring of a string occupies. The string whose substring length we want to know. Offset where the substring begins in The default implementation calls method with the substring extracted from the string starting at the offset Determines the number of BufferCells a string occupies. The string whose length we want to know. The default implementation returns the length of Determines the number of BufferCells a character occupies. The character whose length we want to know. The default implementation returns 1. Creates a two dimensional array of BufferCells by examining each character in . String array based on which the two dimensional array of BufferCells will be created. Foreground color of the buffer cells in the resulting array. Background color of the buffer cells in the resulting array. A two dimensional array of BufferCells whose characters are the same as those in and whose foreground and background colors set to and is null; Any string in is null or empty If a character C takes one BufferCell to display as determined by LengthInBufferCells, one BufferCell is allocated with its Character set to C and BufferCellType to BufferCell.Complete. On the other hand, if C takes two BufferCell, two adjacent BufferCells on a row in the returned array will be allocated: the first has Character set to C and BufferCellType to and the second Character set to (char)0 and Type to . Hence, the returned BufferCell array has .Length number of rows and number of columns equal to the largest number of cells a string in takes. The foreground and background colors of the cells are initialized to and , respectively. The resuling array is suitable for use with and . Creates a 2D array of BufferCells by examining .Character. The number of columns of the resulting array The number of rows of the resulting array The cell to be copied to each of the elements of the resulting array. A by array of BufferCells where each cell's value is based on is less than 1; is less than 1. If the character takes one BufferCell to display as determined by LengthInBufferCells, one BufferCell is allocated with its Character set to the character and BufferCellType to BufferCell.Complete. On the other hand, if it takes two BufferCells, two adjacent BufferCells on a row in the returned array will be allocated: the first has Character set to the character and BufferCellType to BufferCellType.Leading and the second Character set to (char)0 and BufferCellType to BufferCellType.Trailing. Moreover, if is odd, the last column will just contain the leading cell. .BufferCellType is not used in creating the array. The resulting array is suitable for use with the PSHostRawUserInterface.SetBufferContents method. Same as The width and height of the resulting array. The cell to be copied to each of the elements of the resulting array. An array of BufferCells whose size is and where each cell's value is based on If .Width or .Height is less than 1. Gets or sets the color used to render characters on the screen buffer. Each character cell in the screen buffer can have a separate foreground color. Gets or sets the color used to render the background behind characters on the screen buffer. Each character cell in the screen buffer can have a separate background color. Gets or sets the cursor position in the screen buffer. The view window always adjusts it's location over the screen buffer such that the cursor is always visible. To write to the screen buffer without updating the cursor position, use or Gets or sets position of the view window relative to the screen buffer, in characters. (0,0) is the upper left of the screen buffer. Gets or sets the cursor size as a percentage 0..100. Gets or sets the current size of the screen buffer, measured in character cells. Gets or sets the current view window size, measured in character cells. The window size cannot be larger than the dimensions returned by . Gets the size of the largest window possible for the current buffer, current font, and current display hardware. The view window cannot be larger than the screen buffer or the current display (the display the window is rendered on). The largest dimensions the window can be resized to without resizing the screen buffer. Always returns a value less than or equal to . Gets the largest window possible for the current font and display hardware, ignoring the current buffer dimensions. In other words, the dimensions of the largest window that could be rendered in the current display, if the buffer was at least as large. To resize the window to this dimension, use to first check and, if necessary, adjust, the screen buffer size. A non-blocking call to examine if a keystroke is waiting in the input buffer. True if a keystroke is waiting in the input buffer, false if not. Gets or sets the titlebar text of the current view window. See base class if the RawUI property of the external host is null, possibly because the PSHostRawUserInterface is not implemented by the external host See base class if the RawUI property of the external host is null, possibly because the PSHostRawUserInterface is not implemented by the external host See base class if the RawUI property of the external host is null, possibly because the PSHostRawUserInterface is not implemented by the external host See base class if the RawUI property of the external host is null, possibly because the PSHostRawUserInterface is not implemented by the external host See base class if the RawUI property of the external host is null, possibly because the PSHostRawUserInterface is not implemented by the external host See base class if the RawUI property of the external host is null, possibly because the PSHostRawUserInterface is not implemented by the external host if the RawUI property of the external host is null, possibly because the PSHostRawUserInterface is not implemented by the external host if the RawUI property of the external host is null, possibly because the PSHostRawUserInterface is not implemented by the external host if the RawUI property of the external host is null, possibly because the PSHostRawUserInterface is not implemented by the external host See base class if the RawUI property of the external host is null, possibly because the PSHostRawUserInterface is not implemented by the external host See base class if the RawUI property of the external host is null, possibly because the PSHostRawUserInterface is not implemented by the external host See base class if the RawUI property of the external host is null, possibly because the PSHostRawUserInterface is not implemented by the external host See base class if the RawUI property of the external host is null, possibly because the PSHostRawUserInterface is not implemented by the external host See base class if the RawUI property of the external host is null, possibly because the PSHostRawUserInterface is not implemented by the external host See base class if the RawUI property of the external host is null, possibly because the PSHostRawUserInterface is not implemented by the external host See base class if the RawUI property of the external host is null, possibly because the PSHostRawUserInterface is not implemented by the external host See base class if the RawUI property of the external host is null, possibly because the PSHostRawUserInterface is not implemented by the external host See base class if the RawUI property of the external host is null, possibly because the PSHostRawUserInterface is not implemented by the external host See base class if the RawUI property of the external host is null, possibly because the PSHostRawUserInterface is not implemented by the external host See base class if the RawUI property of the external host is null, possibly because the PSHostRawUserInterface is not implemented by the external host Defines the properties and facilities providing by an hosting application deriving from that offers dialog-oriented and line-oriented interactive features. Reads characters from the console until a newline (a carriage return) is encountered. The characters typed by the user. Same as ReadLine, except that the result is a SecureString, and that the input is not echoed to the user while it is collected (or is echoed in some obfuscated way, such as showing a dot for each character). The characters typed by the user in an encrypted form. Note that credentials (a user name and password) should be gathered with Writes characters to the screen buffer. Does not append a carriage return. The characters to be written. null is not allowed. Same as , except that colors can be specified. The foreground color to display the text with. The foreground color to display the text with. The characters to be written. null is not allowed. The default implementation writes a carriage return to the screen buffer. Writes characters to the screen buffer, and appends a carriage return. The characters to be written. null is not allowed. Same as , except that colors can be specified. The foreground color to display the text with. The foreground color to display the text with. The characters to be written. null is not allowed. Writes a line to the "error display" of the host, as opposed to the "output display," which is written to by the variants of and The characters to be written. Invoked by to display a debugging message to the user. Invoked by to display a progress record. Unique identifier of the source of the record. An int64 is used because typically, the 'this' pointer of the command from whence the record is originating is used, and that may be from a remote Runspace on a 64-bit machine. The record being reported to the host. Invoked by to display a verbose processing message to the user. Invoked by to display a warning processing message to the user. Constructs a 'dialog' where the user is presented with a number of fields for which to supply values. Caption to preceed or title the prompt. E.g. "Parameters for get-foo (instance 1 of 2)" A text description of the set of fields to be prompt. Array of FieldDescriptions that contain information about each field to be prompted for. A Dictionary object with results of prompting. The keys are the field names from the FieldDescriptions, the values are objects representing the values of the corresponding fields as collected from the user. To the extent possible, the host should return values of the type(s) identified in the FieldDescription. When that is not possible (for example, the type is not avaiable to the host), the host should return the value as a string. Prompt for credentials. Prompt for credential. Caption for the message. Text description for the credential to be prompt. Name of the user whose credential is to be prompted for. If set to null or empty string, the function will prompt for user name first. Name of the target for which the credential is being collected. User input credential. Prompt for credential. Caption for the message. Text description for the credential to be prompt. Name of the user whose credential is to be prompted for. If set to null or empty string, the function will prompt for user name first. Name of the target for which the credential is being collected. Types of credential can be supplied by the user. Options that control the credential gathering UI behavior User input credential. Presents a dialog allowing the user to choose an option from a set of options. Caption to preceed or title the prompt. E.g. "Parameters for get-foo (instance 1 of 2)" A message that describes what the choice is for. An Collection of ChoiceDescription objects that describe each choice. The index of the label in the choices collection element to be presented to the user as the default choice. -1 means "no default". Must be a valid index. The index of the choices element that corresponds to the option selected. added protected ctor per design guidelines Gets hosting application's implementation of the abstract base class that implements that class. A reference to an instance of the hosting application's implementation of a class derived from , or null to indicate that low-level user interaction is not supported. This interface needs to be implemented by PSHost objects that want to support PromptForChoice by giving the user ability to select more than one choice. The PromptForChoice method available in PSHostUserInterface class supports only one choice selection. Presents a dialog allowing the user to choose options from a set of options. Caption to preceed or title the prompt. E.g. "Parameters for get-foo (instance 1 of 2)" A message that describes what the choice is for. An Collection of ChoiceDescription objects that describe each choice. The index of the labels in the choices collection element to be presented to the user as the default choice(s). The indices of the choice elements that corresponds to the options selected. The returned collection may contain duplicates depending on a particular host implementation. See base class if the UI property of the external host is null, possibly because the PSHostUserInterface is not implemented by the external host See base class if the UI property of the external host is null, possibly because the PSHostUserInterface is not implemented by the external host See base class if is not null and the UI property of the external host is null, possibly because the PSHostUserInterface is not implemented by the external host See base class if is not null and the UI property of the external host is null, possibly because the PSHostUserInterface is not implemented by the external host See base class if the UI property of the external host is null, possibly because the PSHostUserInterface is not implemented by the external host See base class if is not null and the UI property of the external host is null, possibly because the PSHostUserInterface is not implemented by the external host See base class if is not null and the UI property of the external host is null, possibly because the PSHostUserInterface is not implemented by the external host See base class if is not null and the UI property of the external host is null, possibly because the PSHostUserInterface is not implemented by the external host Writes the DebugRecord to informational buffers. DebugRecord Helper function for WriteDebugLine If the debug preference is set to ActionPreference.Stop If the debug preference is set to ActionPreference.Inquire and user requests to stop execution. If the debug preference is not a valid ActionPrefernce value. If informationBuffers is not null, the respective messages will also be written to the buffers along with external host. Buffers to which Debug, Verbose, Warning, Progress messages will be writtern to. This method is not thread safe. Caller should make sure of the assosciated risks. Gets the informational message buffers of the host informational message buffers Ask the user whether to continue/stop or break to a nested prompt. Message to display to the user. This routine will append the text "Continue" to ensure that people know what question they are answering. Preference setting which determines the behaviour. This is by-ref and will be modified based upon what the user types. (e.g. YesToAll will change Inquire => NotifyContinue) See base class if is not null and the UI property of the external host is null, possibly because the PSHostUserInterface is not implemented by the external host See base class if is not null and the UI property of the external host is null, possibly because the PSHostUserInterface is not implemented by the external host Writes the VerboseRecord to informational buffers. VerboseRecord See base class if is not null and the UI property of the external host is null, possibly because the PSHostUserInterface is not implemented by the external host Writes the WarningRecord to informational buffers. WarningRecord See base class If is null. If .Count is less than 1. if the UI property of the external host is null, possibly because the PSHostUserInterface is not implemented by the external host See base class if the UI property of the external host is null, possibly because the PSHostUserInterface is not implemented by the external host Presents a dialog allowing the user to choose options from a set of options. Caption to preceed or title the prompt. E.g. "Parameters for get-foo (instance 1 of 2)" A message that describes what the choice is for. An Collection of ChoiceDescription objects that describe each choice. The index of the labels in the choices collection element to be presented to the user as the default choice(s). The indices of the choice elements that corresponds to the options selected. This method is added to be backward compatible with V1 hosts w.r.t new PromptForChoice method added in PowerShell V2. 1. Choices is null. 2. Choices.Count = 0 3. DefaultChoice is either less than 0 or greater than Choices.Count See base class See base class See base class PSListModifier is a simple helper class created by the update-list cmdlet. The update-list cmdlet will either return an instance of this class, or it will internally use an instance of this class to implement the updates. Cmdlets can also take a PSListModifier as a parameter. Usage might look like: Get-Mailbox | Set-Mailbox -Alias @{Add='jim'} Alias would take a PSListModifier and the Cmdlet code would be responsible for apply updates (possibly using PSListModifier.ApplyTo or else using custom logic). Create a new PSListModifier with empty lists for Add/Remove. Create a new PSListModifier with the specified add and remove lists. The items to remove The items to add Create a new PSListModifier to replace a given list with replaceItems. The item(s) to replace an existing list with Create a new PSListModifier with the specified add and remove lists (in the hash.) A hashtable, where the value for key Add is the list to add and the value for Remove is the list to remove. Update the given collection with the items in Add and Remove. The collection to update Update the given collection with the items in Add and Remove. The collection to update The list of items to add when ApplyTo is called. The list of items to remove when AppyTo is called. The list of items to replace an existing list with. A generic version of PSListModifier that exists for the sole purpose of making cmdlets that accept a PSListModifier more usable. Users that look at the syntax of the command will see something like PSListModifier[Mailbox] and know they need to pass in Mailboxes. The list element type Create a new PSListModifier with empty lists for Add/Remove. Create a new PSListModifier with the specified add and remove lists. The items to remove The items to add Create a new PSListModifier to replace a given list with replaceItems. The items to replace an existing list with Create a new PSListModifier with the specified add and remove lists (in the hash.) A hashtable, where the value for key Add is the list to add and the value for Remove is the list to remove. Runspace class for local runspace Runspace class for local runspace Construct an instance of an Runspace using a custom implementation of PSHost. The explicit PSHost implementation configuration information for this minshell. Construct an instance of an Runspace using a custom implementation of PSHost. The explicit PSHost implementation configuration information for this minshell. If true, don't make a copy of the initial session state object Construct an instance of an Runspace using a custom implementation of PSHost. The explicit PSHost implementation configuration information for this minshell. Private data to be used by applications built on top of PowerShell. Local runspace pool is created with application private data set to an empty . Runspaces that are part of a inherit application private data from the pool. A method that runspace pools can use to propagate application private data into runspaces Resets the runspace state to allow for fast reuse. Not all of the runspace elements are reset. The goal is to minimize the chance of the user taking accidental dependencies on prior runspace state. Create a pipeline from a command string A valid command string. Can be null if true command is added to history True for nested pipeline A pipeline pre-filled with Commands specified in commandString. Open the runspace paramter which control if Open is done synchronously or asynchronously Start method for asynchronous open Helper function used for opening a runspace if is null, import module using . Otherwise, import module using Logs engine health event Logs engine health event Returns the thread that must be used to execute pipelines when CreateThreadOptions is ReuseThread The pipeline calls this function after ensuring there is a single thread in the pipeline, so no locking is neccesary Start method for asynchronous close Close the runspace. Attempts to create/execute pipelines after a call to close will fail. Closes or disconnects all the remote runspaces passed in by the getRunspace function. If a remote runspace supports disconnect then it will be disconnected rather than closed. Disconnects all disconnectable jobs listed in the JobRepository. Set to true when object is disposed Protected dispose which can be overridden by derived classes. Close the runspace CommandFactory for creating Command objects AutomationEngine instance for this runspace Manages history for this runspace initialize default values of preference vars Does not return a value Gets the event manager This property determines whether a new thread is create for each invocation Any updates to the value of this property must be done before the Runspace is opened An attempt to change this property was made after opening the Runspace The thread options cannot be changed to the requested value Gets the execution context Returns true if the internal host is in a nested prompt CommandFactory object for this runspace. Gets history manager for this runspace List of jobs in this runspace Manager for JobSourceAdapters registered in this runspace. List of remote runspaces in this runspace Helper class to stop a running job. Interface which needs to be implemented by a class which wants to submit operations to the throttle manager Any synchronization that needs to be performed between StartOperation and StopOperation in the class that implements this interface should take care of handling the same. For instance, say New-Runspace class internally uses a class A which implements the IThrottleOperation interface. StartOperation of this class opens a runspace asynchronously on a remote machine. Stop operation is supposed to cancel the opening of this runspace. Any synchronization/cleanup issues should be handled by class A. This method should handle the actual operation whcih need to be controlled and performed. Examples of this can be Opening remote runspace, invoking expression in a remote runspace, etc. Once an event is successfully recieved as a result of this function, the handler has to ensure that it raises an OperationComplete event with StartComplete or StopComplete for the throttle manager to handle This method should handle the situation when a stop signal is sent for this operation. For instance, when trying to open a set of remote runspaces, the user might hit ctrl-C. In which case, the pending runspaces to be opened will actually be signalled through this method to stop operation and return back. This method also needs to be asynchronous. Once an event is successfully recieved as a result of this function, the handler has to ensure that it raises an OperationComplete event with StopComplete for the throttle manager to handle. It is important that this function does not raise a StartComplete which will then result in the ThrottleComplete event not being raised by the throttle manager Event which will be triggered when the operation is complete. It is assumed that all the operations perfomed by StartOperation and StopOperation are asynchronous. The submitter of operations may subscribe to this event to know when its complete (or it can handle the synchronization with its scheduler) and the throttle manager will subscribe to this event to know that its complete and to start the operation on the next item. This Property indicates whether an operation has been stopped In the initial implementation of ThrottleManager stopping individual operations was not supported. When the support for stopping individual operations was added, there was the following problem - if an opertaion is not there in the pending queue and in the startOperationQueue as well, then the following two scenarios are possible (a) Operation was started and start completed (b) Operation was started and stopped and both completed This property has been added in order to disambiguate between these two cases. When this property is set, StopOperation need not be called on the operation (this can be when the operation has stop completed or stop has been called and is pending) Internal constructor Job object to stop. Handles the Job state change event. Originator of event, unused Event arguments containing Job state. Override method to start the operation. Override method to stop the operation. Not used, stop operation must run to completion. Raise the OperationComplete event. Event to signal ThrottleManager when the operation is complete. Helper class to disconnect a runspace if the runspace supports disconnect semantics or otherwise close the runspace. Internal constructor Handle the runspace state changed event sender of this information, unused runspace event args Start the operation of closing the runspace There is no scenario where we are going to cancel this close Hence this method is intentionally empty Raise the operation completed event Event raised when the required operation is complete Defines the exception thrown an error loading modules occurs while opening the runspace. It contains a list of all of the module errors that have occurred Initializes a new instance of ScriptBlockToPowerShellNotSupportedException with the message set to typeof(ScriptBlockToPowerShellNotSupportedException).FullName Initializes a new instance of ScriptBlockToPowerShellNotSupportedException setting the message the exception's message Initializes a new instance of ScriptBlockToPowerShellNotSupportedException setting the message and innerException the exception's message the exceptions's inner exception Recommended constructor for the class The name of the module that cause the error The collection of errors that occurred during module processing Initializes a new instance of RunspaceOpenModuleLoadException with serialization parameters serialization information streaming context Populates a with the data needed to serialize the RunspaceOpenModuleLoadException object. The to populate with data. The destination for this serialization. The collection of error records generated while loading the modules. Pipeline class to be used for LocalRunspace This class has common base implementation for Pipeline class. LocalPipeline and RemotePipeline classes derives from it. Defines a class which can be used to invoke a pipeline of commands. Explicit default constructor Constructor to initialize both Runspace and Command to invoke. Caller should make sure that "command" is not null. Runspace to use for the command invocation. command to Invoke. Caller should make sure that "command" is not null. Invoke the pipeline, synchronously, returning the results as an array of objects. If using synchronous invoke, do not close input objectWriter. Synchronous invoke will always close the input objectWriter. No command is added to pipeline PipelineState is not NotStarted. 1) A pipeline is already executing. Pipeline cannot execute concurrently. 2) Attempt is made to invoke a nested pipeline directly. Nested pipeline must be invoked from a running pipeline. RunspaceState is not Open Pipeline already disposed The script recursed too deeply into script functions. There is a fixed limit on the depth of recursion. A CLR security violation occurred. Typically, this happens because the current CLR permissions do not allow adequate reflextion access to a cmdlet assembly. The thread in which the pipeline was executing was aborted. Pipeline.Invoke can throw a variety of exceptions derived from RuntimeException. The most likely of these exceptions are listed below. One of more parameters or parameter values specified for a cmdlet are not valid, or mandatory parameters for a cmdlet were not specified. A cmdlet generated a terminating error. A provider generated a terminating error. The ActionPreference.Stop or ActionPreference.Inquire policy triggered a terminating error. The pipeline was terminated asynchronously. If there is an error generating the metadata for dynamic parameters. Invoke the pipeline, synchronously, returning the results as an array of objects. an array of input objects to pass to the pipeline. Array may be empty but may not be null An array of zero or more result objects If using synchronous exectute, do not close input objectWriter. Synchronous invoke will always close the input objectWriter. No command is added to pipeline PipelineState is not NotStarted. 1) A pipeline is already executing. Pipeline cannot execute concurrently. 2) Attempt is made to invoke a nested pipeline directly. Nested pipeline must be invoked from a running pipeline. RunspaceState is not Open Pipeline already disposed The script recursed too deeply into script functions. There is a fixed limit on the depth of recursion. A CLR security violation occurred. Typically, this happens because the current CLR permissions do not allow adequate reflextion access to a cmdlet assembly. The thread in which the pipeline was executing was aborted. Pipeline.Invoke can throw a variety of exceptions derived from RuntimeException. The most likely of these exceptions are listed below. One of more parameters or parameter values specified for a cmdlet are not valid, or mandatory parameters for a cmdlet were not specified. A cmdlet generated a terminating error. A provider generated a terminating error. The ActionPreference.Stop or ActionPreference.Inquire policy triggered a terminating error. The pipeline was terminated asynchronously. If there is an error generating the metadata for dynamic parameters. Invoke the pipeline asynchronously 1) Results are returned through the reader. 2) When pipeline is invoked using InvokeAsync, invocation doesn't finish until Input to pipeline is closed. Caller of InvokeAsync must close the input pipe after all input has been written to input pipe. Input pipe is closed by calling Pipeline.Input.Close(); If you want this pipeline to execute as a standalone command (that is, using command-line parameters only), be sure to call Pipeline.Input.Close() before calling InvokeAsync(). Otherwise, the command will be executed as though it had external input. If you observe that the command isn't doing anything, this may be the reason. No command is added to pipeline PipelineState is not NotStarted. 1) A pipeline is already executing. Pipeline cannot execute concurrently. 2) InvokeAsync is called on nested pipeline. Nested pipeline cannot be executed Asynchronously. RunspaceState is not Open Pipeline already disposed Synchronous call to stop the running pipeline. Asynchronous call to stop the running pipeline. Creates a new that is a copy of the current instance. A new that is a copy of this instance. Connects synchronously to a running command on a remote server. The pipeline object must be in the disconnected state. A collection of result objects. Connects asynchronously to a running command on a remote server. Sets the command collection. command collection to set called by ClientRemotePipeline Sets the history string to the one that is specified history string to set Invokes a remote command and immediately disconnects if transport layer supports it. Disposes the pipeline. If pipeline is running, dispose first stops the pipeline. Protected dispose which can be overridden by derived classes. gets the runspace this pipeline is created on. Gets the property which indicates if this pipeline is nested. Gets the property which indicates if this pipeline is a child pipeline. IsChild flag makes it possible for the pipeline to differentiate between a true v1 nested pipeline and the cmdlets calling cmdlets case. See bug 211462. gets input writer for this pipeline. When the caller calls Input.Write(), the caller writes to the input of the pipeline. Thus, is a PipelineWriter or "thing which can be written to". Note:Input must be closed after Pipeline.InvokeAsync for InvokeAsync to finish. Gets the output reader for this pipeline. When the caller calls Output.Read(), the caller reads from the output of the pipeline. Thus, is a PipelineReader or "thing which can be read from". gets the error output reader for this pipeline. When the caller calls Error.Read(), the caller reads from the output of the pipeline. Thus, is a PipelineReader or "thing which can be read from". This is the non-terminating error stream from the command. In this release, the objects read from this PipelineReader are PSObjects wrapping ErrorRecords. Gets Info about current state of the pipeline. This value indicates the state of the pipeline after the change. True if pipeline execution encountered and error. It will alwys be true if _reason is non-null since an exception occurred. For other error types, It has to be set manually. gets the unique identifier for this pipeline. This indentifier is unique with in the scope of Runspace. gets the collection of commands for this pipeline. If this property is true, SessionState is updated for this pipeline state. Settings for the pipeline invocation thread. If this flag is true, the commands in this Pipeline will redirect the global error output pipe (ExecutionContext.ShellFunctionErrorOutputPipe) to the command's error output pipe. When the global error output pipe is not set, $ErrorActionPreference is not checked and all errors are treated as terminating errors. On V1, the global error output pipe is redirected to the command's error output pipe only when it has already been redirected. The command-line host achieves this redirection by merging the error output into the output pipe so it checks $ErrorActionPreference all right. However, when the Pipeline class is used programatically the global error output pipe is not set and the first error terminates the pipeline. This flag is used to force the redirection. By default it is false to maintain compatibility with V1, but the V2 hosting interface (PowerShell class) sets this flag to true to ensure the global error output pipe is always set and $ErrorActionPreference when invoking the Pipeline. Event raised when Pipeline's state changes. Create a pipeline initialized with a command string The associated Runspace/>. command string if true, add pipeline to history True for nested pipeline Command is null and add to history is true Create a Pipeline with an existing command string. Caller should validate all the parameters. The LocalRunspace to associate with this pipeline. The command to invoke. If true, add the command to history. If true, mark this pipeline as a nested pipeline. Stream to use for reading input objects. Stream to use for writing error objects. Stream to use for writing output objects. Buffers used to write progress, verbose, debug, warning information of an invocation. Command is null and add to history is true 1. InformationalBuffers is null Copy constructor to support cloning The source pipeline The copy constructor's intent is to support the scenario where a host needs to run the same set of commands multiple times. This is accomplished via creating a master pipeline then cloning it and executing the cloned copy. This internal method doesn't do the _disposed check. Synchronous call to stop the running pipeline. Asynchronous call to stop the running pipeline. Stop the running pipeline. If true pipeline is stoped synchronously else asynchronously. Stop execution of pipeline If false, call is asynchronous Invoke the pipeline, synchronously, returning the results as an array of objects. an array of input objects to pass to the pipeline. Array may be empty but may not be null An array of zero or more result objects Caller of synchronous exectute should not close input objectWriter. Synchronous invoke will always close the input objectWriter. On Synchronous Invoke if output is throttled and no one is reading from output pipe, Execution will block after buffer is full. Invoke the pipeline asynchronously Results are returned through the reader. Invoke the pipeline asynchronously with input. input to provide to pipeline. Input is used only for synchronous execution True if this method is called from synchronous invoke else false Results are returned through the reader. No command is added to pipeline PipelineState is not NotStarted. 1) A pipeline is already executing. Pipeline cannot execute concurrently. 2) InvokeAsync is called on nested pipeline. Nested pipeline cannot be executed Asynchronously. 3) Attempt is made to invoke a nested pipeline directly. Nested pipeline must be invoked from a running pipeline. RunspaceState is not Open Pipeline already disposed Invokes a remote command and immediately disconnects if transport layer supports it. Starts execution of pipeline. Check if anyother pipeline is executing. In case of nested pipeline, checks that it is called from currently executing pipeline's thread. True if method is called from Invoke, false if called from InvokeAsync The sync object on which the lock is acquired True if the method is invoked in a critical secion 1) A pipeline is already executing. Pipeline cannot execute concurrently. 2) InvokeAsync is called on nested pipeline. Nested pipeline cannot be executed Asynchronously. 3) Attempt is made to invoke a nested pipeline directly. Nested pipeline must be invoked from a running pipeline. Connects synchronously to a running command on a remote server. The pipeline object must be in the disconnected state. A collection of result objects. Connects asynchronously to a running command on a remote server. This returns true if pipeline state is Completed, Failed or Stopped This is queue of all the state change event which have occured for this pipeline. RaisePipelineStateEvents raises event for each item in this queue. We don't raise the event with in SetPipelineState because often SetPipelineState is called with in a lock. Raising event in lock introduces chances of deadlock in GUI applications. Sets the new execution state. the new state An exception indicating that state change is the result of an error, otherwise; null. Sets the internal execution state information member variable. It also adds PipelineStateInfo to a queue. RaisePipelineStateEvents raises event for each item in this queue. Set the new execution state the new state Raises events for changes in execution state. Initialized the current pipeline instance with the supplied data. 1. addToHistory is true and command is null. A preallocated empty string array used for the ctor taking an array of command strings. Set to true when object is disposed Protected dispose which can be overridden by derived classes. Access the runspace this pipeline is created on. Is this pipeline nested Is this a pulse pipeline (created by the EventManager) Info about current state of the pipeline. This value indicates the state of the pipeline after the change. Access the input writer for this pipeline. Access the output reader for this pipeline. Access the error output reader for this pipeline. This is the non-terminating error stream from the command. In this release, the objects read from this PipelineReader are PSObjects wrapping ErrorRecords. Is this pipeline a child pipeline? IsChild flag makes it possible for the pipeline to differentiate between a true v1 nested pipeline and the cmdlets calling cmdlets case. See bug 211462. This parameter is true if Invoke is called. It is false if InvokeAsync is called. For nested pipeline, system checks that Execute is called from currently executing pipeline. If PerformNestedCheck is false, this check is bypassed. This is set to true by remote provider. In remote provider case all the checks are done by the client proxy. This is the thread on which NestedPipeline can be executed. In case of LocalPipeline, this is the thread of execution of LocalPipeline. In case of RemotePipeline, this is thread on which EnterNestedPrompt is called. RemotePipeline proxy should set it on at the begining of EnterNestedPrompt and clear it on return. Event raised when Pipeline's state changes. Current state of the pipeline. This value indicates the state of the pipeline after the change. ManualResetEvent which is signaled when pipeline execution is completed/failed/stoped. OutputStream from PipelineProcessor. Host will read on ObjectReader of this stream. PipelineProcessor will write to ObjectWriter of this stream. ErrorStream from PipelineProcessor. Host will read on ObjectReader of this stream. PipelineProcessor will write to ObjectWriter of this stream. Informational Buffers that represent verbose, debug, progress, warning emanating from the command execution. Informational buffers are introduced after 1.0. This can be null if executing command as part of 1.0 hosting interfaces. Stream for providing input to PipelineProcessor. Host will write on ObjectWriter of this stream. PipelineProcessor will read from ObjectReader of this stream. if true, this pipeline is added in history String which is added in the history This needs to be internal so that it can be replaced by invoke-cmd to place correct string in history. Object used for synchronization Create a Pipeline with an existing command string. The LocalRunspace to associate with this pipeline. The command string to parse. if true, add pipeline to history True for nested pipeline Create a Pipeline with an existing command string. Caller should validate all the parameters. The LocalRunspace to associate with this pipeline. The command to execute. If true, add the command(s) to the history list of the runspace. If true, mark this pipeline as a nested pipeline. Stream to use for reading input objects. Stream to use for writing error objects. Stream to use for writing output objects. Buffers used to write progress, verbose, debug, warning information of an invocation. Copy constructor to support cloning The source pipeline Creates a new that is a copy of the current instance. A new that is a copy of this instance. Invoke the pipeline asynchronously with input. Results are returned through the reader. Prepares the invoke thread for execution Helper method for asynchronous invoke Start thread method for asynchronous pipeline execution. Stop the running pipeline. If true pipeline is stoped synchronously else asynchronously. Start method for asynchronous Stop Helper method for Stop functionality Creates a PipelineProcessor object from LocalPipeline object. Created PipelineProcessor object This method initializes streams and backs up their original states. This should be only called from constructors. This method sets streams to their orignal states from execution context. This is done when Pipeline is completed/failed/stopped ie., termination state. Adds an entry in history for this pipeline Add HistoryEntry for this pipeline. Use this function when writing history at the end of pipeline. This method is called Add-History cmdlet to add history entry. In general history entry for current pipeline is added at the end of pipeline execution. However when add-history cmdlet is executed, history entry needs to be added before add-history adds additional entries in to history. Add-history cmdlet adds history entry for the pipeline in its begin processing. This method is called to update the end execution time and status of pipeline. sets the history string to the specified one history string to set to Gets the execution context in the thread local storage of current thread ExecutionContext, if it available in TLS Null, if ExecutionContext is not availalbe in TLS This is list of HistoryInfo ids which have been executed in this pipeline. Set to true when object is disposed Protected dispose which can be overridden by derived classes. Stack Reserve setting for pipeline threads Gets PipelineStopper object which maitains stack of PipelineProcessor for this pipeline Returns true if pipeline is stopping Holds reference to LocalRunspace to which this pipeline is associated with Helper class that holds the thread used to execute pipelines when CreateThreadOptions.ReuseThread is used Creates the worker thread and waits for it to be ready Posts an item to the worker thread and wait for its completion Shortcut for dispose Implementation of the worker thread Releases the worker thread Ensure we release the worker thread Returns the worker thread This is helper class for stopping a running pipeline. This class maintains a stack of currently active pipeline processors. To stop a pipeline, stop is called on each pipeline processor in the stack. stack of current executing pipeline processor Object used for synchronization Default constructor This is set true when stop is called Push item in to PipelineProcessor stack Pop top item from PipelineProcessor stack Represents an (x,y) coordinate pair Initializes a new instance of the Coordinates class and defines the X and Y values. The X coordinate The Y coordinate Overrides "a,b" where a and b are the values of the X and Y properties. Overrides object to be compared for equality. True if is Coordinates and its X and Y values are the same as those of this instance, false if not. Overrides Hash code for this instance. Compares two instances for equality The left side operand. The right side operand. true if the respective X and Y values are the same, false otherwise. Compares two instances for inequality The left side operand. The right side operand. true if any of the respective either X or Y field is not the same, false otherwise. Gets and sets the X coordinate Gets and sets the Y coordinate Represents a width and height pair Initialize a new instance of the Size class and defines the Width and Height values. The Width The Height Overloads "a,b" where a and b are the values of the Width and Height properties. Overrides object to be compared for equality. True if is Size and its Width and Height values are the same as those of this instance, false if not. Overrides Hash code for this instance. Compares two instances for equality The left side operand. The right side operand. true if the respective Width and Height fields are the same, false otherwise. Compares two instances for inequality The left side operand. The right side operand. true if any of the respective Width and Height fields are not the same, false otherwise. Gets and sets the Width Gets and sets the Height Governs the behavior of and Allow Ctrl-C to be processed as a keystroke, as opposed to causing a break event. Do not display the character for the key in the window when pressed. Include key down events. Either one of IncludeKeyDown and IncludeKeyUp or both must be specified. Include key up events. Either one of IncludeKeyDown and IncludeKeyUp or both must be specified. Defines the states of Control Key The right alt key is pressed. The left alt key is pressed. The right ctrl key is pressed. The left ctrl key is pressed. The shift key is pressed. The numlock light is on. The scrolllock light is on. The capslock light is on. The key is enhanced. Represents information of a keystroke Initialize a new instance of the KeyInfo class and defines the VirtualKeyCode, Character, ControlKeyState and KeyDown values. The virtual key code The character The control key state Whether the key is pressed or released Overloads "a,b,c,d" where a, b, c, and d are the values of the VirtualKeyCode, Character, ControlKeyState, and KeyDown properties. Overrides object to be compared for equality. True if is KeyInfo and its VirtualKeyCode, Character, ControlKeyState, and KeyDown values are the same as those of this instance, false if not. Overrides Hash code for this instance. Compares two instances for equality The left side operand. The right side operand. true if the respective Character, ControlKeyStates , KeyDown, and VirtualKeyCode fields are the same, false otherwise. Compares two instances for inequality The left side operand. The right side operand. true if any of the respective Character, ControlKeyStates , KeyDown, or VirtualKeyCode fields are the different, false otherwise. Gets and set device-independent key Gets and set unicode Character of the key State of the control keys. Gets and set the status of whether this instance is generated by a key pressed or released Represents a rectangular region of the screen. Initialize a new instance of the Rectangle class and defines the Left, Top, Right, and Bottom values. The left side of the rectangle The top of the rectangle The right side of the rectangle The bottom of the rectanngle is less than ; is less than Initializes a new instance of the Rectangle class and defines the Left, Top, Right, and Bottom values by , the upper left corner and , the lower right corner. The Coordinates of the upper left corner of the Rectangle The Coordinates of the lower right corner of the Rectangle Overloads "a,b ; c,d" where a, b, c, and d are values of the Left, Top, Right, and Bottom properties. Overrides object to be compared for equality. True if is Rectangle and its Left, Top, Right, and Bottom values are the same as those of this instance, false if not. Overrides Hash code for this instance. Compares two instances for equality The left side operand. The right side operand. true if the respective Top, Left, Bottom, and Right fields are the same, false otherwise. Compares two instances for inequality The left side operand. The right side operand. true if any of the respective Top, Left, Bottom, and Right fields are not the same, false otherwise. Gets and sets the left side of the rectangle Gets and sets the top of the rectangle Gets and sets the right side of the rectangle Gets and sets the bottom of the rectanngle Represents a character, a foregroundColor color, and background color Initializes a new instance of the BufferCell class and defines the Character, ForegroundColor, BackgroundColor and Type values. The character in this BufferCell object The foreground color of this BufferCell object The foreground color of this BufferCell object The type of this BufferCell object Overloads "'a' b c d" where a, b, c, and d are the values of the Character, ForegroundColor, BackgroundColor, and Type properties. Overrides object to be compared for equality. True if is BufferCell and its Character, ForegroundColor, BackgroundColor, and BufferCellType values are the same as those of this instance, false if not. Overrides Hash code for this instance. Compares two instances for equality The left side operand. The right side operand. true if the respective Character, ForegroundColor, BackgroundColor, and BufferCellType values are the same, false otherwise. Compares two instances for inequality The left side operand. The right side operand. true if any of the respective Character, ForegroundColor, BackgroundColor, and BufferCellType values are not the same, false otherwise. Gets and sets the character value Gets and sets the foreground color Gets and sets the background color Gets and sets the type value Defines three types of BufferCells to accommodate for hosts that use up to two cells to display a character in some languages such as Chinese and Japanese. Character occupies one BufferCell Character occupies two BufferCells and this is the leading one Preceded by a Leading BufferCell Helper methods used by PowerShell's Hosts: ConsoleHost and InternalHost to process PromptForChoice. Constructs a string of the choices and their hotkeys. 1. Cannot process the hot key because a question mark ("?") cannot be used as a hot key. Searches for a corresponding match between the response string and the choices. A match is either the response string is the full text of the label (sans hotkey marker), or is a hotkey. Full labels are checked first, and take precedence over hotkey matches. Returns the index into the choices array matching the response string, or -1 if there is no match. Define a parameter for Create a named parameter with a null value parameter name name is null. Name length is zero after trimming whitespace. Create a named parameter parameter name parameter value Name is non null and name length is zero after trimming whitespace. The parameter name The parameter value. Creates a CommandParameter object from a PSObject property bag. PSObject has to be in the format returned by ToPSObjectForRemoting method. PSObject to rehydrate CommandParameter rehydrated from a PSObject property bag Thrown if the PSObject is null. Thrown when the PSObject is not in the expected format Returns this object as a PSObject property bag that can be used in a remoting protocol data object. This object as a PSObject property bag gets the parameter name gets the value of the parameter Defines a collection of parameters. Create a new empty instance of this collection type Add a parameter with given name and default null value name of the parameter name is null. Name length is zero after trimming whitespace. Add a parameter with given name and value name of the parameter value of the parameter Both name and value are null. One of these must be non-null. Name is non null and name length is zero after trimming whitespace. Defines exception which is thrown when state of the pipeline is different from expected state. Initializes a new instance of the InvalidPipelineStateException class Initializes a new instance of the InvalidPipelineStateException class with a specified error message The error message that explains the reason for the exception. Initializes a new instance of the InvalidPipelineStateException class with a specified error message and a reference to the inner exception that is the cause of this exception. The error message that explains the reason for the exception. The exception that is the cause of the current exception. Initializes a new instance of the InvalidPipelineStateException and defines value of CurrentState and ExpectedState The error message that explains the reason for the exception. Current state of pipeline Expected state of pipeline Initializes a new instance of the class with serialized data. The that holds the serialized object data about the exception being thrown. The that contains contextual information about the source or destination. State of pipleine when exception was thrown. States of the pipeline expected in method which throws this exception. Gets CurrentState of the pipeline Gets ExpectedState of the pipeline Enumerated type defining the state of the Pipeline The pipeline has not been started The pipeline is executing The pipeline is stoping execution. The pipeline is completed due to a stop request. The pipeline has completed. The pipeline completed abnormally due to an error. The pipeline is disconnected from remote running command. Type which has information about PipelineState and Exception associated with PipelineState Constructor for state changes not resulting from an error. Execution state Constructor for state changes with an optional error. The new state. A non-null exception if the state change was caused by an error,otherwise; null. Copy constructor to support cloning source information ArgumentNullException when is null. Clones this object Cloned object The current execution state Non-null exception if the execution state change was due to an error. The state of the runspace. This value indicates the state of the pipeline after the change. The reason for the state change, if caused by an error. The value of this property is non-null if the state changed due to an error. Otherwise, the value of this property is null. Event arguments passed to PipelineStateEvent handlers event. Constructor PipelineStateEventArgs from PipelineStateInfo The current state of the pipeline. ArgumentNullException when is null. Info about state of pipeline Info about current state of pipeline. Defines exception which is thrown when state of the PowerShell is different from the expected state. Creates a new instance of InvalidPowershellStateException class. Creates a new instance of InvalidPowershellStateException class. The error message that explains the reason for the exception. Creates a new instance of InvalidPowershellStateException class. The error message that explains the reason for the exception. The exception that is the cause of the current exception. Initializes a new instance of the InvalidPowerShellStateException and defines value of CurrentState. Current state of powershell Initializes a new instance of the InvalidPowerShellStateException class with serialized data. The that holds the serialized object data about the exception being thrown. The that contains contextual information about the source or destination. State of powershell when exception was thrown. Gets CurrentState of the powershell Enumerated type defining the state of the PowerShell PowerShell has not been started PowerShell is executing PowerShell is stoping execution. PowerShell is completed due to a stop request. PowerShell has completed executing a command. PowerShell completed abnormally due to an error. PowerShell is in disconnected state. Enumerated type defining runspace modes for nested pipeline Use current runspace from the current thread of execution Create new runspace Type which has information about InvocationState and Exception associated with InvocationState Constructor for state changes with an optional error. The new state. A non-null exception if the state change was caused by an error,otherwise; null. Construct from PipelineStateInfo Clone the current instance. A copy of the current instance. The current execution state Non-null exception if the execution state change was due to an error. The state of the PowerShell instance. The reason for the state change, if caused by an error. The value of this property is non-null if the state changed due to an error. Otherwise, the value of this property is null. Event arguments passed to PowerShell state change handlers event. Constructs PSInvocationStateChangedEventArgs from PSInvocationStateInfo state to raise the event with. Information about current state of a PowerShell Instance. Information about current state of a PowerShell Instance. Settings to control command invocation. Default Constructor. ApartmentState of the thread in which the command is executed. Host to use with the Runspace when the command is executed. Options for the Error, Warning, Verbose and Debug streams during remote calls Boolean which tells if the command is added to the history of the Runspace the command is executing in. By default this is false. Determines how errors should be handled during batch command execution Used by Powershell remoting infrastructure to flow identity from calling thread to Pipeline Execution Thread. Scenario: In the IIS hosting model, the calling thread is impersonated with a different identity than the process identity. However Pipeline Execution Thread always inherits process's identity and this will create problems related to security. In the IIS hosting model, we should honor calling threads identity. Invokes a remote command and immediately disconnects, if the transport layer supports this operation. Batch execution context Class constructor Waits for the completion event Signals the completion event Invocation output Command to invoke These flags control whether InvocationInfo is added to items in the Error, Warning, Verbose and Debug streams during remote calls If this flag is set, ErrorRecord will include an instance of InvocationInfo on remote calls If this flag is set, WarningRecord will include an instance of InvocationInfo on remote calls If this flag is set, DebugRecord will include an instance of InvocationInfo on remote calls If this flag is set, VerboseRecord will include an instance of InvocationInfo on remote calls If this flag is set, ErrorRecord, WarningRecord, DebugRecord, and VerboseRecord will include an instance of InvocationInfo on remote calls Internal Async result type used by BeginInvoke() and BeginStop() overloads. Constructor Instace Id of the Powershell object creating this instance Callback to call when the async operation completes. A user supplied state to call the "callback" with. The output buffer to return from EndInvoke. true if AsyncResult monitors BeginInvoke. false otherwise true if AsyncResult monitors Async BeginInvoke(). false otherwise The output buffer for the asynchronous invoke Represents a PowerShell command or script to execute against a Runspace(Pool) if provided, otherwise execute using a default Runspace. Provides access to different result buffers like output, error, debug, verbose, progress and warning. Provides a simple interface to execute a powershell command: Powershell.Create("get-process").Invoke(); The above statetement creates a local runspace using default configuration, executes the command and then closes the runspace. Using RunspacePool property, the caller can provide the runspace where the command / script is executed. Constructs PowerShell A PSCommand. A list of extra commands to run A Runspace or RunspacePool to refer while invoking the command. This can be null in which case a new runspace is created whenever Invoke* method is called. Constructs a PowerShell instance in the disconnected start state with the provided remote command connect information and runspace(pool) objects. Remote command connect information. Remote Runspace or RunspacePool object. Creates a PowerShell object in the disconnected start state and with a ConnectCommandInfo object parameter that specifies what remote command to associate with this PowerShell when it is connected. Sets the command collection in this powershell This method will be called by RemotePipeline before it begins execution. This method is used to set the command collection of the remote pipeline as the command collection of the underlying powershell Initialize PowerShell object for connection to remote command. Input stream. Output stream. Error stream. Settings information. Redirect error output. Constructs an empty PowerShell instance; a script or command must be added before invoking this instance An instance of PowerShell. Constructs an empty PowerShell instance; a script or command must be added before invoking this instance runspace mode An instance of PowerShell. Constructs an empty PowerShell instance; a script or command must be added before invoking this instance InitialSessionState with which to create the runspace An instance of PowerShell. Creates a nested powershell within the current instance. Nested PowerShell is used to do simple operations like checking state of a variable while another command is using the runspace. Nested PowerShell should be invoked from the same thread as the parent PowerShell invocation thread. So effectively the parent Powershell invocation thread is blocked until nested invoke() operation is complete. Implement PSHost.EnterNestedPrompt to perform invoke() operation on the nested powershell. 1. State of powershell instance is not valid to create a nested powershell instance. Nested PowerShell should be created only for a running powershell instance. Method needed when deserializing PowerShell object coming from a RemoteDataObject Indicates if PowerShell object is nested Commands that the PowerShell pipeline is built of Extra commands to run Add a cmdlet to construct a command pipeline. For example, to construct a command string "get-process | sort-object", PowerShell shell = PowerShell.Create("get-process").AddCommand("sort-object"); A string representing cmdlet. A PowerShell instance with added. This method is not thread safe. cmdlet is null. Powershell instance cannot be changed in its current state. Object is disposed. Add a cmdlet to construct a command pipeline. For example, to construct a command string "get-process | sort-object", PowerShell shell = PowerShell.Create("get-process").AddCommand("sort-object"); A string representing cmdlet. if true local scope is used to run the script command. A PowerShell instance with added. This method is not thread safe. cmdlet is null. Powershell instance cannot be changed in its current state. Object is disposed. Add a piece of script to construct a command pipeline. For example, to construct a command string "get-process | foreach { $_.Name }" PowerShell shell = PowerShell.Create("get-process"). AddCommand("foreach { $_.Name }", true); A string representing a script. A PowerShell instance with added. This method is not thread-safe. command is null. Powershell instance cannot be changed in its current state. Object is disposed. Add a piece of script to construct a command pipeline. For example, to construct a command string "get-process | foreach { $_.Name }" PowerShell shell = PowerShell.Create("get-process"). AddCommand("foreach { $_.Name }", true); A string representing a script. if true local scope is used to run the script command. A PowerShell instance with added. This method is not thread-safe. command is null. Powershell instance cannot be changed in its current state. Object is disposed. Add a element to the current command pipeline. Command to add. A PSCommand instance with added. This method is not thread-safe. command is null. Powershell instance cannot be changed in its current state. Object is disposed. CommandInfo object for the command to add. The CommandInfo object for the command to add A PSCommand instance with the command added. This method is not thread-safe. command is null. Powershell instance cannot be changed in its current state. Object is disposed. Add a parameter to the last added command. For example, to construct a command string "get-process | select-object -property name" PowerShell shell = PowerShell.Create("get-process"). AddCommand("select-object").AddParameter("property","name"); Name of the parameter. Value for the parameter. A PowerShell instance with added to the parameter list of the last command. This method is not thread safe. Name is non null and name length is zero after trimming whitespace. Powershell instance cannot be changed in its current state. Object is disposed. Adds a switch parameter to the last added command. For example, to construct a command string "get-process | sort-object -descending" PSCommand command = new PSCommand("get-process"). AddCommand("sort-object").AddParameter("descending"); Name of the parameter. A PowerShell instance with added to the parameter list of the last command. This method is not thread safe. Name is non null and name length is zero after trimming whitespace. Powershell instance cannot be changed in its current state. Object is disposed. Adds a set of parameters to the last added command. List of parameters. A PowerShell instance with the items in added to the parameter list of the last command. This method is not thread safe. The function was given a null argument. Powershell instance cannot be changed in its current state. Adds a set of parameters to the last added command. Dictionary of parameters. Each key-value pair corresponds to a parameter name and its value. Keys must strings. A PowerShell instance with the items in added to the parameter list of the last command. This method is not thread safe. The function was given a null argument. Powershell instance cannot be changed in its current state. One of the dictionary keys is not a string. Adds an argument to the last added command. For example, to construct a command string "get-process | select-object name" PowerShell shell = PowerShell.Create("get-process"). AddCommand("select-object").AddParameter("name"); This will add the value "name" to the positional parameter list of "select-object" cmdlet. When the command is invoked, this value will get bound to positional parameter 0 of the "select-object" cmdlet which is "Property". Value for the parameter. A PSCommand instance parameter value added to the parameter list of the last command. This method is not thread safe. Adds an additional statement for execution For example, Runspace rs = RunspaceFactory.CreateRunspace(); PowerShell ps = PowerShell.Create(); ps.Runspace = rs; ps.AddCommand("Get-Process").AddArgument("idle"); ps.AddStatement().AddCommand("Get-Service").AddArgument("audiosrv"); ps.Invoke(); A PowerShell instance with the items in added to the parameter list of the last command. Internal method to set the Runspace property Gets the associated Runspace or RunspacePool for this PowerShell instance. If this is null, PowerShell instance is not associated with any runspace. Synchronously connects to a running command on a remote server. Command output as a PSDataCollection. Asynchronously connects to a running command on a remote server. The returned IAsyncResult object can be used with EndInvoke() method to wait on command and/or get command returned data. IAsyncResult. Checks that the current runspace associated with this PowerShell is a remote runspace, and if it is in Disconnected state then to connect it. Invoke the synchronously and return the output PSObject collection. collection of PSObjects. Object is disposed. Cannot perform the operation because the command is already started.Stop the command and try the operation again. (or) No commands are specified. The script recursed too deeply into script functions. There is a fixed limit on the depth of recursion. A CLR security violation occurred. Typically, this happens because the current CLR permissions do not allow adequate reflextion access to a cmdlet assembly. The thread in which the command was executing was aborted. PowerShell.Invoke can throw a variety of exceptions derived from RuntimeException. The most likely of these exceptions are listed below. One of more parameters or parameter values specified for a cmdlet are not valid, or mandatory parameters for a cmdlet were not specified. A cmdlet generated a terminating error. A provider generated a terminating error. The ActionPreference.Stop or ActionPreference.Inquire policy triggered a terminating error. The pipeline was terminated asynchronously. If there is an error generating the metadata for dynamic parameters. Invoke the synchronously and return the output PSObject collection. Input to the command Collection of PSObjects representing output. Object is disposed. Cannot perform the operation because the command is already started.Stop the command and try the operation again. (or) No commands are specified. The script recursed too deeply into script functions. There is a fixed limit on the depth of recursion. A CLR security violation occurred. Typically, this happens because the current CLR permissions do not allow adequate reflextion access to a cmdlet assembly. The thread in which the command was executing was aborted. PowerShell.Invoke can throw a variety of exceptions derived from RuntimeException. The most likely of these exceptions are listed below. One of more parameters or parameter values specified for a cmdlet are not valid, or mandatory parameters for a cmdlet were not specified. A cmdlet generated a terminating error. A provider generated a terminating error. The ActionPreference.Stop or ActionPreference.Inquire policy triggered a terminating error. The pipeline was terminated asynchronously. If there is an error generating the metadata for dynamic parameters. Invoke the synchronously and return the output PSObject collection. Input to the command Invocation Settings Collection of PSObjects representing output. Object is disposed. Cannot perform the operation because the command is already started.Stop the command and try the operation again. (or) No commands are specified. The script recursed too deeply into script functions. There is a fixed limit on the depth of recursion. A CLR security violation occurred. Typically, this happens because the current CLR permissions do not allow adequate reflextion access to a cmdlet assembly. The thread in which the command was executing was aborted. PowerShell.Invoke can throw a variety of exceptions derived from RuntimeException. The most likely of these exceptions are listed below. One of more parameters or parameter values specified for a cmdlet are not valid, or mandatory parameters for a cmdlet were not specified. A cmdlet generated a terminating error. A provider generated a terminating error. The ActionPreference.Stop or ActionPreference.Inquire policy triggered a terminating error. The pipeline was terminated asynchronously. If there is an error generating the metadata for dynamic parameters. Invoke the synchronously and return the output. Type of output object(s) expected from the command invocation. Object is disposed. Cannot perform the operation because the command is already started.Stop the command and try the operation again. (or) No commands are specified. The script recursed too deeply into script functions. There is a fixed limit on the depth of recursion. A CLR security violation occurred. Typically, this happens because the current CLR permissions do not allow adequate reflextion access to a cmdlet assembly. The thread in which the command was executing was aborted. PowerShell.Invoke can throw a variety of exceptions derived from RuntimeException. The most likely of these exceptions are listed below. One of more parameters or parameter values specified for a cmdlet are not valid, or mandatory parameters for a cmdlet were not specified. A cmdlet generated a terminating error. A provider generated a terminating error. The ActionPreference.Stop or ActionPreference.Inquire policy triggered a terminating error. The pipeline was terminated asynchronously. If there is an error generating the metadata for dynamic parameters. Invoke the synchronously and return the output. Type of output object(s) expected from the command invocation. Input to the command Object is disposed. Cannot perform the operation because the command is already started.Stop the command and try the operation again. (or) No commands are specified. The script recursed too deeply into script functions. There is a fixed limit on the depth of recursion. A CLR security violation occurred. Typically, this happens because the current CLR permissions do not allow adequate reflextion access to a cmdlet assembly. The thread in which the command was executing was aborted. PowerShell.Invoke can throw a variety of exceptions derived from RuntimeException. The most likely of these exceptions are listed below. One of more parameters or parameter values specified for a cmdlet are not valid, or mandatory parameters for a cmdlet were not specified. A cmdlet generated a terminating error. A provider generated a terminating error. The ActionPreference.Stop or ActionPreference.Inquire policy triggered a terminating error. The pipeline was terminated asynchronously. If there is an error generating the metadata for dynamic parameters. Invoke the synchronously and return the output. Type of output object(s) expected from the command invocation. Input to the command Invocation Settings Object is disposed. Cannot perform the operation because the command is already started.Stop the command and try the operation again. (or) No commands are specified. The script recursed too deeply into script functions. There is a fixed limit on the depth of recursion. A CLR security violation occurred. Typically, this happens because the current CLR permissions do not allow adequate reflextion access to a cmdlet assembly. The thread in which the command was executing was aborted. PowerShell.Invoke can throw a variety of exceptions derived from RuntimeException. The most likely of these exceptions are listed below. One of more parameters or parameter values specified for a cmdlet are not valid, or mandatory parameters for a cmdlet were not specified. A cmdlet generated a terminating error. A provider generated a terminating error. The ActionPreference.Stop or ActionPreference.Inquire policy triggered a terminating error. The pipeline was terminated asynchronously. If there is an error generating the metadata for dynamic parameters. Invoke the synchronously and collect output data into the buffer Type of output object(s) expected from the command invocation. Input to the command A collection supplied by the user where output is collected. cannot be null. Object is disposed. Cannot perform the operation because the command is already started.Stop the command and try the operation again. (or) No commands are specified. The script recursed too deeply into script functions. There is a fixed limit on the depth of recursion. A CLR security violation occurred. Typically, this happens because the current CLR permissions do not allow adequate reflextion access to a cmdlet assembly. The thread in which the command was executing was aborted. PowerShell.Invoke can throw a variety of exceptions derived from RuntimeException. The most likely of these exceptions are listed below. One of more parameters or parameter values specified for a cmdlet are not valid, or mandatory parameters for a cmdlet were not specified. A cmdlet generated a terminating error. A provider generated a terminating error. The ActionPreference.Stop or ActionPreference.Inquire policy triggered a terminating error. The pipeline was terminated asynchronously. If there is an error generating the metadata for dynamic parameters. Invoke the synchronously and collect output data into the buffer Type of output object(s) expected from the command invocation. Input to the command A collection supplied by the user where output is collected. Invocation Settings to use. cannot be null. No commands are specified. The script recursed too deeply into script functions. There is a fixed limit on the depth of recursion. A CLR security violation occurred. Typically, this happens because the current CLR permissions do not allow adequate reflextion access to a cmdlet assembly. The thread in which the command was executing was aborted. PowerShell.Invoke can throw a variety of exceptions derived from RuntimeException. The most likely of these exceptions are listed below. One of more parameters or parameter values specified for a cmdlet are not valid, or mandatory parameters for a cmdlet were not specified. A cmdlet generated a terminating error. A provider generated a terminating error. The ActionPreference.Stop or ActionPreference.Inquire policy triggered a terminating error. The pipeline was terminated asynchronously. If there is an error generating the metadata for dynamic parameters. Invoke the synchronously and stream output data into the buffer Type of input object(s) expected from the command invocation. Type of output object(s) expected from the command invocation. Input to the command Output of the command. Invocation Settings to use. cannot be null. No commands are specified. The script recursed too deeply into script functions. There is a fixed limit on the depth of recursion. A CLR security violation occurred. Typically, this happens because the current CLR permissions do not allow adequate reflextion access to a cmdlet assembly. The thread in which the command was executing was aborted. PowerShell.Invoke can throw a variety of exceptions derived from RuntimeException. The most likely of these exceptions are listed below. One of more parameters or parameter values specified for a cmdlet are not valid, or mandatory parameters for a cmdlet were not specified. A cmdlet generated a terminating error. A provider generated a terminating error. The ActionPreference.Stop or ActionPreference.Inquire policy triggered a terminating error. The pipeline was terminated asynchronously. If there is an error generating the metadata for dynamic parameters. Invoke the asynchronously. Use EndInvoke() to obtain the output of the command. Cannot perform the operation because the command is already started. Stop the command and try the operation again. (or) No command is added. Object is disposed. Invoke the asynchronously. Use EndInvoke() to obtain the output of the command. When invoked using BeginInvoke, invocation doesn't finish until Input is closed. Caller of BeginInvoke must close the input buffer after all input has been written to input buffer. Input buffer is closed by calling Close() method. If you want this command to execute as a standalone cmdlet (that is, using command-line parameters only), be sure to call Close() before calling BeginInvoke(). Otherwise, the command will be executed as though it had external input. If you observe that the command isn't doing anything, this may be the reason. Type of the input buffer Input to the command. See remarks for more details. Cannot perform the operation because the command is already started. Stop the command and try the operation again. (or) No command is added. Object is disposed. Invoke the asynchronously. Use EndInvoke() to obtain the output of the command. When invoked using BeginInvoke, invocation doesn't finish until Input is closed. Caller of BeginInvoke must close the input buffer after all input has been written to input buffer. Input buffer is closed by calling Close() method. If you want this command to execute as a standalone cmdlet (that is, using command-line parameters only), be sure to call Close() before calling BeginInvoke(). Otherwise, the command will be executed as though it had external input. If you observe that the command isn't doing anything, this may be the reason. Type of the input buffer Input to the command. See remarks for more details. Invocation Settings. An AsyncCallback to call once the BeginInvoke completes. A user supplied state to call the with. Cannot perform the operation because the command is already started. Stop the command and try the operation again. (or) No command is added. Object is disposed. Invoke the asynchronously. When this method is used EndInvoke() returns a null buffer. When invoked using BeginInvoke, invocation doesn't finish until Input is closed. Caller of BeginInvoke must close the input buffer after all input has been written to input buffer. Input buffer is closed by calling Close() method. If you want this command to execute as a standalone cmdlet (that is, using command-line parameters only), be sure to call Close() before calling BeginInvoke(). Otherwise, the command will be executed as though it had external input. If you observe that the command isn't doing anything, this may be the reason. Type of input object(s) for the command invocation. Type of output object(s) expected from the command invocation. Input to the command. See remarks for more details. A buffer supplied by the user where output is collected. Cannot perform the operation because the command is already started. Stop the command and try the operation again. (or) No command is added. Object is disposed. Invoke the asynchronously and collect output data into the buffer . When this method is used EndInvoke() returns a null buffer. When invoked using BeginInvoke, invocation doesn't finish until Input is closed. Caller of BeginInvoke must close the input buffer after all input has been written to input buffer. Input buffer is closed by calling Close() method. If you want this command to execute as a standalone cmdlet (that is, using command-line parameters only), be sure to call Close() before calling BeginInvoke(). Otherwise, the command will be executed as though it had external input. If you observe that the command isn't doing anything, this may be the reason. Type of input object(s) for the command invocation. Type of output object(s) expected from the command invocation. Input to the command. See remarks for more details. A buffer supplied by the user where output is collected. Invocation Settings. An AsyncCallback to call once the BeginInvoke completes. A user supplied state to call the with. Cannot perform the operation because the command is already started. Stop the command and try the operation again. (or) No command is added. Object is disposed. Begins a batch execution Type of input object(s) for the command invocation. Type of output object(s) expected from the command invocation. Input to the command. See remarks for more details. A buffer supplied by the user where output is collected. Invocation Settings. An AsyncCallback to call once the BeginInvoke completes. A user supplied state to call the with. Cannot perform the operation because the command is already started. Stop the command and try the operation again. (or) No command is added. Object is disposed. Batch invocation callback Batch invocation callback Executes remaining batch commands Begins an async batch execution Ends an async batch execution Appends an exception to the error stream Waits for the pending asynchronous BeginInvoke to complete. Instance of IAsyncResult returned by BeginInvoke. The output buffer created to hold the results of the asynchronous invoke, or null if the caller provided their own buffer. asyncResult is a null reference. asyncResult object was not created by calling BeginInvoke on this PowerShell instance. Stop the currently running command synchronously. Object is disposed. Stop the currently running command asynchronously. If the command is not started, the state of PowerShell instance is changed to Stopped and corresponding events will be raised. The returned IAsyncResult object can be used to wait for the stop operation to complete. A AsyncCallback to call once the BeginStop completes. A user supplied state to call the with. Object is disposed. Waits for the pending asynchronous BeginStop to complete. Instance of IAsyncResult returned by BeginStop. asyncResult is a null reference. asyncResult object was not created by calling BeginStop on this PowerShell instance. Handler for state changed changed events for the currently running pipeline. Source of the event. Pipeline State. Dispose all managed resources. This will suppress finalizer on the object from getting called by calling System.GC.SuppressFinalize(this). This has been added as a work around for Windows8 bug 803461. It should be used only for the PSJobProxy API. Resets the instance ID of the command to a new guid. If this is not done, then there is a race condition on the server in the following circumstances: ps.BeginInvoke(...); ps.Stop() ps.Commands.Clear(); ps.AddCommand("Foo"); ps.Invoke(); In these conditions, stop returns before the server is done cleaning up. The subsequent invoke will cause an error because the guid already identifies a command in progress. Get a steppable pipeline object. A steppable pipeline object An attempt was made to use the scriptblock outside of the engine. Returns the current execution context from TLS, or raises an exception if it is null. An attempt was made to use the scriptblock outside of the engine. Gets the steppable pipeline from the powershell object engine execution context command origin steppable pipeline object Checks if the command is running Checks if the current state is Disconnected. Checks if the command is already running. If the command is already running, throws an exception. Cannot perform the operation because the command is already started. Stop the command and try the operation again. Object is disposed. Checks if the current powershell instance can accept changes like changing one of the properties like Output, Command etc. If changes are not allowed, throws an exception. Powershell instance cannot be changed in its current state. Object is disposed. Checks if the current powershell instance is disposed. If disposed, throws ObjectDisposedException. Object is disposed. Release all the resources. if true, release all the managed objects. Clear the internal elements Raise the execution state change event handlers. State Information Sets the state of this powershell instance. the state info to set Helper function to close the input buffer after command is reconnected. Previous state. clear the internal reference to remote powershell Sets if the pipeline is nested, typically used by the remoting infrastructure Performs the actual synchronous command invocation. The caller should check if it safe to call this method. Type of objects to return. Input to the command. output from the command Invocation settings. No commands are specified. The script recursed too deeply into script functions. There is a fixed limit on the depth of recursion. A CLR security violation occurred. Typically, this happens because the current CLR permissions do not allow adequate reflextion access to a cmdlet assembly. The thread in which the command was executing was aborted. PowerShell.Invoke can throw a variety of exceptions derived from RuntimeException. The most likely of these exceptions are listed below. One of more parameters or parameter values specified for a cmdlet are not valid, or mandatory parameters for a cmdlet were not specified. A cmdlet generated a terminating error. A provider generated a terminating error. The ActionPreference.Stop or ActionPreference.Inquire policy triggered a terminating error. The pipeline was terminated asynchronously. If there is an error generating the metadata for dynamic parameters. Core invocation helper method input type output type input objects output object invocation settings Core invocation helper method for remoting input type output type input objects output object invocation settings Core invocation method input type output type input objects output object invocation settings Performs the actual asynchronous command invocation. Type of the input buffer Type of the output buffer input can be null A AsyncCallback to call once the BeginInvoke completes. A user supplied state to call the with. The output buffer to attach to the IAsyncResult returned by this method Cannot perform the operation because the command is already started. Stop the command and try the operation again. (or) No command is added. (or) BeginInvoke is called on nested powershell. Nested Powershell cannot be executed Asynchronously. Object is disposed. Verifies the settings for ThreadOptions and ApartmentState Type for the input collection Type for the output collection Cannot perform the operation because the command is already started. Stop the command and try the operation again. Object is disposed. Called by both Sync Stop and Async Stop. If isSyncCall is false, then an IAsyncResult object is returned which can be passed back to the user true if pipeline to be stopped synchronously, false otherewise. Valid for asynchronous stop Valid for asynchronous stop If there is no worker assigned yet, we need to emulate stop here. In Asynchronous stop case, we need to send event change notifications from a different thread. Creates a PowerShell object from a PSObject property bag. PSObject has to be in the format returned by ToPSObjectForRemoting method. PSObject to rehydrate PowerShell rehydrated from a PSObject property bag Thrown if the PSObject is null. Thrown when the PSObject is not in the expected format Returns this object as a PSObject property bag that can be used in a remoting protocol data object. This object as a PSObject property bag Returns a job object which can be used to control the invocation of the command with AsJob Parameter Job object Gets or sets current powershell command line. Cannot set to a null value. Powershell instance cannot be changed in its current state. Object is disposed. Streams generated by PowerShell invocations Gets or sets the error buffer. Powershell invocation writes the error data into this buffer. Cannot set to a null value. Powershell instance cannot be changed in its current state. Object is disposed. Gets or sets the progress buffer. Powershell invocation writes the progress data into this buffer. Can be null. Powershell instance cannot be changed in its current state. Object is disposed. Gets or sets the verbose buffer. Powershell invocation writes the verbose data into this buffer. Can be null. Powershell instance cannot be changed in its current state. Object is disposed. Gets or sets the debug buffer. Powershell invocation writes the debug data into this buffer. Can be null. Powershell instance cannot be changed in its current state. Object is disposed. Gets or sets the warning buffer. Powershell invocation writes the warning data into this buffer. Can be null. Cannot set to a null value. Powershell instance cannot be changed in its current state. Object is disposed. Gets the informational buffers If this flag is true, the commands in this Pipeline will redirect the global error output pipe to the command's error output pipe. (see the comment in Pipeline.RedirectShellErrorOutputPipe for an explanation of why this flag is needed) Get unqiue id for this instance of runspace pool. It is primarily used for logging purposes. Gets the execution state of the current PowerShell instance. Gets the property which indicates if this PowerShell instance is nested. Gets the property which indicates if this PowerShell instance is a child instance. IsChild flag makes it possible for the pipeline to differentiate between a true v1 nested pipeline and the cmdlets calling cmdlets case. See bug 211462. If an error occurred while executing the pipeline, this will be set to true. Event rasied when PowerShell Execution State Changes. This event gets fired when a Runspace from the RunspacePool is assigned to this PowerShell instance to invoke the commands. Sets an associated Runspace for this PowerShell instance. This can be null in which case a new runspace is created whenever Invoke* method is called. This property and RunspacePool are mutually exclusive; setting one of them resets the other to null Powershell instance cannot be changed in its current state. Object is disposed. Sets an associated RunspacePool for this PowerShell instance. A Runspace from this pool is used whenever Invoke* method is called. This can be null in which case a new runspace is created whenever Invoke* method is called. This property and Runspace are mutually exclusive; setting one of them resets the other to null Powershell instance cannot be changed in its current state. Object is disposed. Indicates if this PowerShell object is the owner of the runspace or RunspacePool assigned to this object The client remote powershell associated with this powershell object The history string to be used for displaying the history. Extra commands to run in a single invocation Currently running extra commands AsyncResult object used to monitor pipeline creation and invocation. This is needed as a Runspace may not be available in the RunspacePool. This method gets invoked from a ThreadPool thread. This method gets invoked when PowerShell is not associated with a RunspacePool. User supplied Runspace if any. true if Invoke() should be used to invoke pipeline false if InvokeAsync() should be used. All exceptions are caught and reported via a PipelineStateChanged event. This method gets called from a ThreadPool thread. This method gets called from a RunspacePool thread when a Runsapce is available. AsyncResult object which monitors the asyncOperation. All exceptions are caught and reported via a PipelineStateChanged event. Constructs a pipeline from the supplied runspace and invokes pipeline either synchronously or asynchronously identified by . Runspace to create pipeline. Cannot be null. if true, Invoke() is called BeginInvoke() otherwise. 1.BeginInvoke is called on nested powershell. Nested Powershell cannot be executed Asynchronously. true if the pipeline is created/invoked successfully. false otherwise. Stops the async operation. Internal clear is called when the invoke operation is completed or failed or stopped. Sets the async result object that monitors a BeginGetRunspace async operation on the RunspacePool. Gets the currently running pipeline. Streams generated by PowerShell invocations PSDataStreams is the public interface to access the *Buffer properties in the PowerShell class Removes all items from all the data streams Gets or sets the error buffer. Powershell invocation writes the error data into this buffer. Cannot set to a null value. Powershell instance cannot be changed in its current state. Object is disposed. Gets or sets the progress buffer. Powershell invocation writes the progress data into this buffer. Can be null. Powershell instance cannot be changed in its current state. Object is disposed. Gets or sets the verbose buffer. Powershell invocation writes the verbose data into this buffer. Can be null. Powershell instance cannot be changed in its current state. Object is disposed. Gets or sets the debug buffer. Powershell invocation writes the debug data into this buffer. Can be null. Powershell instance cannot be changed in its current state. Object is disposed. Gets or sets the warning buffer. Powershell invocation writes the warning data into this buffer. Can be null. Cannot set to a null value. Powershell instance cannot be changed in its current state. Object is disposed. Helper class for making sure Ctrl-C stops an active powershell invocation. powerShell = PowerShell.Create(); powerShell.AddCommand("Start-Sleep"); powerShell.AddParameter("Seconds", 10); powerShell.Runspace = remoteRunspace; Collection<PSObject> result; using (new PowerShellStopper(context, powerShell)) { result = powerShell.Invoke(); } Defines a PowerShell command / script object which can be used with object. Creates an empty PSCommand; a command or script must be added to this PSCommand before it can be executed. Internal copy constructor Creates a PSCommand from the specified command Command object to use Add a command to construct a command pipeline. For example, to construct a command string "get-process | sort-object", PSCommand command = new PSCommand("get-process").AddCommand("sort-object"); A string representing the command. Powershell instance cannot be changed in its current state. A PSCommand instance with added. This method is not thread safe. cmdlet is null. Add a cmdlet to construct a command pipeline. For example, to construct a command string "get-process | sort-object", PSCommand command = new PSCommand("get-process").AddCommand("sort-object"); A string representing cmdlet. if true local scope is used to run the script command. Powershell instance cannot be changed in its current state. A PSCommand instance with added. This method is not thread safe. cmdlet is null. Add a piece of script to construct a command pipeline. For example, to construct a command string "get-process | foreach { $_.Name }" PSCommand command = new PSCommand("get-process"). AddCommand("foreach { $_.Name }", true); A string representing the script. A PSCommand instance with added. This method is not thread-safe. command is null. Powershell instance cannot be changed in its current state. Add a piece of script to construct a command pipeline. For example, to construct a command string "get-process | foreach { $_.Name }" PSCommand command = new PSCommand("get-process"). AddCommand("foreach { $_.Name }", true); A string representing the script. if true local scope is used to run the script command. A PSCommand instance with added. This method is not thread-safe. command is null. Powershell instance cannot be changed in its current state. Add a element to the current command pipeline. Command to add. A PSCommand instance with added. This method is not thread-safe. command is null. Powershell instance cannot be changed in its current state. Add a parameter to the last added command. For example, to construct a command string "get-process | select-object -property name" PSCommand command = new PSCommand("get-process"). AddCommand("select-object").AddParameter("property","name"); Name of the parameter. Value for the parameter. A PSCommand instance with added to the parameter list of the last command. This method is not thread safe. Name is non null and name length is zero after trimming whitespace. Powershell instance cannot be changed in its current state. Adds a switch parameter to the last added command. For example, to construct a command string "get-process | sort-object -descending" PSCommand command = new PSCommand("get-process"). AddCommand("sort-object").AddParameter("descending"); Name of the parameter. A PSCommand instance with added to the parameter list of the last command. This method is not thread safe. Name is non null and name length is zero after trimming whitespace. Powershell instance cannot be changed in its current state. Adds an argument to the last added command. For example, to construct a command string "get-process | select-object name" PSCommand command = new PSCommand("get-process"). AddCommand("select-object").AddParameter("name"); This will add the value "name" to the positional parameter list of "select-object" cmdlet. When the command is invoked, this value will get bound to positional parameter 0 of the "select-object" cmdlet which is "Property". Value for the parameter. A PSCommand instance parameter value added to the parameter list of the last command. Powershell instance cannot be changed in its current state. This method is not thread safe. Adds an additional statement for execution For example, Runspace rs = RunspaceFactory.CreateRunspace(); PowerShell ps = PowerShell.Create(); ps.Runspace = rs; ps.AddCommand("Get-Process").AddArgument("idle"); ps.AddStatement().AddCommand("Get-Service").AddArgument("audiosrv"); ps.Invoke(); A PowerShell instance with the items in added to the parameter list of the last command. Clears the command(s). Creates a shallow copy of the current PSCommand. A shallow copy of the current PSCommand Initializes the instance. Called from the constructor. Command to initialize the instance with. true if the is script, false otherwise. if true local scope is used to run the script command. Caller should check the input. command is null Gets the collection of commands from this PSCommand instance. The PowerShell instance this PSCommand is associated to, or null if it is an standalone command Event arguments passed to PSDataCollection DataAdded handlers. Constructor PowerShell InstanceId which added this data. Guid.Empty, if the data is not added by a PowerShell instance. Index at which the data is added. Index at which the data is added. PowerShell InstanceId which added this data. Guid.Empty, if the data is not added by a PowerShell instance. Event arguments passed to PSDataCollection DataAdding handlers. Constructor PowerShell InstanceId which added this data. Guid.Empty, if the data is not added by a PowerShell instance. The actual item about to be added. The item about to be added. PowerShell InstanceId which added this data. Guid.Empty, if the data is not added by a PowerShell instance. build Thread Safe buffer used with PowerShell Hosting interfaces. Whether the enumerator needs to be blocking by default whether the ref count was incremented when BlockingEnumerator was updated Default Constructor Creates a PSDataCollection that includes all the items in the IEnumerable and invokes Complete(). Items used to initialize the collection This constructor is useful when the user wants to use an IEnumerable as an input to one of the PowerShell.BeginInvoke overloads. The invocation doesn't complete until Complete() is called on the PSDataCollection; this constructor does the Complete() on behalf of the user. Initializes a new instance with the specified capacity The number of elements that the new buffer can initially store. Capacity is the number of elements that the PSDataCollection can store before resizing is required. Wrap the argument in a PSDataCollection The value to convert New collection of value, marked as Complete Wrap the argument in a PSDataCollection The value to convert New collection of value, marked as Complete Wrap the argument in a PSDataCollection The value to convert New collection of value, marked as Complete Wrap the argument in a PSDataCollection The value to convert New collection of value, marked as Complete Wrap the argument in a PSDataCollection The value to convert New collection of value, marked as Complete Wrap the argument in a PSDataCollection The value to convert New collection of value, marked as Complete Wrap the argument in a PSDataCollection The value to convert New collection of value, marked as Complete Construct the DataBuffer using the supplied as the data buffer. buffer wherer the elements are stored Using this constructor will make the data buffer a wrapper on top of the , which provides synchronized access. Creates a PSDataCollection from an ISerializable context Serialization information for this instance The streaming context for this instance Completes insertions to the buffer. Subsequent Inserts to the buffer will result in an InvalidOperationException Determines the index of a specific item in the buffer. The object to locate in the buffer. The index of item if found in the buffer; otherwise, -1. Inserts an item to the buffer at the specified index. The zero-based index at which item should be inserted. The object to insert into the buffer. Objects cannot be added to a closed buffer. Make sure the buffer is open for Add and Insert operations to succeed. The index specified is less than zero or greater than Count. Removes the item at the specified index. The zero-based index of the item to remove. index is not a valid index in the buffer. Adds an item to the thread-safe buffer item to add Objects cannot be added to a closed buffer. Make sure the buffer is open for Add and Insert operations to succeed. Removes all items from the buffer Determines whether the buffer contains an element with a specific value. The object to locate in the buffer. true if the element value is found in the buffer; otherwise false. Copies the elements of the buffer to a specified array, starting at a particular index. The destination Array for the elements of type T copied from the buffer. The zero-based index in the array at which copying begins. array is multidimensional. (or) arrayIndex is equal to or greater than the length of array. (or) The number of elements in the source buffer is greater than the available space from arrayIndex to the end of the destination array. (or) Type T cannot be cast automatically to the type of the destination array. array is a null reference arrayIndex is less than 0. Removes the first occurrence of a specified item from the buffer. The object to remove from the buffer. true if item was successfully removed from the buffer; otherwise, false. Returns an enumerator that iterates through the elements of the buffer. An IEnumerator for objects of the type stored in the buffer. Adds an element to the buffer. The object to add to the buffer. The position into which the new element was inserted. Objects cannot be added to a closed buffer. Make sure the buffer is open for Add and Insert operations to succeed. value reference is null. (or) value is not of the correct generic type T for the buffer. Determines whether the collection contains an element with a specific value. The object to locate in the collection true if the element value is found in the collection; otherwise false. value reference is null. (or) value is not of the correct generic type T for the buffer. Determines the zero-based index of an element in the buffer. The element in the buffer whose index is being determined. The index of the value if found in the buffer; otherwise, -1. value reference is null. (or) value is not of the correct generic type T for the buffer. Inserts an object into the buffer at a specified index. The zero-based index at which value is to be inserted. The object to insert into the buffer. index is not a valid index in the buffer. value reference is null. (or) value is not of the correct generic type T for the buffer. Removes the first occurrence of a specified object as an element from the buffer. The object to be removed from the buffer. value reference is null. (or) value is not of the correct generic type T for the buffer. Copies the elements of the collection to a specified array, starting at a particular index. The destination Array for the elements of type T copied from the buffer. The zero-based index in the array at which copying begins. array is multidimensional. (or) arrayIndex is equal to or greater than the length of array. (or) The number of elements in the source buffer is greater than the available space from arrayIndex to the end of the destination array. array is a null reference arrayIndex is less than 0. Returns an enumerator that iterates through the buffer. An IEnumerator for objects of the type stored in the buffer. Makes a shallow copy of all the elements currently in this collection and clears them from this collection. This will not result in a blocking call. Calling this method might have side effects on the enumerator. When this method is called, the behavior of the enumerator is not defined. A new collection with a copy of all the elements in the current collection. Makes a shallow copy of all the elements currently in this collection and clears them from this collection. This will not result in a blocking call. Calling this method might have side effects on the enumerator. When this method is called, the behavior of the enumerator is not defined. A new collection with a copy of all the elements in the current collection. maximum number of elements to read Inserts an item into the buffer at a specified index. InstanceId of PowerShell instance adding this data. Guid.Empty if not initiated by a PowerShell instance. The zero-based index of the buffer where the object is to be inserted The object to be inserted into the buffer. The index specified is less than zero or greater than Count. Removes the item at a specified index The zero-based index of the buffer where the object is to be removed. The index specified is less than zero or greater than the number of items in the buffer. Implements the ISerializable contract for serializing a PSDataCollection Serialization information for this instance The streaming context for this instance Utility method to signal handles and raise events in the consistent order. PowerShell InstanceId which added this data. Guid.Empty, if the data is not added by a PowerShell instance. Index at which the data is added. Inserts an item into the buffer at a specified index. The caller should make sure the method call is synchronized. InstanceId of PowerShell instance adding this data. Guid.Empty if this is not initiated by a PowerShell instance. The zero-based index of the buffer where the object is to be inserted. The object to be inserted into the buffer. Objects cannot be added to a closed buffer. Make sure the buffer is open for Add and Insert operations to succeed. The index specified is less than zero or greater than Count. Adds an item to the thread-safe buffer InstanceId of PowerShell instance adding this data. Guid.Empty if this is not initiated by a PowerShell instance. item to add Objects cannot be added to a closed buffer. Make sure the buffer is open for Add and Insert operations to succeed. Adds the elements of an ICollection to the end of the buffer. InstanceId of PowerShell instance adding this data. The ICollection whose elements should be added to the end of the buffer. is null. value is not of the correct generic type T for the buffer. Increment counter to keep track of active PowerShell instances using this buffer. This is used only internally. Decrement counter to keep track of active PowerShell instances using this buffer. This is used only internally. Returns the index of first occurece of in the buffer. This method is not thread safe. The object to locate in the buffer. 0 based index of item if found, -1 otherwise. Checks if the is of type T. Value to verify. value reference is null. (or) value is not of the correct generic type T for the buffer. Checks if the elements is of type T. Value to verify. value is not of the correct generic type T for the buffer. Fires an idle event Pulses the collection Public dispose method Release all the resources if true, release all managed resources Event fired when objects are being added to the underlying buffer. Event fired when objects are done being added to the underlying buffer Event fired when the buffer is completed. A boolean which determines if the buffer is open. An int that tells the frequency of Data Added events fired. Raises the DataAdded event only when data has been added a multiple of this many times, or when collection can receive no more data, if further data is added past the last event prior to completion. Serializes all input by default. This is supported only for PSDataCollections of PSObject. Determines whether this PSDataCollection was created implicitly in support of data collection (for example, a workflow that wants to capture output but hasn't provided an instance of the PSDataCollection to capture it with.) Internal tag for indicating a source object identifier for this collection. If this flag is set to true, the items in the collection will be set to null when it is traversed using a PSDataCollectionEnumerator This flag is true when the collection has been enumerated at least once by a PSDataCollectionEnumerator Indicates whether the data collection should have a blocking enumerator by default. Currently only when a PowerShell object is associated with the data collection, a reference count is added which causes the enumerator to be blocking. This prevents the use of PSDataCollection without a PowerShell object. This property fixes the same If this is set to true, then the enumerator returned from GetEnumerator() will never block. Gets or sets the element at the specified index. The zero-based index of the element to get or set. Objects cannot be added to a closed buffer. Make sure the buffer is open for Add and Insert operations to succeed. index is less than 0. (or) index is equal to or greater than Count. Gets the number of elements contained in the buffer Gets a value indicating whether the buffer is read-only. Gets a value that indicates whether the buffer is fixed in size. Gets a value that indicates whether the buffer is read-only. Gets or sets the element at the specified index. The zero-based index of the element to get or set. index is less than 0. (or) index is equal to or greater than Count. value reference is null. (or) value is not of the correct generic type T for the buffer. Gets a value that indicates whether the buffer is synchronized. Gets the object used to synchronize access to the thread-safe buffer Waitable handle for caller's to block until new data is added to the underlying buffer Sync object for this collection Reference count variable Indicates whether or not the collection should pulse idle events Interface to support PSDataCollectionEnumerator. Needed to provide a way to get to the non-blocking MoveNext implementation. Enumerator for PSDataCollection. This enumerator blocks until either all the PowerShell operations are compeleted or the PSDataCollection is closed. Constructor PSDataCollection to enumerate. Controls if the enumerator is blocking by default or not. Advances the enumerator to the next element in the collection. true if the enumerator successfully advanced to the next element; otherwise, false. This will block if the original collection is attached to any active PowerShell instances and the original collection is not closed. Advances the enumerator to the next element in the collection. true if the enumerator successfully advanced to the next element; otherwise, false. true - to block when no elements are available Resets the enumerator to its initial position, which is before the first element in the collection. Gets the element in the collection at the current position of the enumerator. For better performance, this property does not throw an exception if the enumerator is positioned before the first element or after the last element; the value of the property is undefined. Gets the element in the collection at the current position of the enumerator. For better performance, this property does not throw an exception if the enumerator is positioned before the first element or after the last element; the value of the property is undefined. Class that represents various informational buffers like verbose, debug, warning, progress used with command invocation. Default constructor. Guid of Powershell instance creating this buffers. Whenver an item is added to one of the buffers, this id is used to notify the buffer about the PowerShell instance adding this data. Adds item to the progress buffer. The item is added to the buffer along with PowerShell InstanceId. Adds item to the verbose buffer. The item is added to the buffer along with PowerShell InstanceId. Adds item to the debug buffer. The item is added to the buffer along with PowerShell InstanceId. Adds item to the warning buffer. The item is added to the buffer along with PowerShell InstanceId. A buffer representing Progress record objects of a PowerShell command invocation. Can be null. A buffer representing Verbose objects of a PowerShell command invocation. Can be null. A buffer representing Debug objects of a PowerShell command invocation. Can be null. A buffer representing Warning objects of a PowerShell command invocation. Can be null. Base class for items in the PSInformationalBuffers. A PSInformationalRecord consists of a string Message and the InvocationInfo and pipeline state corresponding to the command that created the record. This class can be instantiated only by its derived classes Creates an InformationalRecord object from a record serialized as a PSObject by ToPSObjectForRemoting. Sets the InvocationInfo (and PipelineIterationInfo) for this record Returns the record's message Adds the information about this informational record to a PSObject as note properties. The PSObject is used to serialize the record during remote operations. The message written by the command that created this record The InvocationInfo of the command that created this record The InvocationInfo can be null if the record was not created by a command. The status of the pipeline when this record was created. The PipelineIterationInfo can be null if the record was not created by a command. Whether to serialize the InvocationInfo and PipelineIterationInfo during remote calls A warning record in the PSInformationalBuffers. Constructor for Fully qualified warning Id. Fully qualified warning Id Warning message Constructor for Fully qualified warning Id. Fully qualified warning Id Warning serialized object String which uniquely identifies this warning condition. A debug record in the PSInformationalBuffers. A verbose record in the PSInformationalBuffers. Defines a class which allows simple execution of commands from CLR languages Runspace on which commands are invoked Create a RunspaceInvoke for invoking commands. This uses a runspace with default PSSnapins. Creates a RunspaceInvoke for invoking commands. Underlying Runspace is created using specified RunspaceConfiguration RunspaceConfiguration used for creating the runspace Thrown when runspaceConfiguration is null Creates a RunspaceInvoke for invoking commands. Underlying Runspace is created using the specified console file. Console file used for creating the underlying runspace. Thrown when consoleFilePath is null Thrown when errors occurs in loading one or more PSSnapins. Create RunspaceInvoke for invoking command in specified runspace. Runspace must be opened state Invoke the specified script msh script to invoke Output of invocation Invoke the specified script and passes specified input to the script msh script to invoke input to script Output of invocation Invoke the specified script and passes specified input to the script. msh script to invoke input to script this gets errors from script output of invocation is the non-terminating error stream from the command. In this release, the objects read from this PipelineReader are PSObjects wrapping ErrorRecords. Set to true when object is disposed Dispose underlying Runspace Protected dispose which can be overridden by derived classes. Exception thrown when state of the runspace pool is different from expected state of runspace pool. Creates a new instance of InvalidRunspacePoolStateException class. Creates a new instance of InvalidRunspacePoolStateException class. The error message that explains the reason for the exception. Creates a new instance of InvalidRunspacePoolStateException class. The error message that explains the reason for the exception. The exception that is the cause of the current exception. Initializes a new instance of the InvalidRunspacePoolStateException with a specified error message and current and expected state. The message that describes the error. Current state of runspace pool. Expected state of the runspace pool. Initializes a new instance of the InvalidRunspacePoolStateException class with serialized data. The that holds the serialized object data about the exception being thrown. The that contains contextual information about the source or destination. Converts the current to an InvalidRunspaceStateException Converts a RunspacePoolState to a RunspaceState State of the runspace pool when exception was thrown. State of the runspace pool expected in method which throws this exception. Access CurrentState of the runspace pool. This is the state of the runspace pool when exception was thrown. Expected state of runspace pool by the operation which has thrown this exception. Defines various states of a runspace pool. Beginning state upon creation A RunspacePool is being created. The RunspacePool is created and valid. The RunspacePool is closed. The RunspacePool is being closed The RunspacePool has been disconnected abnormally. The RunspacePool is being disconnected The RunspacePool has been disconnected The RunspacePool is being connected Event arguments passed to runspacepool state change handlers event. Constructor state to raise the event with. Gets the stateinfo of RunspacePool when this event occurred. Event arguments passed to RunspaceCreated event of RunspacePool. Defines runspace pool availability. RunspacePool is not in the Opened state. RunspacePool is Opened and available to accept commands. RunspacePool on the server is connected to another client and is not available to this client for connection or running commands. Defines runspace capabilities. No additional capabilites beyond a default runspace. Runspacepool and remoting layer supports disconnect/connect feature. Encapsulated the AsyncResult for pool's Open/Close async operations Constructor Instace Id of the pool creating this instance Callback to call when the async operation completes. A user supplied state to call the "callback" with. true if AsyncResult monitors Async Open. false otherwise true if AsyncResult monitors Async Open. false otherwise Encapsulated the results of a RunspacePool.BeginGetRunspace method Constructor Instace Id of the pool creating this instance Callback to call when the async operation completes. A user supplied state to call the "callback" with. Marks the async operation as completed and releases waiting threads. This is not used This method is called from a thread pool thread to release the async operation. Gets the runspace that is assigned to the async operation. This can be null if the async Get operation is not completed. Gets or sets a value indicating whether this operation is active or not. Public interface which supports pooling PowerShell Runspaces. Constructor which creates a RunspacePool using the supplied , and The minimum number of Runspaces that can exist in this pool. Should be greater than or equal to 1. The maximum number of Runspaces that can exist in this pool. Should be greater than or equal to 1. RunspaceConfiguration to use when creating a new Runspace. The explicit PSHost implementation. RunspaceConfiguration is null. Host is null. Maximum runspaces is less than 1. Minimum runspaces is less than 1. Constructor which creates a RunspacePool using the supplied , and The minimum number of Runspaces that can exist in this pool. Should be greater than or equal to 1. The maximum number of Runspaces that can exist in this pool. Should be greater than or equal to 1. InitialSessionState object to use when creating a new Runspace. The explicit PSHost implementation. initialSessionState is null. Host is null. Maximum runspaces is less than 1. Minimum runspaces is less than 1. Construct a runspace pool object. Min runspaces. Max runspaces. TypeTable. Host. App arguments. Connection information. Session name. Creates a runspace pool object in a disconnected state that is ready to connect to a remote runspace pool session specified by the instanceId parameter. Indicates whether the shell/runspace pool is disconnected. Identifies a remote runspace pool session to connect to. Friendly name for runspace pool. Runspace pool running commands information. Connection information of remote server. PSHost object. TypeTable used for serialization/deserialization of remote objects. Handle internal Pool state changed events. Pass thru of the ForwardEvent event from the internal pool Raises the ForwardEvent event Handle internal Pool RunspaceCreated events. Queries the server for disconnected runspace pools and creates an array of runspace pool objects associated with each disconnected runspace pool on the server. Each runspace pool object in the returned array is in the Disconnected state and can be connected to the server by calling the Connect() method on the runspace pool. Connection object for the target server. Array of RunspacePool objects each in the Disconnected state. Queries the server for disconnected runspace pools and creates an array of runspace pool objects associated with each disconnected runspace pool on the server. Each runspace pool object in the returned array is in the Disconnected state and can be connected to the server by calling the Connect() method on the runspace pool. Connection object for the target server. Client host object. Array of RunspacePool objects each in the Disconnected state. Queries the server for disconnected runspace pools and creates an array of runspace pool objects associated with each disconnected runspace pool on the server. Each runspace pool object in the returned array is in the Disconnected state and can be connected to the server by calling the Connect() method on the runspace pool. Connection object for the target server. Client host object. TypeTable object. Array of RunspacePool objects each in the Disconnected state. Disconnects the runspace pool synchronously. Runspace pool must be in Opened state. Disconnects the runspace pool asynchronously. Runspace pool must be in Opened state. An AsyncCallback to call once the BeginClose completes. A user supplied state to call the callback with. Waits for the pending asynchronous BeginDisconnect to complete. Asynchronous call result object. Connects the runspace pool synchronously. Runspace pool must be in disconnected state. Connects the runspace pool asynchronously. Runspace pool must be in disconnected state. Waits for the pending asynchronous BeginConnect to complete. Asynchronous call result object. Creates an array of PowerShell objects that are in the Disconnected state for all currently disconnected running commands associated with this runspace pool. Returns RunspacePool capabilities. RunspacePoolCapability Sets the maximum number of Runspaces that can be active concurrently in the pool. All requests above that number remain queued until runspaces become available. The maximum number of runspaces in the pool. true if the change is successful; otherwise, false. You cannot set the number of runspaces to a number smaller than the minimum runspaces. Retrieves the maximum number of runspaces the pool maintains. The maximum number of runspaces in the pool Sets the minimum number of Runspaces that the pool maintains in anticipation of new requests. The minimum number of runspaces in the pool. true if the change is successful; otherwise, false. You cannot set the number of idle runspaces to a number smaller than 1 or greater than maximum number of active runspaces. Retrieves the minimum number of runspaces the pool maintains. The minimum number of runspaces in the pool Retrieves the number of runspaces available at the time of calling this method. The number of available runspace in the pool. Opens the runspacepool synchronously. RunspacePool must be opened before it can be used. RunspacePoolState is not BeforeOpen Opens the RunspacePool asynchronously. RunspacePool must be opened before it can be used. To get the exceptions that might have occurred, call EndOpen. A AsyncCallback to call once the BeginOpen completes. A user supplied state to call the with. An AsyncResult object to monitor the state of the async operation. Waits for the pending asynchronous BeginOpen to complete. asyncResult is a null reference. asyncResult object was not created by calling BeginOpen on this runspacepool instance. RunspacePoolState is not BeforeOpen. TODO: Behavior if EndOpen is called multiple times. Closes the RunspacePool and cleans all the internal resources. This will close all the runspaces in the runspacepool and release all the async operations waiting for a runspace. If the pool is already closed or broken or closing this will just return. Cannot close the RunspacePool because RunspacePool is in Closing state. Closes the RunspacePool asynchronously and cleans all the internal resources. This will close all the runspaces in the runspacepool and release all the async operations waiting for a runspace. If the pool is already closed or broken or closing this will just return. A AsyncCallback to call once the BeginClose completes. A user supplied state to call the with. An AsyncResult object to monitor the state of the async operation. Waits for the pending asynchronous BeginClose to complete. asyncResult is a null reference. asyncResult object was not created by calling BeginClose on this runspacepool instance. Dispose the current runspacepool. Private data to be used by applications built on top of PowerShell. Local runspace pool is created with application private data set to an empty . Remote runspace pool gets its application private data from the server (when creating the remote runspace pool) Calling this method on a remote runspace pool will block until the data is received from the server. The server will send application private data before reaching state. Runspaces that are part of a inherit application private data from the pool. Gets Runspace asynchronously from the runspace pool. The caller will get notified with the runspace using A AsyncCallback to call once the runspace is available. A user supplied state to call the with. An IAsyncResult object to track the status of the Async operation. Cancels the pending asynchronous BeginGetRunspace operation. Waits for the pending asynchronous BegineGetRunspace to complete. asyncResult is a null reference. asyncResult object was not created by calling BeginGetRunspace on this runspacepool instance. RunspacePoolState is not BeforeOpen. Releases a Runspace to the pool. If pool is closed, this will be a no-op. Runspace to release to the pool. is null. Cannot release the runspace to this pool as the runspace doesn't belong to this pool. Only opened runspaces can be released back to the pool. Get unqiue id for this instance of runspace pool. It is primarily used for logging purposes. Gets a boolean which describes if the runspace pool is disposed. Gets State of the current runpsace pool. Gets the InitialSessionState object that this pool uses to create the runspaces. Connection information for remote RunspacePools, null for local RunspacePools Specifies how often unused runspaces are disposed. Returns runspace pool availability. Event raised when RunspacePoolState changes. Event raised when one of the runspaces in the pool forwards an event to this instance Event rasied when a new Runspace is created by the pool. This property determines whether a new thread is created for each invocation Any updates to the value of this property must be done before the RunspacePool is opened An attempt to change this property was made after opening the RunspacePool ApartmentState of the thread used to execute commands within this RunspacePool Any updates to the value of this property must be done before the RunspacePool is opened An attempt to change this property was made after opening the RunspacePool Indicates whether the RunspacePool is a remote one RemoteRunspacePoolInternal associated with this runspace pool Class which supports pooling local powerShell runspaces. Constructor which creates a RunspacePool using the supplied , and RunspaceConfiguration to use when creating a new Runspace. The maximum number of Runspaces that can exist in this pool. Should be greater than or equal to 1. The minimum number of Runspaces that can exist in this pool. Should be greater than or equal to 1. The explicit PSHost implementation. RunspaceConfiguration is null. Host is null. Maximum runspaces is less than 1. Minimum runspaces is less than 1. Constructor which creates a RunspacePool using the supplied , and InitialSessionState to use when creating a new Runspace. The maximum number of Runspaces that can exist in this pool. Should be greater than or equal to 1. The minimum number of Runspaces that can exist in this pool. Should be greater than or equal to 1. The explicit PSHost implementation. initialSessionState is null. Host is null. Maximum runspaces is less than 1. Minimum runspaces is less than 1. Constructor for doing common initialization between this class and its derivatives The maximum number of Runspaces that can exist in this pool. Should be greater than or equal to 1. The minimum number of Runspaces that can exist in this pool. Should be greater than or equal to 1. default constructor Private data to be used by applications built on top of PowerShell. Local runspace pool is created with application private data set to an empty . Synchronously disconnect runspace pool. Asynchronously disconnect runspace pool. Wait for BeginDisconnect to complete. Synchronously connect runspace pool. Asynchronously connect runspace pool. Wait for BeginConnect to complete. Creates an array of PowerShell objects that are in the Disconnected state for all currently disconnected running commands associated with this runspace pool. Returns RunspacePool capabilities. RunspacePoolCapability Sets the maximum number of Runspaces that can be active concurrently in the pool. All requests above that number remain queued until runspaces become available. The maximum number of runspaces in the pool. true if the change is successful; otherwise, false. You cannot set the number of runspaces to a number smaller than the minimum runspaces. Retrieves the maximum number of runspaces the pool maintains. The maximum number of runspaces in the pool Sets the minimum number of Runspaces that the pool maintains in anticipation of new requests. The minimum number of runspaces in the pool. true if the change is successful; otherwise, false. You cannot set the number of idle runspaces to a number smaller than 1 or greater than maximum number of active runspaces. Retrieves the minimum number of runspaces the pool maintains. The minimum number of runspaces in the pool Retrieves the number of runspaces available at the time of calling this method. If the RunspacePool failed or has been closed The number of available runspace in the pool. Opens the runspacepool synchronously. RunspacePool must be opened before it can be used. RunspacePoolState is not BeforeOpen Opens the RunspacePool asynchronously. RunspacePool must be opened before it can be used. To get the exceptions that might have occurred, call EndOpen. A AsyncCallback to call once the BeginOpen completes. A user supplied state to call the with. An AsyncResult object to monitor the state of the async operation. Waits for the pending asynchronous BeginOpen to complete. asyncResult is a null reference. asyncResult object was not created by calling BeginOpen on this runspacepool instance. RunspacePoolState is not BeforeOpen. TODO: Behavior if EndOpen is called multiple times. Closes the RunspacePool and cleans all the internal resources. This will close all the runspaces in the runspacepool and release all the async operations waiting for a runspace. If the pool is already closed or broken or closing this will just return. Closes the RunspacePool asynchronously and cleans all the internal resources. This will close all the runspaces in the runspacepool and release all the async operations waiting for a runspace. If the pool is already closed or broken or closing this will just return. A AsyncCallback to call once the BeginClose completes. A user supplied state to call the with. An AsyncResult object to monitor the state of the async operation. Waits for the pending asynchronous BeginClose to complete. asyncResult object was not created by calling BeginClose on this runspacepool instance. TODO: Behavior if EndClose is called multiple times. Gets a Runspace from the pool. If no free runspace is available and if max pool size is not reached, a new runspace is created. Otherwise this will block a runspace is released and available. An opened Runspace. Cannot perform operation because RunspacePool is not in the opened state. Releases a Runspace to the pool. If pool is closed, this will be a no-op. Runspace to release to the pool. is null. Runspool is not in Opened state. Cannot release the runspace to this pool as the runspace doesn't belong to this pool. Dispose off the current runspace pool true to release all the internal resources. Gets Runspace asynchronously from the runspace pool. The caller will get notified with the runspace using A AsyncCallback to call once the runspace is available. A user supplied state to call the with. An IAsyncResult object to track the status of the Async operation. Cancels the pending asynchronous BeginGetRunspace operation. Waits for the pending asynchronous BegineGetRunspace to complete. asyncResult is a null reference. asyncResult object was not created by calling BeginGetRunspace on this runspacepool instance. RunspacePoolState is not BeforeOpen. TODO: Behavior if EndGetRunspace is called multiple times. Opens the runspacepool synchronously / asynchronously. Runspace pool must be opened before it can be used. true to open asynchronously A AsyncCallback to call once the BeginOpen completes. A user supplied state to call the with. asyncResult object to monitor status of the async open operation. This is returned only if is true. Cannot open RunspacePool because RunspacePool is not in the BeforeOpen state. There is not enough memory available to start this asynchronously. Creates a Runspace + opens it synchronously and pushes it into the stack. Caller to make sure this is thread safe. Starting point for asynchronous thread asyncResult object Closes the runspacepool synchronously / asynchronously. true to close asynchronously A AsyncCallback to call once the BeginClose completes. A user supplied state to call the with. asyncResult object to monitor status of the async open operation. This is returned only if is true. Raise state changed event based on the StateInfo object state information object Checks if the Pool is open to honour requests. If not throws an exception. Cannot perform operation because RunspacePool is not in the opened state. Creates a new Runspace and initializes it by calling Open() An opened Runspace. TODO: Exceptions thrown here need to be documented. Cleans/Closes the runspace Runspace to be closed/cleaned Cleans the pool closing the runspaces that are idle. This method is called as part of a timer callback. This method will make sure atleast minPoolSz number of Runspaces are active. Close all the runspaces in the pool If is not null, enqueues the request. Checks if a thread pool thread is queued to service pending requests for runspace. If a thread is not queued, queues one. Used by calling threads to queue a request before checking and starting servicing thread. uses calling thread to assign available runspaces (if any) to runspace requesters. Releases any readers in the reader queue waiting for Runspace. This is of type object..because this method is called from a ThreadPool Thread. true, if calling thread should be used to assign a runspace. Throws an exception if the runspace state is not BeforeOpen Raises the ForwardEvent event Forward runspace events to the pool's event queue Get unqiue id for this instance of runspace pool. It is primarily used for logging purposes. Gets a boolean which describes if the runspace pool is disposed. Gets State of the current runpsace pool. Gets the RunspaceConfiguration object that this pool uses to create the runspaces. Gets the InitialSessionState object that this pool uses to create the runspaces. the connection associated with this runspace pool Specifies how often unused runspaces are disposed. Returns runspace pool availability. Event raised when RunspacePoolState changes. Event raised when one of the runspaces in the pool forwards an event to this instance Event rasied when a new Runspace is created by the pool. The value of this property is propagated to all the Runspaces in this pool; it determines whether a new thread is create when a pipeline is executed. Any updates to the value of this property must be done before the RunspacePool is opened The value of this property is propagated to all the Runspaces in this pool Any updates to the value of this property must be done before the RunspacePool is opened Gets a value indicating whether the associated process has been terminated. true if the operating system process referenced by the Process component has terminated; otherwise, false. Implements utility methods that might be used by Hosts. Gets a PSObject whose base object is currentUserCurrentHost and with notes for the other 4 parameters. The profile file name for all users and all hosts. The profile file name for all users and current host. The profile file name for cuurrent user and all hosts. The profile name for cuurrent user and current host. A PSObject whose base object is currentUserCurrentHost and with notes for the other 4 parameters. Gets an array of commands that can be run sequentially to set $profile and run the profile commands. The id identifying the host or shell used in profile file names. Gets the object that serves as a value to $profile and the paths on it The id identifying the host or shell used in profile file names. used from test not to overwrite the profile file names from development boxes path for all users and all hosts path for current user and all hosts path for all users current host path for current user and current host the object that serves as a value to $profile Gets an array of commands that can be run sequentially to set $profile and run the profile commands. The id identifying the host or shell used in profile file names. used from test not to overwrite the profile file names from development boxes Used to get all profile file names for the current or all hosts and for the current or all users. null for all hosts, not null for the specified host false for all users, true for the current user. The profile file name matching the parameters. Used to get all profile file names for the current or all hosts and for the current or all users. null for all hosts, not null for the specified host false for all users, true for the current user. used from test not to overwrite the profile file names from development boxes The profile file name matching the parameters. Used internally in GetFullProfileFileName to get the base path for all users profiles. The shellId to use. the base path for all users profiles. Gets the first lines of . string we want to limit the number of lines maximum number of lines to be returned The first lines of . Remove the GUID from the message if the message is in the pre-defined format Returns the prompt used in remote sessions: "[machine]: basePrompt" Class used to hold the output of the DebuggerCommandProcessor If ResumeAction is not null it indicates that the host must exit the debugger and resume execution of the suspended pipeline; the debugger will use the value of this property to decide how to resume the pipeline (i.e. step into, step-over, continue, etc) When ResumeAction is null, this property indicates the command that the host should pass to the PowerShell engine If true, the host should repeat this command if the next command in an empty line (enter) If true, the command was executed by the debugger and the host should ignore the command This class is used to pre-process the command read by the host when it is in debug mode; its main intention is to implement the debugger commands ("s", "c", "o", etc) Creates the table of debugger commands Resets any state in the command processor Process the command read by the host and returns the DebuggerResumeAction or the command that the host should execute (see comments in the DebuggerCommand class above). Helper for ProcessCommand Displays the help text for the debugger commands Executes the list command Executes the list command Custom culture Constructs a CultureInfo that keeps track of fallbacks Name of the culture to construct. ordered,null-delimited list of fallbacks Clones the custom CultureInfo retaining the fallbacks. Cloned custom CultureInfo Returns Parent culture for the current CultureInfo. If Parent.Name is null or empty, then chooses the immediate fallback If it is not empty, otherwise just returns Parent. This is called to create the parent culture (as defined by CLR) of the current culture. Static wrappers to get User chosen UICulture (for Vista and later) Constructs CultureInfo object without considering any Vista and later custom culture fallback logic. A CultureInfo object Checks if the current operating system is Vista or later true, if vista and above false, otherwise. This method is called on vista and above. Using GetThreadPreferredUILanguages this method gets the UI languages a user has chosen. List of ThredPreferredUILanguages. This method will work only on Vista and later. Returns the locale identifier for the user default locale. This function can return data from custom locales. Locales are not guaranteed to be the same from computer to computer or between runs of an application. If your application must persist or transmit data, see Using Persistent Locale Data. Applications that are intended to run only on Windows Vista and later should use GetUserDefaultLocaleName in preference to this function. GetUserDefaultLocaleName provides good support for supplemental locales. However, GetUserDefaultLocaleName is not supported for versions of Windows prior to Windows Vista. Retrieves the user default locale name. Returns the size of the buffer containing the locale name, including the terminating null character, if successful. The function returns 0 if it does not succeed. To get extended error information, the applciation can call GetLastError. Possible returns from GetLastError include ERR_INSUFFICIENT_BUFFER. Gets the UICulture to be used by console host The RemoteHostMethodId enum. Stores information about remote host methods. By storing information in this data structure we only need to transport enums on the wire. Interface type. Name. Return type. Parameter types. Create a new instance of RemoteHostMethodInfo. Look up. Interface type. Name. Return type. Parameter types. This is queue of all the state change event which have occured for this pipeline. RaisePipelineStateEvents raises event for each item in this queue. We don't raise the event with in SetPipelineState because often SetPipelineState is called with in a lock. Raising event in lock introduces chances of deadlock in GUI applications. Is method executor stream enabled. Method executor stream. Private constructor that does most of the work constructing a remote pipeline object. RemoteRunspace object AddToHistory IsNested Constructs a remote pipeline for the specified runspace and specified command runspace in which to create the pipeline command as a string, to be used in pipeline creation whether to add the command to the runspaces history whether this pipeline is nested Constructs a remote pipeline object associated with a remote running command but in a disconnected state. Remote runspace associated with running command. Creates a cloned pipeline from the specified one pipeline to clone from This constructor is private because this will only be called from the copy method override for creating a copy of pipeline Pipeline object which is copy of this pipeline This internal method doesn't do the _disposed check. internal method to set the value of IsNested. This is called by serializer internal method to set the value of IsSteppable. This is called during DoConcurrentCheck Invoke the pipeline asynchronously Results are returned through the reader. Invokes a remote command and immediately disconnects if transport layer supports it. Invoke the pipeline, synchronously, returning the results as an array of objects. an array of input objects to pass to the pipeline. Array may be empty but may not be null An array of zero or more result objects Caller of synchronous exectute should not close input objectWriter. Synchronous invoke will always close the input objectWriter. On Synchronous Invoke if output is throttled and no one is reading from output pipe, Execution will block after buffer is full. Connects synchronously to a running command on a remote server. The pipeline object must be in the disconnected state. A collection of result objects. Connects asynchronously to a running command on a remote server. Stop the pipeline synchronously Stop the pipeline asynchronously. This method calls the BeginStop on the underlying powershell and so any exception will be thrown on the same thread. Verifies if the pipeline is in a state where it can be stopped Disposes the pipeline true, when called on Dipose() Sets the new execution state. the new state An exception indicating that state change is the result of an error, otherwise; null. Sets the internal execution state information member variable. It also adds PipelineStateInfo to a queue. RaisePipelineStateEvents raises event for each item in this queue. Raises events for changes in execution state. Initializes the underlying PowerShell object after verifying if the pipeline is in a state where it can be invoked. If invokeAndDisconnect is true then the remote PowerShell command will be immediately disconnected after it begins running. true if called from a sync call Invoke and Disconnect Initializes the underlying PowerShell object after verifying that it is in a state where it can connect to the remote command. Handle host call received sender of this event, unused arguments describing the host call to invoke Does the cleanup necessary on pipeline completion Check if anyother pipeline is executing. In case of nested pipeline, checks that it is called from currently executing pipeline's thread. True if method is called from Invoke, false if called from InvokeAsync 1) A pipeline is already executing. Pipeline cannot execute concurrently. 2) InvokeAsync is called on nested pipeline. Nested pipeline cannot be executed Asynchronously. 3) Attempt is made to invoke a nested pipeline directly. Nested pipeline must be invoked from a running pipeline. Sets the history string to the specified string new history string to set to Access the runspace this pipeline is created on. Is this pipeline nested Info about current state of the pipeline. This value indicates the state of the pipeline after the change. Access the input writer for this pipeline. Access the output reader for this pipeline. Access the error output reader for this pipeline. This is the non-terminating error stream from the command. In this release, the objects read from this PipelineReader are PSObjects wrapping ErrorRecords. String which is added in the history This needs to be internal so that it can be replaced by invoke-cmd to place correct string in history. Whether the pipeline needs to be added to history of the runspace Stream for providing input to PipelineProcessor. Host will write on ObjectWriter of this stream. PipelineProcessor will read from ObjectReader of this stream. Event raised when Pipeline's state changes. This is the thread on which NestedPipeline can be executed. In case of LocalPipeline, this is the thread of execution of LocalPipeline. In case of RemotePipeline, this is thread on which EnterNestedPrompt is called. RemotePipeline proxy should set it on at the begining of EnterNestedPrompt and clear it on return. ManualResetEvent which is signaled when pipeline execution is completed/failed/stoped. Is method executor stream enabled. Method executor stream. The underlying powershell object on which this remote pipeline is created Remote runspace which will be created on the client side. This runspace is wrapped on a RunspacePool(1). This is queue of all the state change event which have occured for this runspace. RaiseRunspaceStateEvents raises event for each item in this queue. We don't raise events from with SetRunspaceState because SetRunspaceState is often called from with in the a lock. Raising event with in a lock introduces chances of deadlock in GUI applications. In RemoteRunspace, it is required to invoke pipeline as part of open call (i.e. while state is Opening). If this property is true, runspace state check is not performed in AddToRunningPipelineList call. Construct a remote runspace based on the connection information and the specified host The TypeTable to use while deserializing/serializing remote objects. TypeTable has the following information used by serializer: 1. SerializationMethod 2. SerailizationDepth 3. SpecificSerializationProperties TypeTable has the following inforamtion used by deserializer: 1. TargetTypeForDeserializaiton 2. TypeConverter connection information which identifies the remote computer host on the client Friendly name for remote runspace session. Id for remote runspace. Application arguments the server can see in Constructs a RemoteRunspace object based on the passed in RunspacePool object, with a starting state of Disconnected. Helper function to set event handlers. Raises the AvailabilityChanged event Open the runspace Asynchronously. RunspaceState is not BeforeOpen Open the runspace synchronously. RunspaceState is not BeforeOpen Close the runspace Asynchronously. Close the runspace synchronously. Attempts to execute pipelines after a call to close will fail. Dispose this runspace true if called from Dispose Queries the server for disconnected runspaces and creates an array of runspace objects associated with each disconnected runspace on the server. Each runspace object in the returned array is in the Disconnected state and can be connected to the server by calling the Connect() method on the runspace. Connection object for the target server. Client host object. TypeTable object. Array of Runspace objects each in the Disconnected state. Disconnects the runspace synchronously. Disconnects the remote runspace and any running command from the server machine. Any data generated by the running command on the server is cached on the server machine. This runspace object goes to the disconnected state. This object can be reconnected to the server by calling the Connect() method. If the remote runspace on the server remains disconnected for the IdleTimeout value (as defined in the WSManConnectionInfo object) then it is closed and torn down on the server. RunspaceState is not Opened. Disconnects the runspace asynchronously. Disconnects the remote runspace and any running command from the server machine. Any data generated by the running command on the server is cached on the server machine. This runspace object goes to the disconnected state. This object can be reconnected to the server by calling the Connect() method. If the remote runspace on the server remains disconnected for the IdleTimeout value (as defined in the WSManConnectionInfo object) then it is closed and torn down on the server. RunspaceState is not Opened. Connects the runspace to its remote counterpart synchronously. Connects the runspace object to its corresponding runspace on the target server machine. The target server machine is identified by the connection object passed in during construction. The remote runspace is identified by the internal runspace Guid value. RunspaceState is not Disconnected. Connects a runspace to its remote counterpart asynchronously. Connects the runspace object to its corresponding runspace on the target server machine. The target server machine is identified by the connection object passed in during construction. The remote runspace is identified by the internal runspace Guid value. RunspaceState is not Disconnected. Creates a PipeLine object in the disconnected state for the currently disconnected remote running command associated with this runspace. Pipeline object in disconnected state. Creates a PowerShell object in the disconnected state for the currently disconnected remote running command associated with this runspace. PowerShell object in disconnected state. Returns Runspace capabilities. RunspaceCapability Update the pool disconnect options so that any changes will be passed to the server during the disconnect/connect operations. Create an empty pipeline An empty pipeline Createa a pipeline froma command string A valid command string A pipline pre-filled with Commands specified in commandString. command is null Create a pipeline from a command string. A valid command string if true command is added to history A pipline pre-filled with Commands specified in commandString. command is null Creates a nested pipeline. Nested pipelines are needed for nested prompt scenario. Nested prompt requires that we execute new pipelines( child pipelines) while current pipeline (lets call it parent pipeline) is blocked. Not supported in remoting scenarios Creates a nested pipeline. A valid command string if true command is added to history A pipline pre-filled with Commands specified in commandString. Not supported in remoting scenarios Add the pipeline to list of pipelines in execution. Pipeline to add to the list of pipelines in execution Thrown if the runspace is not in the Opened state. . Thrown if is null. Remove the pipeline from list of pipelines in execution. Pipeline to remove from the list of pipelines in execution Thrown if is null. Check to see, if there is any other pipeline running in this runspace. If not, then add this to the list of pipelines pipeline to check and add whether this is being called from a synchronous method call Returns SessionState proxy object. Asserts if the current state of the runspace is BeforeOpen Set the new runspace state. the new state An exception indicating the state change is the result of an error, otherwise; null. Sets the internal runspace state information member variable. It also adds RunspaceStateInfo to a queue. RaiseRunspaceStateEvents raises event for each item in this queue. Raises events for changes in runspace state. Creates a pipeline Waits till all the pipelines running in the runspace have finished execution. Gets the currently executing pipeline. Internal because it is needed by invoke-history Handles any host calls received from the server sender of this information, unused arguments describing this event, contains a RemoteHostCall object When the client remote session reports a URI redirection, this method will report the message to the user as a Warning using Host method calls. Forward the events from the runspace pool to the current instance The session has been successfully created. Determines if another Invoke-Command is executing in this runspace in the currently running local pipeline ahead on the specified invoke-command current invoke-command instance local pipeline id true, if another invoke-command is running before, false otherwise Keeps track of the current invoke command executing within the current local pipline reference to invoke command which is currently being processed the local pipeline id Clears the current invoke-command reference stored within this remote runspace Private data to be used by applications built on top of PowerShell. Remote runspace gets its application private data from the server (when creating the remote runspace pool) - calling this method on a remote runspace will block until the data is received from the server. Runspaces that are part of a inherit application private data from the pool. In RemoteRunspace, it is required to invoke pipeline as part of open call (i.e. while state is Opening). If this property is true, runspace state check is not performed in AddToRunningPipelineList call. Temporary place to remember whether to close this runspace on pop or not. Used by Start-PSSession. runspaceConfiguration information for this runspace initialsessionstate information for this runspace Manager for JobSourceAdapters registered in this runspace. Return version of this runspace Retrieve information about current state of the runspace This property determines whether a new thread is create for each invocation Any updates to the value of this property must be done before the Runspace is opened An attempt to change this property was made after opening the Runspace The thread options cannot be changed to the requested value Gets the current availability of the Runspace Event raised when RunspaceState changes. Event raised when the availability of the Runspace changes. Returns true if there are any subscribers to the AvailabilityChanged event Connection information to this runspace ConnectionInfo originally supplied by the user Gets the event manager Gets the execution context for this runspace Returns true if the internal host is in a nested prompt Gets the client remote session associated with this runspace This member is actually not required for the product code. However, there are existing transport manager tests which depend on the same. Once transport manager is modified, this needs to be removed Gets command information on a currently running remote command. If no command is running then null is returned. Gets/Sets the friendly name for the remote runspace (pool). Gets/Sets an integer Id value for this remote runspace object. Returns true if Runspace supports disconnect. Returns true if Runspace can be connected. The runspace pool that this remote runspace wraps EventHandler used to report connecion URI redirections to the application Set a variable in session state. The name of the item to set. The new value of the item being set. name is null Runspace is not open. Another SessionStateProxy call or another pipeline is in progress. Get a variable out of session state. name of variable to look up The value of the specified variable. name is null Runspace is not open. Another SessionStateProxy call or another pipeline is in progress. Get the list of applications out of session state. Runspace is not open. Another SessionStateProxy call or another pipeline is in progress. Get the list of scripts out of session state. Runspace is not open. Another SessionStateProxy call or another pipeline is in progress. Get the APIs to access drives out of session state Runspace is not open. Another SessionStateProxy call or another pipeline is in progress. Get/Set the language mode out of session state. Runspace is not open. Another SessionStateProxy call or another pipeline is in progress. Get the module info out of session state. Runspace is not open. Another SessionStateProxy call or another pipeline is in progress. Get the APIs to access paths and locations out of session state. Runspace is not open. Another SessionStateProxy call or another pipeline is in progress. Get the APIs to access a provider out of session state. Runspace is not open. Another SessionStateProxy call or another pipeline is in progress. Get the APIs to access variables out of session state. Runspace is not open. Another SessionStateProxy call or another pipeline is in progress. Get the APIs to build script blocks and execute script out of session state. Runspace is not open. Another SessionStateProxy call or another pipeline is in progress. Gets the instance of the provider interface APIs out of session state. Runspace is not open. Another SessionStateProxy call or another pipeline is in progress. This class is designed to contains the pertinent information about a Remote Connection, such as remote computer name, remote user name etc. It is also used to access remote connection capability and configuration information. Currently the session is identified by the InstanceId of the runspacePool associated with it This can change in future if we start supporting multiple runspacePools per session. Remote computer address in URI format. User credential to be used on the remote computer. Capability information for the client side. Capability information received from the server side. This is the shellName which indentifies the PowerShell configuration to launch on remote machine. This abstract class defines the client view of the remote connection. This abstract class is designed to provide InstandId and self identification for client and server remote session classes. This is the unique id of a remote session object. This indicates the remote session object is Client, Server or Listener. Client side user calls this function to create a new remote session. User needs to register event handler to ConnectionEstablished and ConnectionClosed to monitor the actual connection state. Close the connection to the remote computer in an asynchronous manner. Client side user can register an event handler with ConnectionClosed to minitor the connection state. Disconnects the remote session in an asynchronous manner Reconnects the remote session in an asynchronous manner Connects to an existing remote session User needs to register event handler to ConnectionEstablished and ConnectionClosed to monitor the actual connection state. Get the runspace pool with the matching id Id of the runspace to get This event handler is raised when the state of session changes ServerRemoteSessionDataStructureHandler instance for this session Protocol version negotiated by the server remote runspace pool if used, for this session Deleagate used to report connecion URI redirections to the application New URI to which the connection is being redirected to. Remote Session Implementation Creates a new instance of ClientRemoteSessionImpl The RunspacePool object this session should map to. Creates a Remote Session Asynchronously. Connects to a existing Remote Session Asynchronously by executing a Connect negotiation algorithm Closes Session Connection Asynchronously. Caller should register for ConnectionClosed event to get notified Temporaritly suspends connection to a connected remote session Restores connection to a disconnected remote session. Negotiation has already been performed before Handles changes in data structure handler state Event argument which contains the new state Start the key exchange process Complete the key exchange process Handles an encrypted session key received from the other side sender of this event arguments that contain the remote public key Handles a request for public key from the server send of this event, unused arguments describing this event, unused Examines the negotiation packet received from the server Verifies the negotiation packet received from the server Capablities of remote session The method returns true if the capability negotiation is successful. Otherwise, it returns false. 1. PowerShell client does not support the PSVersion {1} negotiated by the server. Make sure the server is compatible with the build {2} of PowerShell. 2. PowerShell client does not support the SerializationVersion {1} negotiated by the server. Make sure the server is compatible with the build {2} of PowerShell. Public method for dispose Release all resources if true, release all managed resources This event handler is raised when the state of session changes Enumeration for job status values. Indicates the status of the result object Execution of command in job not started execution of command in progress execution of command completed in all computernames/runspaces An error was encountered when trying to executed command in one or more computernames/runspaces Command execution is cancelled (stopped) in one or more computernames/runspaces. Command execution is blocked (on user input host calls etc) The job has been suspended The job is a remote job and has been disconnected from the server. Suspend is in progress Stop is in progress Defines exception which is thrown when state of the PSJob is different from the expected state. Creates a new instance of InvalidPSJobStateException class. Creates a new instance of InvalidPSJobStateException class. The error message that explains the reason for the exception. Creates a new instance of InvalidPSJobStateException class. The error message that explains the reason for the exception. The exception that is the cause of the current exception. Creates a new instance of InvalidJobStateException class. The Job State at the time of the error. An additional message that gives more information about the error. Used for context after a generalized error message. Initializes a new instance of the InvalidPSJobStateException and defines value of CurrentState. Current state of powershell Initializes a new instance of the InvalidPSJobStateException class with serialized data. The that holds the serialized object data about the exception being thrown. The that contains contextual information about the source or destination. State of job when exception was thrown. Gets CurrentState of the Job Type which has information about JobState and Exception ,if any, associated with JobState Constructor for state changes not resulting from an error. Execution state Constructor for state changes with an optional error. The new state. A non-null exception if the state change was caused by an error,otherwise; null. Copy constructor to support cloning source information ArgumentNullException when is null. override for ToString() Clones this object Cloned object The current execution state Non-null exception if the execution state change was due to an error. The state of the job. This value indicates the state of the job . The reason for the state change, if caused by an error. The value of this property is non-null if the state changed due to an error. Otherwise, the value of this property is null. Event arguments passed to JobStateEvent handlers event. Constructor of JobStateEventArgs The current state of the job. Constructor of JobStateEventArgs The current state of the job. The previous state of the job. Info about the current state of the job Info about the previous state of the job Info about the current state of the job. Info about the previous state of the job. Object that must be created by PowerShell to allow reuse of an ID for a job. Also allows setting of the Instance Id so that jobs may be recreated. Top level job object for remoting. This contains multiple child job objects. Each child job object invokes command on one remote machine. Not removing the prefix "PS" as this signifies powershell specific remoting job Internal constructor for initializing PSRemotingJob using computer names names of computers for which the job object is being created list of helper objects corresponding to the computer names remote command corresponding to this job object a friendly name for the job object Internal constructor for initializing job using PSSession objects array of runspace info objects on which the remote command is executed List of helper objects for the runspaces remote command corresponding to this job object a friendly name for the job object Internal constructor for initializing PSRemotingJob using computer names names of computers for which the result object is being created list of helper objects corresponding to the computer names remote command corresponding to this result object Throttle limit to use a friendly name for the job object Internal constructor for initializing job using PSSession objects array of runspace info objects on which the remote command is executed List of helper objects for the runspaces remote command corresponding to this result object throttle limit to use Creates a job object and child jobs for each disconnected pipeline/runspace provided in the list of ExecutionCmdletHelperRunspace items. The runspace object must have a remote running command that can be connected to. Use Connect() method to transition to the connected state. List of DisconnectedJobOperation objects with disconnected pipelines. Throttle limit value. Job name. Aggregate results. Default constructor Initialization common to both constructors Get entity result for the specified computer computername for which entity result is required entity result Get entity result for the specified runspace runspace for which entity result is required entity result Get entity result for the specified helper object helper for which entity result is required entity result Connect all child jobs if they are in a disconnected state. Connect a single child job associated with the provided runspace. Runspace instance id for child job. Finds the disconnected child job associated with this runspace and returns the PowerShell object that is remotely executing the command. Runspace instance Id. Associated PowerShell object. Helper method to find a disconnected child job associated with a given runspace. Runspace Id. PSRemotingChildJob object. Internal method to stop a job without first connecting it if it is in a disconnected state. This supports Receive-PSSession where it abandons a currently running/disconnected job when user selects -OutTarget Host. Stop Job Checks the status of remote command execution Handles the StateChanged event from each of the child job objects Updates the parent job state based on state of all child jobs. New child job state. Previous child job state. Release all the resources. if true, release all the managed objects. Returns runspaces associated with the Job, including child jobs. IEnumerable of RemoteRunspaces Handles JobUnblocked event from a child job and decrements count of blocked child jobs. When count reaches 0, sets the state of the parent job to running sender of this event, unused event arguments, should be empty in this case indicates if more data is available This has more data if any of the child jobs have more data. Message indicating status of the job used by Invoke-Command cmdlet to show/hide computername property value. Format and Output has capability to understand RemoteObjects and this property lets Format and Output decide whether to show/hide computername. Default is true. Computers on which this job is running Returns boolean indicating whether the underlying transport for the job (or child jobs) supports connect/disconnect semantics. Simple throttle operation class for connecting jobs. Simple throttle operation class for PSRemoting jobs created in the disconnected state. Base class for both the helpers. This is an abstract class and the helpers need to derive from this Pipeline associated with this operation Exception raised internally when any method of this class is executed Class for RemotingChildJob object. This job object invokes command on one remote machine. TODO: I am not sure whether to change this internal to just RemotingChildJob. Not removing the prefix "PS" as this signifies powershell specific remoting job Creates an instance of PSRemotingChildJob command invoked by this job object Constructs a disconnected child job that is able to connect to a remote runspace/command on a server. The ExecutionCmdletHelperRunspace must contain a remote pipeline object in a disconnected state. In addition the pipeline runspace must be associated with a valid running remote command that can be connected to. ExecutionCmdletHelper object containing runspace and pipeline objects. ThrottleManger object. Aggregate results. Default constructor Connects the remote pipeline that this job represents. Stops the job Handler which will handle output ready events of the pipeline. The output objects are queued on to the internal stream the pipeline reader which raised this event information describing the ready event Handler which will handle error ready events of the pipeline. The error records are queued on to the internal stream the pipeline reader which raised this event information describing the ready event When the client remote session reports a URI redirection, this method will report the message to the user as a Warning using Host method calls. Handle method executor stream events. The sender. The event args. Handle changes in pipeline states Handle a throttle complete event sender of this event not used in this method Handle the operation complete event sender of this event operation complete event args This method marks the completion state for Job. Also if job failed, it processes the reason of failure. This is the pretty formated error record associated with the reason of failure. Process the exceptions to decide reason for job failure Release all the resources. if true, release all the managed objects. Cleanup after state changes to finished Aggregates results from the pipeline associated with the specified helper helper whose pipeline results need to be aggregated If the pipeline is not null, returns the pipeline's PowerShell If it is null, then returns the PowerShell with the specified instance Id. remote pipeline instance as described in event args PowerShell instance When a debug message is raised in the underlying PowerShell add it to the jobs debug stream unused arguments describing this event When a verbose message is raised in the underlying PowerShell add it to the jobs verbose stream unused arguments describing this event When a warning message is raised in the underlying PowerShell add it to the jobs warning stream unused arguments describing this event When a progress message is raised in the underlying PowerShell add it to the jobs progress tream unused arguments describing this event Stops collecting results from the pipeline associated with the specified helper helper class whose pipeline results aggregation has to be stopped Removes aggregate callbacks from pipeline so that a new job object can be created and can add its own callbacks. This is to support Invoke-Command auto-disconnect where a new PSRemoting job must be created to pass back to user for connection. helper class register for throttle complete from the specified throttlemanager unregister for throttle complete from the specified throttle manager Determine the current state of the job based on the underlying pipeline state and set the state accordingly Set the state of the current job from blocked to running and raise an event indicating to this parent job that this job is unblocked Returns the PowerShell for the specified instance id instance id of powershell powershell instance Returns the PowerShell object associated with this remote child job. PowerShell object. Status Message associated with the Job Indicates if there is more data available in this Job Returns the computer on which this command is running helper associated with this entity used by Invoke-Command cmdlet to show/hide computername property value. Format and Output has capability to understand RemoteObjects and this property lets Format and Output decide whether to show/hide computername. Default is true. Property that indicates this disconnected child job was previously in the Blocked state. Returns boolean indicating whether the underlying transport for the job (or child jobs) supports connect/disconnect semantics. This is the pretty formated error record associated with the reason of failure. This is set if Job state is Failed and Reason has a exception. Event raised by this job to indicate to its parent that its now unblocked by the user This job is used for running as a job the results from multiple pipelines. This is used in synchronouse Invoke-Expression execution TODO: I am not sure whether to change this internal to just InvokeExpressionSyncJob. Not removing the prefix "PS" as this signifies powershell specific remoting job Construct an invoke-expression sync job list of operations to use throttle manager to use for this job Clean up once job is finished release all resources true if called by Dispose() Handles operation complete from the operations. Adds an error record to results whenever an error is encountered sender of this event arguments describing this event, unused Handle changes in pipeline states Checks for a condition where all pipelines are either finished or disconnected and at least one pipeline is disconnected. In this case the Job state is set to Disconnected. Used to stop all operations This method marks the completion state for Job. Also if job failed, it processes the reason of failure. Returns the PowerShell instance for the specified id instance id of PowerShell PowerShell instance Used to unregister URI Redirection handler. Submits the operations created in the constructor for invocation. Determines if the job is in a terminal state true, if job in terminal state false otherwise Returns a collection of all powershells for this job. Collection of PowerShell objects. Returns a disconnected remoting job object that contains all remote pipelines/runspaces that are in the Disconnected state. New base class for a job that provides extended state management functionality on the job. Since the existing Job class is an abstract class and there are existing implementations of the same, it is required to have a new class that will have the extended functionality. This is to ensure that backwards compatibility is maintained However, this class will derive from the existing Job class. The option of deprecating the existing class was considered as well. In order to maintain backwards compatibility of PowerShell job cmdlets they will have to work with the old interface and hence deprecating the Job class did not add any benefit rather than deriving from the same The following are some of the notes about why the asynchronous operations are provided this way in this class. There are two possible options in which asynchornous support can be provided: 1. Classical pattern (Begin and End) 2. Event based pattern Although the PowerShell API uses the classical pattern and we would like the Job API and PowerShell API to be as close as possible, the classical pattern is inherently complex to use. These are the parameters that can be used by a job implementation when they want to specify parameters to start a job Object that will be used for thread synchronization Default no argument constructor Constructor which will initialize the job with the associated command string string representation of the command the job is running Creates an instance of this class Command invoked by this job object Friendly name for the job object Creates an instance of this class Command invoked by this job object Friendly name for the job object Child jobs of this job object Creates an instance of this class Command invoked by this job object Friendly name for the job object JobIdentifier token used to assign Id and InstanceId Creates an instance of this class Command string Friendly name for the job Instance ID to allow job identification across sessions. There is an internal method in Job which is not made public. In order to make this available to someone implementing a job it has to be added here. If the original method is made public it has changes of colliding with some implementation which may have added that method state of the job exception associated with the job entering this state start a job. The job will be started with the parameters specified in StartParameters It is redudant to have a method named StartJob on a job class. However, this is done so as to avoid an FxCop violation "CA1716:IdentifiersShouldNotMatchKeywords" Stop and Resume are reserved keyworks in C# and hence cannot be used as method names. Therefore to be consistent it has been decided to use *Job in the name of the methods Start a job asynchronously Method which can be extended or called by derived classes to raise the event when start of the job is completed arguments describing an exception that is associated with the event Method which can be extended or called by derived classes to raise the event when stopping a job is completed argument describing an exception that is associated with the event Method which can be exteded or called by derived classes to raise the event when suspending a job is completed argument describing an exception that is associated with the event Method which can be extended or called by derived classes to raise the event when resuming a suspended job is completed argument describing an exception that is associated with the event Method which can be extended or called by derived classes to raise the event when unblocking a blocked job is completed argument describing an exception that is associated with the event Raises the appropriate event based on the operation and the associated event arguments operation for which the event needs to be raised Stop a job asynchronously Suspend a job Asynchronously suspend a job Resume a suspended job Resume a suspended job asynchronously. Unblock a blocked job Unblock a blocked job asynchronously StopJob StopJobAsync SuspendJob SuspendJobAsync Parameters to be used to start a job. This is a property because CommandParameterCollection does not have a public constructor. Hence the infrastructure creates an instance and provides it for the implementations to use Event to be raise when the start job activity is completed. This event should not be raised for synchronous operation Event to be raised when the asynchronous stopping of a job is completed.This event should not be raised for synchronous operation This event should be raised whenever the asynchronous suspend of a job is completed. This event should not be raised for synchronous operation This event should be raised whenever the asynchronous resume of a suspended job is completed. This event should not be raised for synchronous operation This event should be raised whenever the asynchronous unblock of a blocked job is completed. This event should not be raised for synchronous operation Specifies the various thread options that can be used for the ThreadBasedJob Use the default behavior, which is to use a ThreadPoolThread Use a thread pool thread Create a new thread everything and reuse Top level container job Create a container parent job with the specified command string and name command string friendly name for display Create a container parent job with the specified command string Command string Create a container parent job with the specified command string Command string Friendly name for the job JobIdentifier token that allows reuse of an Id and Instance Id Create a container parent job with the specified command string Command string Friendly name for the job Instance ID to allow job identification across sessions. Create a container parent job with the specified command string Command string Friendly name for the job JobIdentifier token that allows reuse of an Id and Instance Id Job type name Create a container parent job with the specified command string Command string Friendly name for the job Instance ID to allow job identification across sessions. Job type name Create a container parent job with the specified command, name, job type strings. Command string Friendly name for the job Job type name Add a child job to the parent job child job to add Thrown if the job is disposed. Thrown if child being added is null. Starts all jobs. Thrown if job is disposed. Starts all child jobs asynchronously. When all child jobs are started, StartJobCompleted event is raised. Resume all jobs. Thrown if job is disposed. Resume all jobs asynchronously. Suspends all jobs. Thrown if job is disposed. Suspends all jobs forcefully. Force flag for suspending forcefully. Reason for doing forceful suspend. Suspends all jobs asynchronously. When all jobs have been suspended, SuspendJobCompleted is raised. Suspends all jobs asynchronously with force flag. When all jobs have been suspended, SuspendJobCompleted is raised. Force flag for suspending forcefully. Reason for doing forceful suspend. Stop all child jobs. Stops all child jobs asynchronously. Once all child jobs are stopped, StopJobCompleted event is raised. StopJob StopJobAsync Unblock all child jobs. Thrown if job is disposed. Unblock all child jobs asynchronously. Once all child jobs are unblocked, UnblockJobCompleted event is raised. Internal synchronous SuspendJob, calls appropriate version if Force is specified. Internal SuspendJobAsync. Calls appropriate method if Force is specified StopJob StopJobAsync Handles the StateChanged event from each of the child job objects Handles the StateChanged event from each of the child job objects true if the job state needs to be modified, false otherwise Release all the resources. if true, release all the managed objects. indicates if more data is available This has more data if any of the child jobs have more data. Message indicating status of the job Computers on which this job is running Container exception for jobs that can map errors and exceptions to specific lines in their input. Creates a new JobFailedException Creates a new JobFailedException The message of the exception Creates a new JobFailedException The message of the exception The actual exception that caused this error. Creates a new JobFailedException The actual exception that caused this error. A ScriptExtent that describes where this error originated from. Class constructor serialization info streaming context Gets the information for serialization The standard SerializationInfo The standard StreaminContext The actual exception that caused this error. The user-focused location from where this error originated. Returns the reason for this exception Contains the definition of a job which is defined in a job store The actual implementation of this class will happen in M2 Save this definition to the specified file on disk stream to save to Load this definition from the specified file on disk Public constructor for testing. Type of adapter to use to create a job. the command string. the job name. A friendly Name for this definition The type that derives from JobSourceAdapter that contains the logic for invocation and management of this type of job. Module name for the module contianing the source adapter implementation. Job source adapter type name. Name of the job that needs to be loaded from the specified module Unique Guid for this job definition Returns information about this job like name, definition, parameters etc Class that helps define the parameters to be passed to a job so that the job can be instantiated without having to specify the parameters explicitly. Helps in passivating job parameters to disk This class is not required if CommandParameterCollection adds a public constructor.The actual implementation of this class will happen in M2 Save this specification to a file stream to save to Load this specification from a file stream to load from Constructor. Create a new job definition with a single set of parameters. The job definition The parameter collection to use Create a new job definition with a multiple sets of parameters. This allows different parameters for different machines. The job definition Collection of sets of parameters to use for the child jobs Utility function to turn a dictionary of name/value pairs into a parameter collection The dictionary to convert The converted collection Friendly name associated with this specification Command string to execute. Definition associated with the job Parameters associated with this specification Unique identifies for this specification Abstract class for a job store which will contain the jobs of a specific type. Get a token that allows for construction of a job with a previously assigned Id and InstanceId. This is only possible if this JobSourceAdapter is the creator of the original job. The original job must have been saved using "SaveJobIdForReconstruction" Instance Id of the job to recreate JobIdentifier to be used in job construction Saves the Id information for a job so that it can be constructed at a later time. This will only allow this job source adapter type to recreate the job. The job whose id information to store. Recurse to save child job Ids. Create a new job with the specified definition job definition to use job object Creates a new job with the definition as specified by the provided definition name and path. If path is null then a default location will be used to find the job definition by name. Job definition name Job definition file path Job2 object Create a new job with the specified JobSpecification specification job object Get the list of jobs that are currently available in this store collection of job objects Get list of jobs that matches the specified names names to match, can support wildcard if the store supports collection of jobs that match the specified criteria Get list of jobs that run the specified command command to match collection of jobs that match the specified criteria Get list of jobs that has the specified id Guid to match job with the specified guid Get job that has specific session id Id to match Job with the specified id Get list of jobs that are in the specified state state to match collection of jobs with the specified state Get list of jobs based on the adapter specific filter parameters dictionary containing name value pairs for adapter specific filters collection of jobs that match the specified criteria Remove a job from the store job object to remove Saves the job to a persisted store. Job2 type job to persist Name for this store Class that will serve as the API for hosting and executing workflows in PowerShell. This class will have a behavior similar to how the Runspace and PowerShell APIs behave in the remoting scenario. The objects on the client side act as proxies to the real objects on the server Internal constructor the command to execute start a job. The job will be started with the parameters specified in StartParameters Thrown if the job is already running, if there is no runspace or runspace pool assigned. Thrown if the job is otherwise started, finished, or suspended. Thrown if job is disposed. Start a job asynchronously When a job is started all the data in the job streams from a previous invocation will be cleared Stop a job synchronously. In order to be consistent, this method should be used in place of StopJob which was introduced in the v2 Job API Thrown if job is blocked. Thrown if job is disposed. Stop a job asynchronously StopJob StopJobAsync Suspend a job Throws if the job is not in a running or suspended state. Thrown if job is disposed. Asynchronously suspend a job SuspendJob SuspendJobAsync Resume a suspended job Throws if the job is not in a suspended or running state. Thrown if job is disposed. Resume a suspended job asynchronously. Unblock a blocked job Unblock job is not supported on PSJobProxy. Unblock a blocked job asynchronously Start execution of the workflow with the specified input. This input will serve as input to the underlying pipeline collection of input objects Start execution of the job with the specified input. This input will serve as input to the underlying pipeline Not sure if this method is needed. This has been added just to be in sync with the PowerShell APIs Start execution of the workflow with the specified input. This input will serve as input to the underlying pipeline. Because the number of child jobs is unknown before starting the job, delegates may be indicated to ensure that no events will be missed after the child job is created if data begins streaming back immediately. delegate used to subscribe to data added events on the child jobs delegate used to subscribe to state changed events on the child jobs collection of input objects Start asynchronous execution of the workflow with the specified input. This input will serve as input to the underlying pipeline. Because the number of child jobs is unknown before starting the job, delegates may be indicated to ensure that no events will be missed after the child job is created if data begins streaming back immediately. delegate used to subscribe to data added events on the child jobs delegate used to subscribe to state changed events on the child jobs collection of input objects Removes the job. If remoteJob is true, the job output that has been transferred to this client object will be preserved. Indicates whether the remove operation should be applied to the remote or local job. Force will stop the job on the server before attempting removal. Default value is false. Thrown if the job is not in a completed state. Removes the job. If remoteJob is true, the job output that has been transferred to this client object will be preserved. Indicates whether the remove operation should be applied to the remote or local job. Thrown if the job is not in a completed state. Removes the job on the remote server. The job output that has been transferred to this client object will be preserved. Indicates whether the remove operation should be applied to the remote or local job. Force will stop the job on the server before attempting removal. Removes the job on the remote server. The job output that has been transferred to this client object will be preserved. Indicates whether the remove operation should be applied to the remote or local job. Method to raise the event when removing a server side job is completed argument describing an exception that is associated with the event Queries the runspace for jobs and constructs a collection of job proxies to interact with them. Runspace containing the jobs to base the proxy on. Hashtable to use for the Get-Job -filter command. Handler to subscribe to any child job data added events. Handler to subscribe to any child job state changed events. A collection of job proxies that represent the jobs collected based on the filter. Queries the runspace for jobs and constructs a collection of job proxies to interact with them. Runspace containing the jobs to base the proxy on. Hashtable to use for the Get-Job -filter command. If true, the data streaming will start immediately. If false, the user must call "ReceiveJob()" to start data streaming. A collection of job proxies that represent the jobs collected based on the filter. Queries the runspace for jobs and constructs a collection of job proxies to interact with them. Runspace containing the jobs to base the proxy on. Hashtable to use for the Get-Job -filter command. A collection of job proxies that represent the jobs collected based on the filter. Queries the runspace for jobs and constructs a collection of job proxies to interact with them. Runspace containing the jobs to base the proxy on. A collection of job proxies that represent the jobs collected based on the filter. Queries the runspace for jobs and constructs a collection of job proxies to interact with them. RunspacePool containing the jobs to base the proxy on. Hashtable to use for the Get-Job -filter command. Handler to subscribe to any child job data added events. Handler to subscribe to any child job state changed events. A collection of job proxies that represent the jobs collected based on the filter. Queries the runspace for jobs and constructs a collection of job proxies to interact with them. RunspacePool containing the jobs to base the proxy on. Hashtable to use for the Get-Job -filter command. If true, the data streaming will start immediately. If false, the user must call "ReceiveJob()" to start data streaming. A collection of job proxies that represent the jobs collected based on the filter. Queries the runspace for jobs and constructs a collection of job proxies to interact with them. RunspacePool containing the jobs to base the proxy on. Hashtable to use for the Get-Job -filter command. A collection of job proxies that represent the jobs collected based on the filter. Queries the runspace for jobs and constructs a collection of job proxies to interact with them. RunspacePool containing the jobs to base the proxy on. A collection of job proxies that represent the jobs collected based on the filter. Will begin streaming data for a job object created by the "create" method that is in a not started state. Will begin streaming data for a job object created by the "create" method that is in a not started state. delegate used to subscribe to data added events on the child jobs delegate used to subscribe to state changed events on the child jobs Helper to do error checking for getting a property of type T from a PSobject. Checks if there is more data in the specified collection Type of the collection collection to check true if the collection has more data Worker method which starts the job Worker method which stops the job Worker method which suspends the job Worker method to resume the job Worker method to remove the remote job object state information indicates the "force" parameter Assigns either a runspace or runspacepool to the specified powershell instance powershell instance to which the set has to happen Event handler for InvocationStateChanged on the powershell object running receive-job sender of this event argument describing this event Assigns job properties and creates child job tree. Deserialized job object representing the remote job for this proxy. Check if changes to the jobs properties can be accepted Assert if the object is not yet disposed and if so throw an ObjectDisposedException Thrown if the object has already been disposed Method is not thread-safe. Caller has to ensure thread safety Dispose all managed resources true when being disposed Success status of the command execution. Indicates that more data is available in this result object for reading. This is the location string from the remote job. This event should be raised whenever the asynchronous removal of a server side job is completed. If set, the remote job will be removed when it has been completed and the data has been received. This can only be set prior to a job being started. The instance ID of the remote job that this proxy interacts with. Runspace in which this job will be executed At any point of time only a runspace or a runspacepool may be specified RunspacePool in which this job will be executed Job class used for children of PSJobProxy jobs. Method to raise the event when this job has data added. argument describing an exception that is associated with the event Dispose Not supported Not supported StopJob Not supported StopJobAsync Not supported Not supported SuspendJob SuspendJobAsync Not supported Not supported Not supported Not supported Not supported This event will be raised whenever data has been added to one of the job object's 6 collections. The event arguments include the job itself, the data type, indicating which collection has data added, and the index. Status message Indicates the job has or can have more data on one or more data collection The location of the job Event arguments that indicate data has been added to a child job. Constructor The job that contains the data that is added. The type of data that this event is raised for. Index at which the data is added. The job that contains the PSDataCollection which is the sender. Identifies the type of the sending collection as one of the six collections associated with a job. If data type = output, sender is PSDataCollection of PSObject, Error is of ErrorRecord, etc. Index at which the data is added. Job data is added to one of these streams. Each type of data implies a different type of object. PSObject PSObject ErrorRecord WarningRecord VerboseRecord DebugRecord ProgressRecord Define all the output streams and one input stream for a workflow. Input stream for incoming objects. Output stream for returned objects. Error stream for error messages. Warning stream for warning messages. Progress stream for progress messages. Verbose stream for verbose messages. Debug stream for debug messages. If the object is already disposed or not. Private object for thread-safe exection. Default constructor. Default constructor. Disope implementation. Protected virtual implementation of Dispose. Marking all the streams as completed so that no further data can be added and jobs will know that there is no more data coming in. Gets input stream. Gets output stream. Gets error stream. Gets warning stream. Gets progress stream. Gets verbose stream. Get debug stream. Manager for JobSourceAdapters for invocation and management of specific Job types. Collection of registered JobSourceAdapters. Collection of job IDs that are valid for reuse. Creates a JobManager instance. Returns true if the type is already registered. Type to check. Whether the type is registered already. Adds a new JobSourceAdapter to the JobManager instance. After addition, creating a NewJob with a JobDefinition indicating the JobSourceAdapter derivative type will function. The derivative JobSourceAdapter type to register. Throws when there is no public default constructor on the type. Returns a token that allows a job to be constructed with a specific id and instanceId. The original job must have been saved using "SaveJobIdForReconstruction" in the JobSourceAdapter The instance id desired. The requesting type name for JobSourceAdapter implementation. Token for job creation. Saves the Id information for a job so that it can be constructed at a later time by a JobSourceAdapter with the same type. The instance id to save. The session specific id to save. The type name for the JobSourceAdapter implementation doing the save. Creates a new job of the appropriate type given by JobDefinition passed in. JobDefiniton defining the command. Job2 object of the appropriate type specified by the definition. If JobSourceAdapter type specified in definition is not registered. JobSourceAdapter implementation exception thrown on error. Creates a new job of the appropriate type given by JobDefinition passed in. JobInvocationInfo defining the command. Job2 object of the appropriate type specified by the definition. If JobSourceAdapter type specified in definition is not registered. JobSourceAdapter implementation exception thrown on error. Saves the job to a persisted store. Job2 type job to persist Job definition containing source adapter information Helper method, finds source adapter if registered, otherwise throws an InvalidOperationException. The name of the JobSourceAdapter derivative desired. The JobSourceAdapter instance. If JobSourceAdapter type specified is not found. Helper method to find and return the job source adapter if currently loaded or otherwise load the associated module and the requested source adapter. JobDefinition supplies the JobSourceAdapter information. JobSourceAdapter Get list of all jobs. Cmdlet requesting this, for error processing. job source adapter type names Collection of jobs. If cmdlet parameter is null, throws exception on error from JobSourceAdapter implementation. Get list of jobs that matches the specified names. Names to match, can support wildcard if the store supports. Cmdlet requesting this, for error processing. job source adapter type names Collection of jobs that match the specified criteria. If cmdlet parameter is null, throws exception on error from JobSourceAdapter implementation. Get list of jobs that run the specified command. Command to match. Cmdlet requesting this, for error processing. job source adapter type names Collection of jobs that match the specified criteria. If cmdlet parameter is null, throws exception on error from JobSourceAdapter implementation. Get list of jobs that are in the specified state. State to match. Cmdlet requesting this, for error processing. job source adapter type names Collection of jobs with the specified state. If cmdlet parameter is null, throws exception on error from JobSourceAdapter implementation. Get list of jobs based on the adapter specific filter parameters. Dictionary containing name value pairs for adapter specific filters. Cmdlet requesting this, for error processing. Collection of jobs that match the specified criteria. If cmdlet parameter is null, throws exception on error from JobSourceAdapter implementation. Get a filtered list of jobs based on adapter name. job id adapter name Get a filtered list of jobs based on filter type. Object to use for filtering. Type of filter, specifies which "get" from JobSourceAdapter to call, and dictates the type for filter. Cmdlet requesting this, for error processing. job source adapter type names Filtered list of jobs. If cmdlet parameter is null, throws exception on error from JobSourceAdapter implementation. Compare sourceAdapter name with the provided source adapter type name list. Gets a filtered list of jobs from the given JobSourceAdapter. JobSourceAdapter to query. Filter object. Filter type. List of jobs from sourceAdapter filtered on filterType. Throws exception on error from JobSourceAdapter implementation. Get job specified by the session specific id provided. Session specific job id. Cmdlet requesting this, for error processing. Job that match the specified criteria. If cmdlet parameter is null, throws exception on error from JobSourceAdapter implementation. Get job that has the specified id. Guid to match. Cmdlet requesting this, for error processing. Job with the specified guid. If cmdlet parameter is null, throws exception on error from JobSourceAdapter implementation. Gets or creates a Job2 object with the given definition name, path and definition type if specified, that can be run via the StartJob() method. Job definition name. Job definition file path. JobSourceAdapter type that contains the job definition. Cmdlet making call. Whether to write jobsourceadapter errors. List of matching Job2 objects Returns a List of adapter names currently loaded. Adapter names to filter on List of names Remove a job from the appropriate store. Session specific Job ID to remove. Remove a job from the appropriate store. Job object to remove. If true, will throw all JobSourceAdapter exceptions to caller. This is needed if RemoveJob is being called from an event handler in Receive-Job. Filters available for GetJob, used internally to centralize Exception handling. Use no filter. Filter on command (string). Filter on custom dictionary (dictionary(string, object)). Filter on name (string). Filter on job state (JobState). A job that can throttle execution of child jobs Releases resources associated with this object Creates a new object. Command invoked by this job object Friendly name for the job object Name describing job type. The maximum number of child jobs that can be running at any given point in time. Passing 0 requests to turn off throttling (i.e. allow unlimited number of child jobs to run) true if this is used from a cmdlet invoked without -AsJob switch. false if this is used from a cmdlet invoked with -AsJob switch. If is true, then memory can be managed more aggressively (for example ChildJobs can be discarded as soon as they complete) because the is not exposed to the end user. Adds and starts a child job. Child job to add Flags of the child job action to run after enqueuing the job Thrown when the child job is not in the state. (because this can lead to race conditions - the child job can finish before the parent job has a chance to register for child job events) Notifies this object that no more child jobs will be added. Stop this job object and all the . Indicates if job has more data available. true if any of the child jobs have more data OR if have not been called yet; false otherwise Comma-separated list of locations of . Status message associated with the Job Flags of child jobs of a Child job doesn't have any special properties Child job can call method or or method of the instance it belongs to. This class implements a Finite State Machine (FSM) to control the remote connection on the client side. There is a similar but not identical FSM on the server side for this connection. The FSM's states and events are defined to be the same for both the client FSM and the server FSM. This design allows the client and server FSM's to be as similar as possible, so that the complexity of maintaining them is minimized. This FSM only controls the remote connection state. States related to runspace and pipeline are managed by runspace pipeline themselves. This FSM defines an event handling matrix, which is filled by the event handlers. The state transitions can only be performed by these event handlers, which are private to this class. The event handling is done by a single thread, which makes this implementation solid and thread safe. This implementation of the FSM does not allow the remote session to be reused for a connection after it is been closed. This design decision is made to simplify the implementation. However, the design can be easily modified to allow the reuse of the remote session to reconnect after the connection is closed. Event handling matrix. It defines what action to take when an event occur. [State,Event]=>Action Current state of session Timer to be used for key exchange indicates that the client has previously completed the session key exchange this is to queue up a disconnect request when a key exchange is in process the session will be disconnect once the exchange is complete intermediate disconnect requests are tracked by this flag processes events in the queue. If there are no more events to process, then sets eventsInProcess variable to false. This will ensure that another thread which raises an event can then take control of processing the events Raises the StateChanged events which are queued All StateChanged events will be raised once the processing of the State Machine events are complete Unique identifier for this state machine. Used in tracing Handler to be used in cases, where setting the state is the only task being performed. This method also asserts if the specified event is valid for the current state of the state machine sender of this event event args Handles the timeout for key exchange sender of this event arguments describing this event Handler to be used in cases, where raising an event to the state needs to be performed. This method also asserts if the specified event is valid for the current state of the state machine sender of this event event args Creates an instance of ClientRemoteSessionDSHandlerStateMachine Helper method used by dependents to figure out if the RaiseEvent method can be short-circuited. This will be useful in cases where the dependent code wants to take action immediately instead of going through state machine. This method is used by all classes to raise a FSM event. The method will queue the event. The event queue will be handled in a thread safe manner by a single dedicated thread. This parameter contains the event to be raised. optional bool indicating whether to clear currently queued events If the parameter is null. This is the private version of raising a FSM event. It can only be called by the dedicated thread that processes the event queue. It calls the event handler in the right position of the event handling matrix. The parameter contains the actual FSM event. If the parameter is null. This is the handler for CreateSession event of the FSM. This is the begining of everything else. From this moment on, the FSM will proceeds step by step to eventually reach Established state or Closed state. This parameter contains the FSM event. If the parameter is null. This is the handler for ConnectSession event of the FSM. This is the begining of everything else. From this moment on, the FSM will proceeds step by step to eventually reach Established state or Closed state. This parameter contains the FSM event. If the parameter is null. This is the handler for NegotiationSending event. It sets the new state to be NegotiationSending and calls data structure handler to send the negotiation packet. This parameter contains the FSM event. If the parameter is null. This is the handler for Close event. This parameter contains the FSM event. If the parameter is null. If the parameter does not contain remote data. Handles a fatal error message. Throws a well defined error message, which contains the reason for the fatal error as an inner exception. This way the internal details are not surfaced to the user sender of this event, unused arguments describing this event Sets the state of the state machine. Since only one thread can be manipulating the state at a time the state is not synchronized new state of the state machine reason why the state machine is set to the new state This is a readonly property available to all other classes. It gives the FSM state. Other classes can query for this state. Only the FSM itself can change the state. This event indicates that the FSM state changed. Implements ServerRemoteSessionDataStructureHandler Creates an instance of ClientRemoteSessionDSHandlerImpl Makes a create call asynchronously. This callback is called on complete of async connect call Close the connection asynchronously. Sends the negotiation package asynchronously Clubing negotiation packet + runspace creation and then doing transportManager.ConnectAsync(). This will save us 2 network calls by doing all the work in one network call. Transport reported an error saying that uri is redirected. This method will perform the redirection to the new URI by doing the following: 1. Close the current transport manager to clean resources 2. Raise a warning that URI is getting redirected. 3. Using the new URI, ask the same transport manager to redirect Step 1 is performed here. Step2-3 is performed in another method newURIString is a null reference. uriString is empty. The scheme specified in uriString is invalid. uriString contains too many slashes. The password specified in uriString is invalid. The host name specified in uriString is invalid. This is step 2 of URI redirection. This is called after the current transport manager is closed. This is usually called from the close complete callback. Handler which handles transport errors. Dispatches data when it arrives from the input queue arg which contains the data recevied from input queue This processes the object received from transport which are targetted for session argument containg the data object This processes the object received from transport which are not targetted for session received data. public method for dispose release all resources if true, release all managed resources Send the specified local public key to the remote end local public key as a string Raise the public key received event received data This method is a hook to be called from the transport manager This event indicates that the connection state has changed. Class that exposes read only properties and which conveys information about a remote runspace object to the user. The class serves the following purpose: 1. Exposes useful information to the user as properties 2. Shields the remote runspace object from directly being exposed to the user. This way, the user will not be able to directly act upon the object, but instead will have to use the remoting cmdlets. This will prevent any unpredictable behavior. Static variable which is incremented to generate id ToString method override string Internal method to insert a runspace into a PSSession object. This is used only for Disconnect/Reconnect scenarios where the new runspace is a reconstructed runspace having the same Guid as the existing runspace. Runspace to insert Boolean indicating if runspace was inserted. This constructor will be used to created a remote runspace info object with a auto generated name Remote runspace object for which the info object need to be created Generates and returns the runspace name auto generated name Returns shell configuration name with shell prefix removed. shell configuration name display shell name Generates a unique runspace id and name. Returned Id Returned name Increments and returns a session unique runspace Id. Id Creates a runspace name based on a given Id value. Integer Id Runspace name Name of the remote computer Shell which is executed in the remote machine InstanceID that identifies this runspace SessionId of this runspace. This is unique only across a session Friendly name for identifying this runspace Indicates whether the specified runspace is available for executing commands Private data to be used by applications built on top of PowerShell. Optionally sent by the remote server when creating a new session / runspace. The remote runspace object based on which this information object is derived This property is marked internal to allow other cmdlets to get access to the RemoteRunspace object and operate on it like for instance test-runspace, close-runspace etc Error record in remoting cases constructor the error record that is wrapped origin information constructor that is used to wrap an error record Serializer method for class. Serializer information Streaming context Deserializer constructor. Serializer information Streaming context Wrap the current ErrorRecord instance If the wrapped exception contains a ParentContainsErrorRecordException, the new ErrorRecord should have this exception as its Exception instead. Contains the origin information Progress record containing origin information Constructor the progress record that is wrapped origin information Contains the origin information Warning record containing origin information Constructor The warning message that is wrapped The origin information Constructor taking WarningRecord to wrap and OriginInfo. WarningRecord to wrap OriginInfo Contains the origin information Debug record containing origin information Constructor The debug message that is wrapped The origin information Contains the origin information Verbose record containing origin information Constructor The verbose message that is wrapped The origin information Contains the origin information Contains OriginInfo for an error record This class should only be used when defining origin information for error records. In case of output objects, the information should directly be added to the object as properties public constructor machine name instance id of runspace public constructor machine name instance id of runspace instance id for the origin object Overriden ToString() method returns the computername The HostEntry information for the machine on which this information originated Runspace instance ID Error record source instance ID Class which supports pooling remote powerShell runspaces on the client Constructor which creates a RunspacePool using the supplied , and The maximum number of Runspaces that can exist in this pool. Should be greater than or equal to 1. The minimum number of Runspaces that can exist in this pool. Should be greater than or equal to 1. The TypeTable to use while deserializing/serializing remote objects. TypeTable has the following information used by serializer: 1. SerializationMethod 2. SerailizationDepth 3. SpecificSerializationProperties TypeTable has the following inforamtion used by deserializer: 1. TargetTypeForDeserializaiton 2. TypeConverter Host associated with this runspacepool Application arguments the server can see in The RunspaceConnectionInfo object which identifies this runspace pools connection to the server Session name. Maximum runspaces is less than 1. Minimum runspaces is less than 1. ConnectionInfo specified is null Create a runspacepool object in the disconnected state. Identifies remote session to connect. Friendly name for runspace pool. Indicates whether the runspacepool is disconnected. Array of commands associated with this runspace pool. Connection information for remote server. PSHost object. TypeTable for object serialization/deserialization. Helper method to create the dispatchTable and dataStructureHandler objects. Sets the maximum number of Runspaces that can be active concurrently in the pool. All requests above that number remain queued until runspaces become available. The maximum number of runspaces in the pool. true if the change is successful; otherwise, false. You cannot set the number of runspaces to a number smaller than the minimum runspaces. Sets the minimum number of Runspaces that the pool maintains in anticipation of new requests. The minimum number of runspaces in the pool. true if the change is successful; otherwise, false. You cannot set the number of idle runspaces to a number smaller than 1 or greater than maximum number of active runspaces. Retrieves the number of runspaces available at the time of calling this method from the remote server The number of runspaces available in the pool The server sent application private data. Store the data so that user can get it later. argument describing this event sender of this event The state of the server RunspacePool has changed. Handle the same and reflect local states accordingly argument describing this event sender of this event A host call has been proxied from the server which needs to be executed sender of this event arguments describing this event Private data to be used by applications built on top of PowerShell. Remote runspace pool gets its application private data from the server (when creating the remote runspace pool) - calling this method on a remote runspace will block until the data is received from the server. - unless the runspace is disconnected and data hasn't been received in which case it returns null immediately. Add a ClientPowerShellDataStructureHandler to ClientRunspaceDataStructureHandler list. PowerShell Instance Id. ClientPowerShellDataStructureHandler for PowerShell. Opens the runspacepool synchronously / asynchronously. Runspace pool must be opened before it can be used. true to open asynchronously A AsyncCallback to call once the BeginOpen completes. A user supplied state to call the with. asyncResult object to monitor status of the async open operation. This is returned only if is true. Cannot open RunspacePool because RunspacePool is not in the BeforeOpen state. There is not enough memory available to start this asynchronously. Synchronous open Closes the RunspacePool and cleans all the internal resources. This will close all the runspaces in the runspacepool and release all the async operations waiting for a runspace. If the pool is already closed or broken or closing this will just return. Cannot close the RunspacePool because RunspacePool is in Closing state. Closes the RunspacePool asynchronously. To get the exceptions that might have occurred, call EndOpen An AsyncCallback to call once the BeginClose completes A user supplied state to call the with An AsyncResult object to monitor the state of the async operation Synchronous disconnect. Asynchronous disconnect. AsyncCallback object. state object. IAsyncResult Waits for BeginDisconnect operation to complete. IAsyncResult object. Synchronous connect. Asynchronous connect. ASyncCallback object. state Object. IAsyncResult Waits for BeginConnect to complete. IAsyncResult object. Creates an array of PowerShell objects that are in the Disconnected state for all currently disconnected running commands associated with this runspace pool. Array of PowerShell objects. Returns RunspacePool capabilities. RunspacePoolCapability Set the new runspace pool state based on the state of the server RunspacePool state information object describing the state change at the server RunspacePool Set the new runspace pool state based on the state of the server RunspacePool and raise events if required state information object describing the state change at the server RunspacePool raise state changed events if true The session is closing set the state and reason accordingly sender of this event, unused arguments describing this event The session closed, set the state and reason accordingly sender of this event, unused arguments describing this event Set the async result for open as completed Set the async result for close as completed When a response to a SetMaxRunspaces or SetMinRunspaces is received, from the server, this method sets the response and thereby unblocks corresponding call sender of this message, unused contains response and call id When the client remote session reports a URI redirection, this method will report the message to the user as a Warning using Host method calls. When the server sends a PSEventArgs this method will add it to the local event queue A session disconnect has been initiated by the WinRM robust connection layer. Set internal state to Disconnecting. The session has been successfully created. Public method for Dispose Release all resources if true, release all managed resources the connection associated with this runspace pool The ClientRunspacePoolDataStructureHandler associated with this runspace pool List of CommandConnectInfo objects for each remote running command associated with this remote runspace pool. Gets and sets the name string for this runspace pool object. Indicates whether this runspace pools viable/available for connection. Returns robust connection maximum retry time in milliseconds. Returns runspace pool availability. Application arguments to use when opening a remote session This event is raised, when a host call is for a remote runspace which this runspace pool wraps EventHandler used to report connecion URI redirections to the application Notifies the successful creation of the runspace session. Returns true if Runspace supports disconnect. Returns the WinRM protocol version object for this runspace pool connection. Class defining a remote command to connect to. Constructs a remote command object. Command instance Id. Command string. Remote command instance Id. Remote command string. Enumerates remote runspacepools (Shells) and running commands using Get-WSManInstance cmdlet. Gets an array of XmlElement objects representing all disconnected runspace pools on the indicated server. Specifies the remote server to connect to.] Collection of XmlElement objects. Gets an array of XmlElement objects representing each running command on the specified runspace pool with the shellid Guid. Guid of shellId (runspacepool Id). Specifies the remote server to connect to.] Collection of XmlElement objects. Use the WSMan New-WSManSessionOption cmdlet to create a session options object used for Get-WSManInstance queries. WSManConnectionInfo WSMan session options object PowerShell client side proxy base which handles invocation of powershell on a remote machine Constructor which creates a client remote powershell powershell instance The runspace pool associated with this shell Set the state information of the client powershell state information to set Close the output, error and other collections associated with the shell, so that the enumerator does not block Stop the remote powershell asynchronously This method will be called from within the lock on PowerShell. Hence no need to lock Initialize the client remote powershell instance input for execution error stream to which data needs to be written to informational buffers which will hold debug, verbose and warning messages settings based on which this powershell needs to be executed output stream to which data needs to be written to Do any clean up operation per initialization here Attempts to reconnect or connect to a running command on a remote server, which will resume events and data collection from the server. If connectCmdInfo parameter is null then a reconnection is attempted and it is assumed that the current client state is unchanged since disconnection. If connectCmdInfo parameter is non-null then a connection is attempted to the specified remote running command. This is an asynchronous call and results will be reported in the ReconnectCompleted or the ConnectCompleted call back as appropriate. ConnectCommandInfo specifying remote command. An error record is received from the powershell at the server side. It is added to the error collection of the client powershell sender of this event, unused arguments describing this event An output object is received from the powershell at the server side. It is added to the output collection of the client powershell sender of this event, unused arguments describing this event The invocation state of the server powershell has changed. The state of the client powershell is reflected accordingly sender of this event, unused arguments describing this event Helper method to check any error condition after a stop call and close the remote runspace/pool if the stop call failed due to network outage problems. Exception Handler for handling any informational message received from the server side. sender of this event, unused arguments describing this event Handler for ConnectCompleted and ReconnectCompleted events from the PSRP layer. Sender of this event, unused. Event arugments. This is need for the state change events that resulted in closing the underlying datastructure handler. We cannot send the state back to the upper layers until close is completed from the datastructure/transport layer. We have to send the terminal state only when we know that underlying datastructure/transport is closed. Execute the specified host call host call to execute Handles notification from RunspacePool indicating that the pool is broken. This sets the state of all the powershell objects associated with the runspace pool to Failed sender of this information, unused arguments describing this event contains information on the reason associated with the runspace pool entering a Broken state Handles a robust connection layer notification from the transport manager. This queue is for the state change events that resulted in closing the underlying datastructure handler. We cannot send the state back to the upper layers until close is completed from the datastructure/transport layer. Public interface for dispose Release all resources if true, release all managed resources Instance Id associated with this client remote powershell PowerShell associated with this ClientRemotePowerShell whether input is available when this object is created Input stream associated with this object Output stream associated with this object data structure handler object Invocation settings associated with this ClientRemotePowerShell This event is raised, when a host call is for a remote pipeline which this remote powershell wraps If this client remote powershell has been initialized This event is fired when this PowerShell object receives a robust connection notification from the transport. Current remote connection retry status. Robust Connection notifications. PSConnectionRetryStatusEventArgs Handles all PowerShell data structure handler communication with the server side RunspacePool Constructor which takes a client runspace pool and creates an associated ClientRunspacePoolDataStructureHandler client runspace pool object. typetable to use for serialization/deserialization. Create a runspace pool asynchronously (and opens) it on the server Closes the server runspace pool asynchronously Suspends connection to a runspace pool asynchronously Restore connection to a runspace pool asynchronously Creates a connection to an existing remote runspace pool Process the data received from the runspace pool on the server data received Creates a PowerShell data structure handler instance associated with this runspace pool data structure handler associated powershell PowerShell data structure handler object Creates a PowerShell instances on the server, associates it with this runspace pool and invokes the client remote powershell Add a ClientPowerShellDataStructureHandler to association list. PowerShell Instance Id. ClientPowerShellDataStructureHandler for PowerShell. dispatch the message to the associated powershell data structure handler message received. send the host response to the server host response object to send sent a message to modify the max runspaces of the runspace pool new maxrunspaces to set call id on which the calling method will be blocked on Send a message to modify the min runspaces of the runspace pool new minrunspaces to set call id on which the calling method will be blocked on Send a message to get the available runspaces from the server call id on which the calling method will be blocked on Send the data specified as a RemoteDataObject asynchronously to the runspace pool on the remote session data to send This overload takes a RemoteDataObject and should be the one used within the code Send the data asynchronously to runspace pool driver on remote session with the specified priority data to be sent to server priority with which to send data Send the data asynchronously to runspace pool driver on remote session with the specified priority data object to send priority with which to send data Create a client remote session based on the connection info The RunspacePool object this session should map to. Handler for handling all session events sender of this event object describing this event Session is reporting that URI is getting redirected. Report this information to the user by writing a warning message. Notifies associated powershell's of the runspace pool state change state information that need to be notified Gets the ClientPowerShellDataStructureHandler instance for the specified id id of the client remote powershell ClientPowerShellDataStructureHandler object Remove the association of the powershell from the runspace pool sender of this event unused Calls each running command Transport manager PrepareForDisconnect method. Each transport manager object will raise an event when the command/transport is ready to be disconnected. Disconnect will begin when all is ready. Allows each running command to resume processing command input for when the runspacepool and running commands are connected. Handler of the transport ReadyForDisconnect event. When all command transports are ready for disconnect we can start the disconnect process. WaitCallback method to start an asynchronous disconnect. Forwards robust connection notifications to associated PowerShell clients. Forwards the session create completion event. transport sender CreateCompleteEventArgs public interface for dispose Release all resources if true, release all managed resources Event raised when a host call is received Event raised when state information is received Event raised when RunspacePoolInitInfo is received. This is the first runspace pool message expected after connecting to an existing remote runspace pool. RemoteRunspacePoolInternal should use this notification to set the state of a reconstructed runspace to "Opened State" and use the minRusnpace and MaxRunspaces information to set its state Event raised when application private data is received Event raised when a PSEventArgs is received Event raised when the session is closed. Event raised when the session is closing. Event raised when a response to a SetMaxRunspaces or SetMinRunspaces call is received EventHandler used to report connecion URI redirections to the application Indicates that a disconnect has been initiated by the WinRM robust connections layer. Notification that session creation has completed. The remote session associated with this runspace pool data structure handler Transport manager used by this data structure handler Returns robust connection maximum retry time in milliseconds, if supported by underlying transport manager. Indicates whether the currently connected runspace endpoint supports disconnect/connect semantics. Base class for ClientPowerShellDataStructureHandler to handle all references Start the command operation. Handler which handles transport errors. Send a stop powershell message to the server Event that gets raised when stop signal is completed. Send the host response to the server host response to send Attach the specified data collection as input to the remote powershell Process the data received from the runspace pool on the server data received Set the state of the associated powershell to stopped reason why this state change should occur This method is called by the associated runspace pool data structure handler when the server runspace pool goes into a closed or broken state Sets the state of the powershell to stopped reason why the powershell has to be set to a stopped state. Closes tranport manager. Raise a remove association event. This is raised when the powershell has gone into a terminal state and the runspace pool need not maintain any further associations Called from runspace DS handler while disconnecting This will set the state of the pipeline DS handler to disconnected This does not ensure that the corresponding session/runspacepool is in connected stated Its the caller responsiblity to ensure that this is the case At the protocols layers, this logic is delegated to the transport layer. WSMan tranport ensures that WinRS commands cannot be reconnected when the parent shell is not in connected state Called from session DSHandler. Notify client of robust connection message. Default internal constructor id of the client remote runspace pool associated with this data structure handler id of the client powershell associated with this data structure handler transport manager associated with this connection Send the data specified as a RemoteDataObject asynchronously to the powershell on server data to send This overload takes a RemoteDataObject and should be the one used within the code Handle data added to input sender of this event information describing this event This method doesn't lock and its the responsibility of the caller to actually do the locking Helper method to add transport manager callbacks and set transport manager disconnected state. Boolean this event is raised when the state of associated powershell is terminal and the runspace pool has to detach the association This event is raised when a state information object is received from the server This event is raised when an output object is received from the server This event is raised when an error record is received from the server This event is raised when an informational message - debug, verbose, warning, progress is received from the server This event is raised when a host call is targeted to the powershell This event is raised when a runspace pool data structure handler notifies an associated powershell data structure handler that its closed Event that is raised when a remote connection is successfully closed. The event is raised from a WSMan transport thread. Since this thread can hold on to a HTTP connection, the event handler should compelete processing as fast as possible. Importantly the event handler should not generate any call that results in a user request like host.ReadLine(). Errors (occurred during connection attempt) are reported through WSManTransportErrorOccured event. The eventhandler should make sure not to throw any exceptions. This event is raised when a runspace pool data structure handler notifies an associated powershell data structure handler that its broken This event is raised when reconnect async operation on the associated powershell/pipeline instance is completed This event is raised when connect async operation on the associated powershell/pipeline instance is completed This event is raised when a Robust Connection layer notification is available. Client PowerShell Id of the powershell this data structure handler is associated with transport manager used by this data structure handler Executes methods on the client. Transport manager. Client host. Client runspace pool id. Client power shell id. Remote host call. Constructor for ClientMethodExecutor. Create a new ClientMethodExecutor object and then dispatch it. Is runspace pushed. Execute. Execute. Execute. Execute void. Remote host call. Provides a reference to a runspace that can be used to temporarily push a remote runspace on top of a local runspace. This is primary used by Start-PSSession. The purpose of this class is to hide the CreatePipeline method and force it to be used as defined in this class. Runspace ref. Constructor for RunspaceRef. Revert. Parse ps command using script block. Create ps command. Creates the PSCommand when the runspace is not overriden Create pipeline. Create pipeline. Create nested pipeline. Override. Override inside a safe lock runspace to override object to use in synchronization set is runspace pushed Runspace. Is runspace overridden. This is the base class from which other classes should derive. This class defines the options for the specified configuration type. Returns a xml formatted data that represents the options Returns a new instance constructed from privateData string. Copies values from updated. Only non default values are copies. This the abstract class that defines the options for underlying transport layer. Returns all the non-quota options set in this object in a format of xml attributes. Returns all the non-quota options set in this object in a name-value pair (hashtable). Returns all the quota related options set in this object in a format of xml attributes. Returns all the quota related options in the form of a hashtable. Sets all the values to default values. If keepAssigned is true only those values are set which are unassigned. Clone from IClonable struct which describes whether an object written to an ObjectStream is of type - output, error, verbose, debug Handle the object obtained from an ObjectStream's reader based on its type cmdlet to use for outputting the object Used by Receive-Job to suppress inquire preference. Handle the object obtained from an ObjectStream's reader based on its type cmdlet to use for outputting the object Suppresses prompt on messages with Inquire preference. Needed for Receive-Job Handle the object obtained from an ObjectStream's reader based on its type cmdlet to use for outputting the object Overrides the inquire preference, used in Receive-Job to suppress prompts. Provides an enumerator for iterating through a multi-dimensional array. This is needed to encode multi-dimensional arrays in remote host methods. Current. Lengths. Constructor for Indexer. Check lengths non negative. Get enumerator. Reset. Move next. Current. The purpose of this class is to hide an object (mask it) and replace it with a substitute temporarily. This is used in pushing and popping runspaces. It is also used to temporarily set a PowerShell object's host as the Runspace object's host when the PowerShell object is executed. New value. Old value. Constructor for ObjectRef. Override. Revert. Old value. Value. Is overridden. This class is used to hold a fragment of remoting PSObject for transporting to remote computer. A large remoting PSObject will be broken into fragments. Each fragment has a ObjectId and a FragementId. The first fragment has a StartFragment marker. The last fragment also an EndFragment marker. These fragments can be reassembled on the receiving end by sequencing the fragment ids. Currently control objects (Control-C for stopping a pipeline execution) is not really fragmented. These objects are small. They are just wrapped into a single fragment. SFlag stands for the IsStartFragment. It is the bit value in the binary encoding. EFlag stands for the IsEndFragment. It is the bit value in the binary encoding. HeaderLength is the total number of bytes in the binary encoding header. _objectIdOffset is the offset of the ObjectId in the binary encoding. _fragmentIdOffset is the offset of the FragmentId in the binary encoding. _flagsOffset is the offset of the byte in the binary encoding that contains the SFlag, EFlag and CFlag. _blobLengthOffset is the offset of the BlobLength in the binary encoding. _blobOffset is the offset of the Blob in the binary encoding. Default Constructor Used to construct a fragment of PSObject to be sent to remote computer. ObjectId of the fragment. Caller should make sure this is not less than 0. FragmentId within the object. Caller should make sure this is not less than 0. true if this is a EndFragment. This method generate a binary encoding of the FragmentedRemoteObject as follows: ObjectId: 8 bytes as long, byte order is big-endian. this value can only be non-negative. FragmentId: 8 bytes as long, byte order is big-endian. this value can only be non-negative. FlagsByte: 1 byte: 0x1 if IsStartOfFragment is true: This is called S-flag. 0x2 if IsEndOfFragment is true: This is called the E-flag. 0x4 if IsControl is true: This is called the C-flag. The other bits are reserved for future use. Now they must be zero when sending, and they are ignored when receiving. BlobLength: 4 bytes as int, byte order is big-endian. this value can only be non-negative. Blob: BlobLength number of bytes. 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | +-+-+-+-+-+-+-+- ObjectId +-+-+-+-+-+-+-+-+ | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | +-+-+-+-+-+-+-+- FragmentId +-+-+-+-+-+-+-+-+ | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |reserved |C|E|S| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | BlobLength | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Blob ... +-+-+-+-+-+-+-+- The binary encoded FragmentedRemoteObject to be ready to pass to WinRS Send API. Extract the objectId from a byte array, starting at the index indicated by startIndex parameter. The objectId. If fragmentBytes is null. If startIndex is negative or fragmentBytes is not large enought to hold the entire header of a binary encoded FragmentedRemoteObject. Extract the FragmentId from the byte array, starting at the index indicated by startIndex parameter. If fragmentBytes is null. If startIndex is negative or fragmentBytes is not large enought to hold the entire header of a binary encoded FragmentedRemoteObject. Extract the IsStartFragment value from the byte array, starting at the index indicated by startIndex parameter. True is the S-flag is set in the encoding. Otherwise false. If fragmentBytes is null. If startIndex is negative or fragmentBytes is not large enought to hold the entire header of a binary encoded FragmentedRemoteObject. Extract the IsEndFragment value from the byte array, starting at the index indicated by startIndex parameter. True if the the E-flag is set in the encoding. Otherwise false. If fragmentBytes is null. If startIndex is negative or fragmentBytes is not large enought to hold the entire header of a binary encoded FragmentedRemoteObject. Extract the BlobLength value from the byte array, starting at the index indicated by startIndex parameter. The BlobLength value. If fragmentBytes is null. If startIndex is negative or fragmentBytes is not large enought to hold the entire header of a binary encoded FragmentedRemoteObject. All fragments of the same PSObject have the same ObjectId FragmentId starts from 0. It increases sequentially by an increment of 1. The first fragment of a PSObject. The last fragment of a PSObject. Blob length. This enables scenarios where entire byte[] is not filled for the fragment. This is the actual data in bytes form. A stream used to store serialized data. This stream holds serialized data in the form of fragments. Every "fragment size" data will hold a blob identifying the fragment. The blob has "ObjectId","FragmentId","Properties like Start,End","BlobLength" Creates a stream to hold serialized data. fragmentSize to be used while creating fragment boundaries. Use this constructor carefully. This will not write data into internal streams. Instead this will make the SerializedDataStream call the callback whenever a fragmented data is available. It is upto the caller to figure out what to do with the data. fragmentSize to be used while creating fragment boundaries. If this is not null, then callback will get notified whenever fragmented data is available. Read() will return null in this case always. Start using the stream exclusively (to write data). The stream can be entered only once. If you want to Enter again, first Exit and then Enter. This method is not thread-safe. Notify that the stream is not used to write anymore. This method is not thread-safe. Writes a block of bytes to the current stream using data read from buffer. The base MemoryStream is written to only if "FragmentSize" is reached. The buffer to read data from. The byte offset in buffer at which to begin writing from. The maximum number of bytes to write. Writes a byte to the current stream. Returns a byte[] which holds data of fragment size (or) serialized data of one object, which ever is greater. If data is not currently available, then the callback is registerd and called whenever the data is available. callback to call once the data becomes available. a byte[] holding data read from the stream Read the currently accumulated data in queued memory streams This method provides a thread safe way to get an object id. An object Id in integer. This is a No-Op intentionally as there is nothing to flush. Gets the length of the stream in bytes. Callback that is called once a fragmented data is available. Data that resulted in this callback. true if data represents EndFragment of an object. This class performs the fragmentation as well as defragmentation operations of large objects to be sent to the other side. A large remoting PSObject will be broken into fragments. Each fragment has a ObjectId and a FragementId. The last fragment also has an end of fragment marker. These fragments can be reassembled on the receiving end by sequencing the fragment ids. Constructor which initializes fragmentor with FragmentSize. size of each fragment The method performs the fragmentation operation. All fragments of the same object have the same ObjectId. All fragments of the same object have the same ObjectId. Each fragment has its own Fragment Id. Fragment Id always starts from zero (0), and increments sequentially with an increment of 1. The last fragment is indicated by an End of Fragment marker. The object to be fragmented. Caller should make sure this is not null. Caller specified dataToStore to which the fragements are added one-by-one Serialize an PSObject into a byte array. Converts the bytes back to PSObject. The bytes to be deserialized. The deserialized object. If the deserialized object is null. The deserialization context used by this fragmentor. DeserializationContext controls the amount of memory a deserializer can use and other things. The size limit of the fragmented object. TypeTable used for Serialization/Deserialization. Data from network converted to type RemoteSessionCapability. Actual data received from the network. This event arg is designed to contain generic data received from the other side of the connection. It can be used for both the client side and for the server side. Received data. This event arg contains data received and is used to pass information from a data structure handler to its object type of data that's associated The data contained within this event This defines the various states a remote connection can be in. Undefined state This is the state a connect start with. When a connection is closed, the connection will eventually come back to this Idle state. A connection operation has been initiated. A connection operation has completed successfully. The capability negotiation message is in the process being sent on a create operation The capability negotiation message is in the process being sent on a connect operation The capability negotiation message is sent successfully from a sender point of view. A capability negotiation message is received. Used by server to wait for negotation from client. The connection is in the progress of getting closed. The connection is closed completely. The capability negotiation has been successfully completed. Have sent a public key to the remote end, awaiting a response Applicable only to client Have received a public key from the remote end, need to send a response Applicable only to server for Server - Have sent a request to the remote end to send a public key for Cleint - have received a PK request from server Applicable to both cleint and server Key exchange complete. This can mean (a) Sent an encrypted session key to the remote end in response to receiving a public key - this is for the server (b) Received an encrypted session key from remote end after sending a public key - this is for the client A disconnect operation initiated by the WinRM robust connection layer and *not* by the user. Number of states This defines the internal events that the finite state machine for the connection uses to take action and perform state transitions. This is a wrapper class for RemoteSessionState. State of the connection If the connection is closed, this provides reason why it had happened. This is the event arg that contains the state information. State information about the connection. Defines the various types of remoting behaviour that a cmdlet may desire when used in a context that supports ambient / automatic remoting. In the presence of ambient remoting, this command should still be run locally. In the presence of ambient remoting, this command should be run on the target computer using PowerShell Remoting. In the presence of ambient remoting, this command supports its own form of remoting which can be used instead to target the remote computer. In the presence of ambient remoting, the command assumes all responsibility for targetting the remote computer; PowerShell Remoting is not supported. Controls or overrides the remoting behavior, during invocation, of a command that supports ambient remoting. In the presence of ambient remoting, run this command locally. In the presence of ambient remoting, run this command on the target computer using PowerShell Remoting. In the presence of ambient remoting, and a command that declares 'SupportedByCommand' remoting capability, run this command on the target computer using the command's custom remoting facilities. This enum defines the error message ids used by the resource manager to get localized messages. Related error ids are organized in a pre-defined range of values. This static class defines the resource base name used by remoting errors. It also provides a convenience method to get the localized strings. This is the resource base name used by the remoting errors. This method is a convenience method to retrieve the localized string. This parameter holds the string in the resource file. Optional parameters required by the resource string formating information. The formatted localized string. This exception is used by remoting code to indicated a data structure handler related error. Default construtor. This constuctor takes a localized string as the error message. A localized string as an error message. This constuctor takes a localized string as the error message, and an inner exception. A localized string as an error message. Inner exception. This constructor takes an error id and optional parameters. The resource string in the base resource file. Optional parameters required to format the resource string. This constuctor takes an inner exception and an error id. Inner excetion. The resource string in the base resource file. Optional parameters required to format the resource string. This constructor is required by serialization. Set the default ErrorRecord. This exception is used by remoting code to indicate an error condition in network operations. This is the default constructor. This constructor takes a localized error message. A localized error message. This constructor takes a localized message and an inner exception. Localized error message. Inner exception. This constructor takes an error id and optional parameters. The error id in the base resource file. The resource string in the base resource file. Optional parameters required to format the resource string. This constuctor takes an inner exception and an error id. Inner excetion. The resource string in the base resource file. Optional parameters required to format the resource string. This constructor is required by serialization. 1. info is null. Serializes the exception data. serialization information streaming context Set the default ErrorRecord. The error code from native library API call. This the message from the native transport layer. This exception is used by PowerShell's remoting infrastructure to notify a URI redirection exception. This is the default constructor. This constructor takes a localized error message. A localized error message. This constructor takes a localized message and an inner exception. Localized error message. Inner exception. This constuctor takes an inner exception and an error id. Inner excetion. The resource string in the base resource file. Optional parameters required to format the resource string. This constructor is required by serialization. 1. info is null. This constructor takes an redirect URI, error id and optional parameters. String specifying a redirect location. The error id in the base resource file. The resource string in the base resource file. Optional parameters required to format the resource string. Serializes the exception data. serialization information streaming context String specifying a redirect location. Defines the different states of the operation Start operation completed successfully Stop operation completed successfully class describing event args which a helper class implementing IThrottleOperation need to throw operation state the original event which actually resulted in this event being raised Class which handles the throttling operations. This class is singleton and therefore when used either across cmdlets or at the infrastructure level it will ensure that there aren't more operations by way of accumalation than what is intended by design. This class contains a queue of items, each of which has the IThrottleOperation interface implemented. To begin with THROTTLE_LIMIT number of items will be taken from the queue and the operations on them will be executed. Subsequently, as and when operations complete, new items from the queue will be taken and their operations executed. Whenever a consumer submits or adds operations, the methods will start as much operations from the queue as permitted based on the throttle limit. Also the event handler will start an operation once a previous event is completed. The queue used is a generic queue of type IThrottleOperations, as it will offer better performance Throttle limit is currently set to 50. This value may be modified later based on a figure that we may arrive at out of experience. Submit a list of operations that need to be throttled list of operations to be throttled Once the operations are added to the queue, the method will start operations from the queue Add a single operation to the queue Operation to be added Stop throttling operations Calling this method will also affect other cmdlets which could have potentially submitComplete operations for processing number of objects cleared from queue without being stopped Stop the specified operation operation which needs to be stopped Signals that no more operations can be submitComplete for throttling Public constructor Handler which handles state change for the object which implements the interface sender of the event Event information object which describes the event which triggered this method Method used to start the operation on one item in the queue Start operations to the limit possible from the queue Raise the throttle manager events once the conditions are met default throttle limit - the maximum number of operations to be processed at a time Maximum value that the throttle limit can be set to All pending operations List of items on which a StartOperation has been called List of items on which a StopOperation has been called Object used to synchronize access to the queues Dispose method of IDisposable. Any cmdlet that uses the throttle manager needs to call this method from its Dipose method Internal dispose method which does the actual dispose operations and finalize suppressions If method is called from disposing of destructor Allows the consumer to override the default throttle limit Event raised when throttling all operations is complete Blocks caller trying to get the value of an object of type T until the value is set. After the set all future gets are unblocked. Value. Value was set. Constructor for AsyncObject. Value. Different Authentication Mechanisms supported by New-Runspace command to connect to remote server. Use the default authentication (as defined by the underlying protocol) for establishing a remote connection. Use Basic authentication for establishing a remote connection. Use Negotiate authentication for establishing a remote connection. Use Negotiate authentication for establishing a remote connection. Allow implicit credentials for Negotiate. Use CredSSP authentication for establishing a remote connection. Use Digest authentication mechanism. Digest authentication operates much like Basic authentication. However, unlike Basic authentication, Digest authentication transmits credentials across the network as a hash value, also known as a message digest. The user name and password cannot be deciphered from the hash value. Conversely, Basic authentication sends a Base 64 encoded password, essentially in clear text, across the network. Use Kerberos authentication for establishing a remote connection. Specifies the type of session configuration that should be used for creating a connection info Default PowerShell remoting endpoint Default Workflow endpoint Specify the type of access mode that should be used when creating a session configuration Disable the configuration Allow local access Default allow remote access WSManTransportManager supports disconnected PowerShell sessions. When a remote PS session server is in disconnected state, output from the running command pipeline is cached on the server. This enum determines what the server does when the cache is full. No output buffering mode specified. Output buffering mode on server will default to Block if a new session is created, or will retain its current mode for non-creation scenarios (e.g., disconnect/connect operations). Command pipeline execution continues, excess output is dropped in FIFO manner. Command pipeline execution on server is blocked until session is reconnected. Class which defines connection path to a remote runspace that needs to be created. Transport specific connection paths will be derived from this Populates session options from a PSSessionOption instance. Name of the computer Credential used for the connection Authentication mechanism to use while connecting to the server ThumbPrint of a certificate used for connecting to a remote machine. When this is specified, you dont need to supply credential and authentication mechanism. Culture that the remote session should use UI culture that the remote session should use The duration (in ms) for which PowerShell remoting waits before timing out on a connection to a remote machine. Simply put, the timeout for a remote runspace creation. The administrator would like to tweak this timeout depending on whether he/she is connecting to a machine in the data center or across a slow WAN. The duration (in ms) for which PowerShell should wait before it times out on cancel operations (close runspace or stop powershell). For instance, when the user hits ctrl-C, New-PSSession cmdlet tries to call a stop on all remote runspaces which are in the Opening state. The administrator wouldn’t mind waiting for 15 seconds, but this should be time bound and of a shorter duration. A high timeout here like 3 minutes will give the administrator a feeling that the PowerShell client has hung. The duration for which PowerShell remoting waits before timing out for any operation. The user would like to tweak this timeout depending on whether he/she is connecting to a machine in the data center or across a slow WAN. Default: 3*60*1000 == 3minutes The duration (in ms) for which a Runspace on server needs to wait before it declares the client dead and closes itself down. This is especially important as these values may have to be configured differently for enterprise administration and exchange scenarios. This info is filled using info sent from server Class which defines path to a remote runspace that need to be created string for http scheme string for https scheme Default disconnected server output mode is set to None. This mode allows the server to set the buffering mode to Block for new sessions and retain its current mode during disconnect/connect operations. default port for http scheme default port for https scheme This is the default port value which when specified results in the default port for the scheme to be assumed default remote host name Maximum value for port Minimum value for port String that represents the local host Uri Default value for shell Default credentials - null indicates credentials of current user Constructor used to create a WSManConnectionInfo computer to connect to scheme to be used for connection port to connect to application end point to connect to remote shell to launch on connection credential to be used for connection Timeout in milliseconds for open call on Runspace to finish Invalid scheme or invalid port is specified Constructor used to create a WSManConnectionInfo computer to connect to Scheme to be used for connection. port to connect to application end point to connect to remote shell to launch on connection credential to be used for connection Invalid scheme or invalid port is specified max server life timeout and open timeout are default in this case Constructor used to create a WSManConnectionInfo Creates a WSManConnectionInfo for the following URI and with the default credentials, default server life time and default open timeout http://localhost/ The default shellname Microsoft.PowerShell will be used Constructor to create a WSManConnectionInfo with a uri and explicit credentials - server life time is default and open timeout is default uri of remote runspace credentials to use to connect to the remote runspace When an uri representing an invalid path is specified Constructor used to create a WSManConnectionInfo. This constructor supports a certificate thumbprint to be used while connecting to a remote machine instead of credential. uri of remote runspace A thumb print of the certificate to use while connecting to the remote machine. constructor to create a WSManConnectionInfo with a uri specified and the default credentials, default server life time and default open timeout uri of remote runspae When an uri representing an invalid path is specified Populates session options from a PSSessionOption instance. 1. Proxy credential cannot be specified when proxy accesstype is None. Either specify a valid proxy accesstype other than None or do not specify proxy credential. Does a shallow copy of the current instance Converts to a WSManConnectionInfo. If conversion succeeds extracts the propery..otherwise returns default value Constructs a Uri from the supplied parameters. Making the port nullable to make sure the UseDefaultWSManPort variable is protected and updated only when Port is updated. Usages that dont update port, should use null for this parameter. returns connection string without the scheme portion. The uri from which the string will be extracted returns true if https scheme is specified returns connection string without the scheme portion. Used to resolve authentication from the parameters chosen by the user. User has the following options: 1. AuthMechanism + Credential 2. CertiticateThumbPrint All the above are mutually exclusive. If there is ambiguity as specified above. Default appname. This is empty as WSMan configuration has support for this. Look at get-item WSMan:\localhost\Client\URLPrefix Constructor that constructs the configuration name from its type type of configuration to construct Uri associated with this connection path Name of the computer Scheme used for connection Port in which to connect AppName which identifies the connection end point in the machine Credential used for the connection Authentication mechanism to use while connecting to the server AuthenticationMaechanism converted to WSManAuthenticationMechanism type. This is internal. Allow default credentials for Negotiate Returns the actual port property value and not the ConnectionUri port. Internal only. ThumbPrint of a certificate used for connecting to a remote machine. When this is specified, you dont need to supply credential and authentication mechanism. Maximum uri redirection count Total data (in bytes) that can be received from a remote machine targeted towards a command. If null, then the size is unlimited. Default is unlimited data. Maximum size (in bytes) of a deserialized object received from a remote machine. If null, then the size is unlimited. Default is unlimited object size. If true, underlying WSMan infrastructure will compress data sent on the network. If false, data will not be compressed. Compression improves performance by reducing the amount of data sent on the network. Compression my require extra memory consumption and CPU usage. In cases where available memory / CPU is less, set this property to false. By default the value of this property is "true". If true then Operating System won't load the user profile (i.e. registry keys under HKCU) on the remote server which can result in a faster session creation time. This option won't have any effect if the remote machine has already loaded the profile (i.e. in another session). By default, wsman uses IEConfig - the current user Internet Explorer proxy settings for the current active network connection. This option requires the user profile to be loaded, so the option can be directly used when called within a process that is running under an interactive user account identity; if the client application is running under a user context different then the interactive user, the client application has to explicitly load the user profile prior to using this option. IMPORTANT: proxy configuration is supported for HTTPS only; for HTTP, the direct connection to the server is used The following is the definition of the input parameter "ProxyAuthentication". This parameter takes a set of authentication methods the user can select from. The available options should be as follows: - Negotiate: Use the default authentication (ad defined by the underlying protocol) for establishing a remote connection. - Basic: Use basic authentication for establishing a remote connection - Digest: Use Digest authentication for establishing a remote connection The following is the definition of the input parameter "ProxyCredential". When connecting over HTTPS, the client does not validate that the server certificate is signed by a trusted certificate authority (CA). Use only when the remote computer is trusted by other means, for example, if the remote computer is part of a network that is physically secure and isolated or the remote computer is listed as a trusted host in WinRM configuration Indicates that certificate common name (CN) of the server need not match the hostname of the server. Used only in remote operations using https. This option should only be used for trusted machines. Indicates that certificate common name (CN) of the server need not match the hostname of the server. Used only in remote operations using https. This option should only be used for trusted machines Specifies that no encryption will be used when doing remote operations over http. Unencrypted traffix is not allowed by default and must be enabled in the local configuration Indicates the request is encoded in UTF16 format rather than UTF8 format; UTF8 is the default. Determines how server in disconnected state deals with cached output data when the cache becomes filled. Uses Service Principal Name (SPN) along with the Port number during authentication. When true and in loopback scenario (localhost) this enables creation of WSMan host process with the user interactive token, allowing PowerShell script network access, i.e., allows going off box. When this property is true and a PSSession is disconnected, reconnection is allowed only if reconnecting from a PowerShell session on the same box. Default scheme. As part of port DCR, WSMan changed the default ports from 80,443 to 5985,5986 respectively no-SSL,SSL connections. Since the standards say http,https use 80,443 as defaults..we came up with new mechanism to specify scheme as empty. For SSL, WSMan introduced a new SessionOption. In order to make scheme empty in the connection string passed to WSMan, we use this internal boolean. Helper property that returns true when the connection has EnableNetworkAccess set and the connection is localhost (loopback), i.e., not a network connection. Class which is used to create an Out-Of-Process Runspace/RunspacePool. This does not have a dependency on WSMan. *-Job cmdlets use Out-Of-Proc Runspaces to support background jobs. Creates a connection info instance used to create a runspace on a different process on the local machine Script to run while starting the background process. On a 64bit machine, specifying true for this will launch a 32 bit process for the background process. Powershell version to execute the job in Name of the computer. Will always be "localhost" to signify local machine. Credential used for the connection Authentication mechanism to use while connecting to the server. Only Default is supported. ThumbPrint of a certificate used for connecting to a remote machine. When this is specified, you dont need to supply credential and authentication mechanism. Will always be empty to signfy that this is not supported. Defines type which has information about RunspacePoolState and exception associated with that state This class is created so that a state change along with its reason can be transported from the server to the client in case of RemoteRunspacePool Constructor for creating the state info state exception that resulted in this state change. Can be null State of the runspace pool when this event occured Exception associated with that state Class that encapsulates the information carried by the RunspaceInitInfo PSRP message Constructor Min Runspaces setting on the server runspace pool Max Runspaces setting on the server runspace pool The ServerDispatchTable class. Provides a thread-safe dictionary that maps call-ids to AsyncData objects. When a thread tries to do a get on a hashtable key (callId) that has not been set it is blocked. Once the key's value is set the thread is released. This is used to synchronize server calls with their responses. This code needs to be thread-safe. The locking convention is that only the internal or public methods use locks and are thread-safe. The private methods do not use locks and are not thread-safe (unless called by the internal and public methods). If the private methods becomes internal or public please review the locking. Void call id. Response async objects. Next call id. Create new call id. Get response async object. Waits for response PSObject to be set and then returns it. Returns null if wait was aborted. default return value (in case the remote end did not send response). Set response. Abort call. Abort calls. Get all calls. Abort all calls. Defines enumerations for the keywords Define enumerations for levels Defines enumerations for op codes Defines enumerations for event ids add an entry for a new event that you add to the manifest. Set it to the same value that was set in the manifest Defines enumerations for channels Defines enumerations for tasks Defines enumerations for version all messages in V2 timeframe should be of version 1 Describes a binary blob to be used as a data item for ETW. Constants used by hosts in remoting. String constants used for names of properties that are for storing remoting message fields in a PSObject property bag. This is the PSv2 function for tab expansion. It's only for legacy purpose - used in an interactive remote session from a win7 machine to a win8 machine (or later). Name of property when Exception is serialized as error record Property used for encoding state of pipeline when serializing PipelineStateInfo Property used for encoding state of runspace when serializing RunspaceStateInfo Properties used for serialization of PSEventArgs The destination of the remote message. The layer the remoting message is being communicated between. Please keep in sync with RemotingTargetInterface from C:\e\win7_powershell\admin\monad\nttargets\assemblies\logging\ETW\Manifests\Microsoft-Windows-PowerShell-Instrumentation.man The type of the remoting message. Please keep in sync with RemotingDataType from C:\e\win7_powershell\admin\monad\nttargets\assemblies\logging\ETW\Manifests\Microsoft-Windows-PowerShell-Instrumentation.man This data type is used when an Exception derived from IContainsErrorRecord is caught on server and is sent to client. This exception gets serialized as an error record. On the client this data type is deserialized in to an ErrorRecord. ErrorRecord on the client has an instance of RemoteException as exception. Converts C# types to PSObject properties for embedding in PSObjects transported across the wire. This method generates a Remoting data structure handler message for creating a RunspacePool on the server id of the clientRunspacePool minRunspaces for the RunspacePool to be created at the server maxRunspaces for the RunspacePool to be created at the server local runspace pool host for the runspacepool at the client end from this host, information will be extracted and sent to server Application arguments the server can see in data structure handler message encoded as RemoteDataObject The message format is as under for this message -------------------------------------------------------------------------------------- | D | TI | RPID | PID | Action | Data | Type | -------------------------------------------------------------------------------------- | S | Session | CRPID | 0 | CreateRuns | minRunspaces, | InvalidDataType | | | | | | pacePool | maxRunspaces, | | | | | | | | threadOptions, | | | | | | | | apartmentState,| | | | | | | | hostInfo | | | | | | | | appParameters | | -------------------------------------------------------------------------------------- This method generates a Remoting data structure handler message for creating a RunspacePool on the server id of the clientRunspacePool minRunspaces for the RunspacePool to be created at the server maxRunspaces for the RunspacePool to be created at the server data structure handler message encoded as RemoteDataObject The message format is as under for this message -------------------------------------------------------------------------------------- | D | TI | RPID | PID | Action | Data | Type | -------------------------------------------------------------------------------------- | S | Runspace | CRPID | 0 | ConnectRun | minRunspaces, | InvalidDataType | | | | | | spacePool | maxRunspaces, | | | | | | | | | | -------------------------------------------------------------------------------------- Generates a response message to ConnectRunspace that includes sufficient information to construction client RunspacePool state id of the clientRunspacePool minRunspaces for the RunspacePool to be created at the server maxRunspaces for the RunspacePool to be created at the server data structure handler message encoded as RemoteDataObject The message format is as under for this message -------------------------------------------------------------------------------------- | D | TI | RPID | PID | Action | Data | Type | -------------------------------------------------------------------------------------- | C | Runspace | CRPID | 0 | RunspacePo | minRunspaces, | InvalidDataType | | | | | | olInitData | maxRunspaces, | | | | | | | | | | -------------------------------------------------------------------------------------- This method generates a Remoting data structure handler message for modifying the maxrunspaces of the specified runspace pool on the server id of the clientRunspacePool new value of maxRunspaces for the specified RunspacePool call id of the call at client data structure handler message encoded as RemoteDataObject The message format is as under for this message -------------------------------------------------------------------------------------- | D | TI | RPID | PID | Action | Data | Type | -------------------------------------------------------------------------------------- | S | Runspace | CRPID | 0 | SetMax | maxRunspaces | InvalidDataType | | | Pool | | | Runspaces | | | | | | | | | | | -------------------------------------------------------------------------------------- This method generates a Remoting data structure handler message for modifying the maxrunspaces of the specified runspace pool on the server id of the clientRunspacePool new value of minRunspaces for the specified RunspacePool call id of the call at client data structure handler message encoded as RemoteDataObject The message format is as under for this message -------------------------------------------------------------------------------------- | D | TI | RPID | PID | Action | Data | Type | -------------------------------------------------------------------------------------- | S | Runspace | CRPID | 0 | SetMin | minRunspaces | InvalidDataType | | | Pool | | | Runspaces | | | | | | | | | | | -------------------------------------------------------------------------------------- This method generates a Remoting data structure handler message for that contains a repsonse to SetMaxRunspaces or SetMinRunspaces id of the clientRunspacePool call id of the call at client response to the call data structure handler message encoded as RemoteDataObject The message format is as under for this message -------------------------------------------------------------------------------------- | D | TI | RPID | PID | Action | Data | Type | -------------------------------------------------------------------------------------- | S | Runspace | CRPID | 0 | SetMax | maxRunspaces | InvalidDataType | | | Pool | | | Runspaces | | | | | | | | | | | -------------------------------------------------------------------------------------- This method generates a Remoting data structure handler message for getting the available runspaces on the server guid of the runspace pool on which this needs to be queried call id of the call at the client data structure handler message encoded as RemoteDataObject The message format is as under for this message -------------------------------------------------------------------------- | D | TI | RPID | PID | Data | Type | --------------------------------------------------------------------------- | S | Runspace | CRPID | 0 | null |GetAvailalbeRunspaces | | | Pool | | | | | -------------------------------------------------------------------------- This method generates a remoting data structure handler message for transfering a roles public key to the other side runspace pool id public key to send across destination that this message is targetted to data strucutre message The message format is as under for this message -------------------------------------------------------------------------- | D | TI | RPID | PID | Data | Type | --------------------------------------------------------------------------- | S | Runspace | CRPID | 0 | public | PublicKey | | | Pool | | | key | | -------------------------------------------------------------------------- This method generates a remoting data structure handler message for requesting a public key from the client to the server runspace pool id data strucutre message The message format is as under for this message -------------------------------------------------------------------------- | D | TI | RPID | PID | Data | Type | --------------------------------------------------------------------------- | S | Runspace | CRPID | 0 | | PublicKeyRequest | | | Pool | | | | | -------------------------------------------------------------------------- This method generates a remoting data structure handler message for sending an encrypted session key to the client runspace pool id encrypted session key data strucutre message The message format is as under for this message -------------------------------------------------------------------------- | D | TI | RPID | PID | Data | Type | --------------------------------------------------------------------------- | S | Runspace | CRPID | 0 | encrypted | EncryptedSessionKey | | | Pool | | | session key | | -------------------------------------------------------------------------- This methods generates a Remoting data structure handler message for creating a command discovery pipeline on the server The client remote powershell from which the message needs to be generated. The data is extracted from parameters of the first command named "Get-Command". data structure handler message encoded as RemoteDataObject The message format is as under for this message ------------------------------------------------------------------------- | D | TI | RPID | PID | Data | Type | -------------------------------------------------------------------------- | S | Runspace | CRPID | CPID | name, | GetCommandMetadata | | | Pool | | | commandType, | | | | | | | module, | | | | | | | argumentList | | -------------------------------------------------------------------------- This methods generates a Remoting data structure handler message for creating a PowerShell on the server The client remote powershell from which the create powershell message needs to be generated data structure handler message encoded as RemoteDataObject The message format is as under for this message ------------------------------------------------------------------------- | D | TI | RPID | PID | Data | Type | -------------------------------------------------------------------------- | S | Runspace | CRPID | CPID | serialized | CreatePowerShell | | | Pool | | | powershell, | | | | | | | noInput, | | | | | | | hostInfo, | | | | | | | invocationset | | | | | | | tings, stream | | | | | | | options | | -------------------------------------------------------------------------- This method creates a remoting data structure handler message for transporting application private data from server to client id of the client RunspacePool application private data data structure handler message encoded as RemoteDataObject The message format is as under for this message -------------------------------------------------------------------------------------- | D | TI | RPID | PID | Action | Data | Type | -------------------------------------------------------------------------------------- | C | Runspace | CRPID | -1 | Data | appl. private | PSPrimitive | | | Pool | | | | data | Dictionary| -------------------------------------------------------------------------------------- This method creates a remoting data structure handler message for transporting a state information from server to client id of the client RunspacePool State information object data structure handler message encoded as RemoteDataObject The message format is as under for this message -------------------------------------------------------------------------------------- | D | TI | RPID | PID | Action | Data | Type | -------------------------------------------------------------------------------------- | C | Runspace | CRPID | -1 | Data | RunspacePool | RunspacePoolState | | | Pool | | | | StateInfo | Info | -------------------------------------------------------------------------------------- This method creates a remoting data structure handler message for transporting a PowerShell event from server to client id of the client RunspacePool PowerShell event data structure handler message encoded as RemoteDataObject The message format is as under for this message -------------------------------------------------------------------------------------- | D | TI | RPID | PID | Action | Data | Type | -------------------------------------------------------------------------------------- | C | Runspace | CRPID | -1 | Data | RunspacePool | PSEventArgs | | | Pool | | | | StateInfo | | -------------------------------------------------------------------------------------- Returns the PS remoting protocol version associated with the provided RunspacePool PS remoting protocol version This method creates a remoting data structure handler message for sending a powershell input data from the client to the server input data to send client runspace pool id client powershell id data structure handler message encoded as RemoteDataObject The message format is as under for this message -------------------------------------------------------------------------------------- | D | TI | RPID | PID | Action | Data | Type | -------------------------------------------------------------------------------------- | S |PowerShell | CRPID | CPID | Data | intput data | PowerShellInput | | | | | | | | | -------------------------------------------------------------------------------------- This method creates a remoting data structure handler message for signalling end of input data for powershell client runspace pool id client powershell id data structure handler message encoded as RemoteDataObject The message format is as under for this message -------------------------------------------------------------------------------------- | D | TI | RPID | PID | Action | Data | Type | -------------------------------------------------------------------------------------- | S |PowerShell | CRPID | CPID | Data | bool. | PowerShellInputEnd | | | | | | | TrueString | | -------------------------------------------------------------------------------------- This method creates a remoting data structure handler message for transporting a powershell output data from server to client data to be sent id of client powershell to which this information need to be delivered id of client runspacepool associated with this powershell data structure handler message encoded as RemoteDataObject The message format is as under for this message -------------------------------------------------------------------------------------- | D | TI | RPID | PID | Action | Data | Type | -------------------------------------------------------------------------------------- | C |PowerShell | CRPID | CPID | Data | data to send | PowerShellOutput | | | | | | | | | -------------------------------------------------------------------------------------- This method creates a remoting data structure handler message for transporting a powershell informational message (debug/verbose/warning/progress)from server to client data to be sent id of client powershell to which this information need to be delivered id of client runspacepool associated with this powershell data type of this informational message data structure handler message encoded as RemoteDataObject The message format is as under for this message -------------------------------------------------------------------------------------- | D | TI | RPID | PID | Action | Data | Type | -------------------------------------------------------------------------------------- | C |PowerShell | CRPID | CPID | Data | data to send | DataType - debug, | | | | | | | | verbose, warning | -------------------------------------------------------------------------------------- This method creates a remoting data structure handler message for transporting a powershell progress message from server to client progress record to send id of client powershell to which this information need to be delivered id of client runspacepool associated with this powershell data structure handler message encoded as RemoteDataObject The message format is as under for this message -------------------------------------------------------------------------------------- | D | TI | RPID | PID | Action | Data | Type | -------------------------------------------------------------------------------------- | C |PowerShell | CRPID | CPID | Data | progress | PowerShellProgress | | | | | | | message | | -------------------------------------------------------------------------------------- This method creates a remoting data structure handler message for transporting a powershell error record from server to client error record to be sent id of client powershell to which this information need to be delivered id of client runspacepool associated with this powershell data structure handler message encoded as RemoteDataObject The message format is as under for this message -------------------------------------------------------------------------------------- | D | TI | RPID | PID | Action | Data | Type | -------------------------------------------------------------------------------------- | C |PowerShell | CRPID | CPID | Data | error record | PowerShellError | | | | | | | to send | | -------------------------------------------------------------------------------------- This method creates a remoting data structure handler message for transporting a powershell state information from server to client state information object id of client powershell to which this information need to be delivered id of client runspacepool associated with this powershell data structure handler message encoded as RemoteDataObject The message format is as under for this message -------------------------------------------------------------------------------------- | D | TI | RPID | PID | Action | Data | Type | -------------------------------------------------------------------------------------- | C |PowerShell | CRPID | CPID | Data | PSInvocation | PowerShellStateInfo | | | | | | | StateInfo | | -------------------------------------------------------------------------------------- Gets the error record from exception of type IContainsErrorRecord. ErrorRecord if exception is of type IContainsErrorRecord Null if if exception is not of type IContainsErrorRecord Gets a Note Property for the exception. ErrorId to use if exception is not of type IContainsErrorRecord ErrorCategory to use if exception is not of type IContainsErrorRecord This method creates a remoting data structure handler message for transporting a session capability message. Should be used by client. RemoteSession capability object to encode data structure handler message encoded as RemoteDataObject The message format is as under for this message -------------------------------------------------------------------------------------- | D | TI | RPID | PID | Action | Data | Type | -------------------------------------------------------------------------------------- | C | Session | RPID | Empty | Data | session | SessionCapability | | / | | | | | capability | | | S | | | | | | | -------------------------------------------------------------------------------------- Converts fields of PSObjects containing remoting messages to C# types. decode and obtain the RunspacePool state info from the data object specified data object to decode RunspacePoolStateInfo decode and obtain the application private data from the data object specified data object to decode application private data Gets the public key from the encoded message data object to decode public key as string Gets the encrypted session key from the encoded message data object to decode encrypted session key as string decode and obtain the RunspacePool state info from the data object specified data object to decode RunspacePoolStateInfo decode and obtain the minimum runspaces to create in the runspace pool from the data object specified data object to decode minimum runspaces decode and obtain the maximum runspaces to create in the runspace pool from the data object specified data object to decode maximum runspaces decode and obtain the thread options for the runspaces in the runspace pool from the data object specified data object to decode thread options Generates RunspacePoolInitInfo object from a recevied PSObject data object to decode RunspacePoolInitInfo generated decode and obtain the thread options for the runspaces in the runspace pool from the data object specified data object to decode thread options decode and obtain the host info for the host associated with the runspace pool dataAsPSObject object to decode host information Gets the exception if any from the serializaed state info object Get the exception from serialized error record Gets the output from the message object to decode output object the current implementation does nothing, however this method is there in place as the packaging of output data may change in the future Gets the PSInvocationStateInfo from the data object to decode PSInvocationInfo Gets the ErrorRecord from the message data to decode error record Gets the WarningRecord from the message Gets the VerboseRecord from the message Gets the DebugRecord from the message Gets the ProgressRecord from the message Gets the PowerShell object from the specified data data to decode Deserialized PowerShell object Gets the PowerShell object from the specified data data to decode Deserialized PowerShell object Gets the NoInput setting from the specified data data to decode true if there is no pipeline input; false otherwise Gets the AddToHistory setting from the specified data data to decode true if there is addToHistory data; false otherwise Gets the IsNested setting from the specified data data to decode true if there is IsNested data; false otherwise Gets the invocation settings information from the message Gets the stream options from the message Decodes a RemoteSessionCapability object data to decode RemoteSessionCapability object Checks if the server supports batch invocation runspace instance true if batch invocation is supported, false if not Executes methods; can be encoded and decoded for transmission over the wire. Method info. Call id. Computer name to be used in messages Constructor for RemoteHostCall. Encode parameters. Decode parameters. Encode. Decode. Execute void method. Get remote runspace to close. Execute non void method. Execute non void method on object. Get the object that this method should be invoked on. This message performs various security checks on the remote host call message. If there is a need to modify the message or discard it for security reasons then such modifications will be made here computer name to use in warning messages a collection of remote host calls which will have to be executed before this host call can be executed Provides the modified caption for the given caption Used in ensuring that remote prompt messages are tagged with "Windows PowerShell Credential Request" caption to modify new modified caption Provides the modified message for the given one Used in ensuring that remote prompt messages contain a warning that they originate from a different computer original message to modify computername to include in the message message which contains a warning as well Creates a warning message which displays to the user a warning stating that the remote host computer is actually attempting to read a line as a secure string computer name to include in warning resource string to use a constructed remote host call message which will display the warning Creates a warning message which displays to the user a warning stating that the remote host computer is attempting to read the host's buffer contents and that it was suppressed computer name to include in warning a constructed remote host call message which will display the warning Method name. Method id. Parameters. Call id. Is void method. My method base. Is set should exit. Is set should exit or pop runspace. Encapsulates the method response semantics. Method responses are generated when RemoteHostCallPacket objects are executed. They can contain both the return values of the execution as well as exceptions that were thrown in the RemoteHostCallPacket execution. They can be encoded and decoded for transporting over the wire. A method response can be used to transport the result of an execution and then to simulate the execution on the other end. Call id. Method id. Return value. Exception. Constructor for RemoteHostResponse. Simulate execution. Encode and add return value. Decode return value. Encode and add exception. Decode exception. Encode. Decode. Call id. The RemoteHostExceptions class. New remote runspace does not support push runspace exception. New decoding failed exception. New not implemented exception. New remote host call failed exception. New decoding error for error record exception. New remote host data encoding not supported exception. New remote host data decoding not supported exception. New unknown target class exception. Encodes and decodes data types and exceptions for transmission across the wire. Used for transmitting remote host method call parameters, return values, and exceptions. The convention is that EncodeObject converts the objects into a type that can be serialized and deserialized without losing fidelity. For example, EncodeObject converts Version objects to string, and converts more complex classes into property bags on PSObjects. This guarantees that transmitting on the wire will not change the encoded object's type. Is known type. Is encoding allowed for class or struct. Encode class or struct. Decode class or struct. Is collection. Encode collection. Decode collection. Is dictionary. Encode dictionary. Decode dictionary. Encode ps object. Decode ps object. Encode exception. Decode exception. Upcast field description subclass and drop attributes. Encode object. Decode object. Encode and add as property. Decode property value. Encode object array. Decode object array. Encode object with type. Decode object with type. Array is zero based. Encode array. Decode array. Is object dictionary type. Encode object dictionary. Decode object dictionary. Safely get base object. Safely cast object. Safely get property value. This class contains information about the capability of one side of the connection. The client side and the server side will have their own capabilities. These two sets of capabilities will be used in a capability negotiation algorithm to determine if it is possible to establish a connection between the client and the server. Constructor for RemoteSessionCapability. should not be called from outside, use create methods instead Create client capability. Create server capability. This is static property which gets Current TimeZone in byte format by using ByteFormatter. This is static to make client generate this only once. Converts byte[] to TimeZone using BinaryFormatter. Gets the TimeZone of the destination machine. This may be null The HostDefaultDataId enum. The HostDefaultData class. Data. Private constructor to force use of Create. Has value. Set value. Get value. Returns null if host is null or if reading RawUI fields fails; otherwise returns a valid object. Indexer to provide clean access to data. The HostInfo class. Host default data. Is host null. Is host ui null. Is host raw ui null. Use runspace host. Constructor for HostInfo. Check host chain. Host default data. Is host null. Is host ui null. Is host raw ui null. Use runspace host. This is the object used by Runspace,pipeline,host to send data to remote end. Transport layer owns breaking this into fragments and sending to other end Constructs a RemoteDataObject from its individual components. Destination this object is going to. Payload type this object represents. Runspace id this object belongs to. PowerShell (pipeline) id this object belongs to. This may be null if the payload belongs to runspace. Actual payload. Creates a RemoteDataObject by deserialzing . Defragmetor used to deserialize an object. Seriliazes the object into the stream specified. The serialization mechanism uses UTF8 encoding to encode data. fragmentor used to serialize and fragment the object. Serializes only the header portion of the object. ie., runspaceId, powerShellId, destinaion and dataType. place where the serialized data is stored into. Gets the target (Runspace / Pipeline / Powershell / Host) the payload belongs to. Count of commands in progress The mediator will take actions from the StdIn stream and responds to them. It will replace StdIn,StdOut and StdErr stream with TextWriter.Null's. This is to make sure these streams are totally used by our Mediator. Responsible for routing messages from the server, blocking the callers and then waking them up when there is a response to their message. Default client pipeline id. Client runspace pool id. Client power shell id. Server dispatch table. Remote host call data type. Transport manager. Constructor for ServerMethodExecutor. Handle remote host response from client. Abort all calls. Execute void method. Execute void method. Execute method. Execute method. By design, on the server side, each remote connection is represented by a ServerRemoteSession object, which contains one instance of this class. This class holds 4 pieces of information. 1. Client capability: This is the capability received during the negotiation process. 2. Server capability: This comes from default parameters. 3. Client configuration: This holds the remote session related configuration parameters that the client sent to the server. This parameters can be changed and resent after the connection is established. 4. Server configuration: this holds the server sider configuration parameters. All these together define the connection level parameters. The constructor instantiates a server capability object and a server configuration using default values. This property represents the capability that the server receives from the client. This property is the server capability generated on the server side. True if negotiation from client is succeeded...in which case ClienCapability is the capability that server agreed with. This class is designed to be the server side controller of a remote connection. It contains a static entry point that the PowerShell server process will get into the server mode. At this entry point, a runspace configuration is passed in. This runspace configuration is used to instantiate a server side runspace. This class controls a remote connection by using a Session data structure handler, which in turn contains a Finite State Machine, and a transport mechanism. Raised when session is closed. This constructor inistantiates a ServerRemoteSession object and a ServerRemoteSessionDataStructureHandler object. Details about the user creating this session. The resource URI for which this session is being created Initialization Parameters xml passed by WSMan API. This data is read from the config xml. The transport manager this session should use to send/receive data Creates a server remote session for the supplied and . Initialization Parameters xml passed by WSMan API. This data is read from the config xml. InitialSessionState provider with does not exist on the remote server. Used by OutOfProcessServerMediator to create a remote session. This is the data dispatcher for the whole remote connection. This dispatcher is registered with the server side input queue's InputDataReady event. When the input queue has received data from client, it calls the InputDataReady listeners. This dispatcher distinguishes the negotiation packet as a special case. For all other data, it dispatches the data through Finite State Machines DoMessageReceived handler by raising the event MessageReceived. The FSM's DoMessageReceived handler further dispatches to the receiving components: such as runspace or pipeline which have their own data dispatching methods. This parameter is not used by the method, in this implementation. This parameter contains the remote data received from client. If the parameter is null. If the parameter does not contain remote data. If the destination of the data is not for server. Have received a public key from the other side Import or take other action based on the state sender of this event, unused event arguments which contains the remote public key Start the key exchange process Complete the Key exchange process Send an encrypted session key to the client Let the session clear its resources. ExecutesConnect. expects client capability and connect_runspacepool PSRP messages in connectData. If negotiation is successful and max and min runspaces in connect_runspacepool match the assiciated runspace pool parameters, it builds up server capability and runspace_initinfo in connectResponseData. This is a version of Connect that executes the whole connect alogirithm in one single hop. This algorithm is being executed synchronously without associating with state machine. The operation is being outside the statemachine becuase of multiple reasons assiciated with design simplicity - Support automatic disconnect and let wsman server stack take care of connection state - The response data should not travel in transports output stream but as part of connect response - We want this operation to be synchronous 1. InitialSessionState cannot be null. 2. Non existent InitialSessionState provider for the shellID This handler method runs the negotiation algorithm. It decides if the negotiation is succesful, or fails. This parameter contains the client negotiation capability packet. If the parameter is null. Handle session closing event to close runspace pool drivers this sesion is hosting. This handles closing of any resource used by this session. Resources used are RunspacePoolDriver, TransportManager. This is the server side remote session capability negotiation algorithm. This is the client capability that the server received from client. If the negotiation is on a connect (and not create) The method returns true if the capability negotiation is successful. Otherwise, it returns false. 1. PowerShell server does not support the PSVersion {1} negotiated by the client. Make sure the client is compatible with the build {2} of PowerShell. 2. PowerShell server does not support the SerializationVersion {1} negotiated by the client. Make sure the client is compatible with the build {2} of PowerShell. Used by Command Session to apply quotas on the command transport manager. This method is here because ServerRemoteSession knows about InitialSessionState. Command TransportManager to apply the quota on. This indicates the remote session object is Client, Server or Listener. This property returns the ServerRemoteSessionContext object created inside this object's contructor. This property returns the ServerRemoteSessionDataStructureHandler object created inside this object's contructor. This class implements a Finite State Machine (FSM) to control the remote connection on the server side. There is a similar but not identical FSM on the client side for this connection. The FSM's states and events are defined to be the same for both the client FSM and the server FSM. This design allows the client and server FSM's to be as similar as possible, so that the complexity of maintaining them is minimized. This FSM only controls the remote connection state. States related to runspace and pipeline are managed by runspace pipeline themselves. This FSM defines an event handling matrix, which is filled by the event handlers. The state transitions can only be performed by these event handlers, which are private to this class. The event handling is done by a single thread, which makes this implementation solid and thread safe. This implementation of the FSM does not allow the remote session to be reused for a connection after it is been closed. This design decision is made to simplify the implementation. However, the design can be easily modified to allow the reuse of the remote session to reconnect after the connection is closed. timer used for key exchange This constructor instantiates a FSM object for the server side to control the remote connection. It initializes the event handling matrix with event handlers. It sets the initial state of the FSM to be Idle. This is the remote session object. If the parameter is null. Helper method used by dependents to figure out if the RaiseEvent method can be short-circuited. This will be useful in cases where the dependent code wants to take action immediately instead of going through state machine. This method is used by all classes to raise a FSM event. The method will queue the event. The event queue will be handled in a thread safe manner by a single dedicated thread. This parameter contains the event to be raised. If the parameter is null. processes events in the queue. If there are no more events to process, then sets eventsInProcess variable to false. This will ensure that another thread which raises an event can then take control of processing the events This is the private version of raising a FSM event. It can only be called by the dedicated thread that processes the event queue. It calls the event handler in the right position of the event handling matrix. The parameter contains the actual FSM event. If the parameter is null. This is the handler for Start event of the FSM. This is the begining of everything else. From this moment on, the FSM will proceeds step by step to eventually reach Established state or Closed state. This parameter contains the FSM event. If the parameter is null. This is the handler for NegotiationPending event. NegotiationPending state can be in reached in the following cases 1. From Idle to NegotiationPending (during startup) 2. From Negotiation(Response)Sent to NegotiationPending. This parameter contains the FSM event. If the parameter is null. This is the handler for the NegotiationReceived event. It sets the new state to be NegotiationReceived. This parameter contains the FSM event. If the parameter is null. If the parameter is not NegotiationReceived event or it does not hold the client negotiation packet. This is the handler for NegotiationSending event. It sets the new state to be NegotiationSending, and sends the server side negotiation packet by queuing it on the output queue. This parameter contains the FSM event. If the parameter is null. This is the handler for NegotiationSendCompleted event. It sets the new state to be NegotiationSent. This parameter contains the FSM event. If the parameter is null. This is the handler for the NegotiationCompleted event. It sets the new state to be Established. It turns off the negotiation timeout timer. This parameter contains the FSM event. If the parameter is null. This is the handler for MessageReceived event. It dispatches the data to various components that uses the data. This parameter contains the FSM event. If the parameter is null. If the parameter does not contain remote data. This is the handler for ConnectFailed event. In this implementation, this should never happen. This is because the IO channel is stdin/stdout/stderr redirection. Therefore, the connection is a dummy operation. This parameter contains the FSM event. If the parameter is null. If the parameter does not contain ConnectFailed event. This is the handler for FatalError event. It directly calls the DoClose, which is the Close event handler. This parameter contains the FSM event. If the parameter is null. If the parameter does not contains FatalError event. Handle connect event - this is raised when a new client tries to connect to an existing session No changes to state. Calls into the session to handle any post connect operations This is the handler for Close event. It closes the connection. This parameter contains the FSM event. If the parameter is null. This is the handler for CloseFailed event. It simply force the new state to be Closed. This parameter contains the FSM event. If the parameter is null. This is the handler for CloseCompleted event. It sets the new state to be Closed. This parameter contains the FSM event. If the parameter is null. This is the handler for NegotiationFailed event. It raises a Close event to trigger the connection to be shutdown. This parameter contains the FSM event. If the parameter is null. This is the handler for NegotiationTimeout event. If the connection is already Established, it ignores this event. Otherwise, it raises a Close event to trigger a close of the connection. This parameter contains the FSM event. If the parameter is null. This is the handler for SendFailed event. This is an indication that the wire layer IO is no longer connected. So it raises a Close event to trigger a connection shutdown. This parameter contains the FSM event. If the parameter is null. This is the handler for ReceivedFailed event. This is an indication that the wire layer IO is no longer connected. So it raises a Close event to trigger a connection shutdown. This parameter contains the FSM event. If the parameter is null. This method contains all the logic for handling the state machine for key exchange. All the different scenarios are covered in this sender of this event, unused event args Handles the timeout for key exchange sender of this event arguments describing this event This method is designed to be a cleanup routine after the connection is closed. It can also be used for graceful shutdown of the server process, which is not currently implemented. Set the FSM state to a new state. The new state. Optional parameter that can provide additional information. This is currently not used. This is a readonly property available to all other classes. It gives the FSM state. Other classes can query for this state. Only the FSM itself can change the state. This abstract class defines the server side data structure handler that a remote connection has at the remote session level. There are two other data structure handler levels: 1) at the runspace level, 2) at the pipeline level. This session level data structure handler defines what can be done at the session level. Constructor does no special initialization. Makes a connect call asynchronously. Send capability negotiation asynchronously. Close the connection asynchronously. Message describing why the session is closing This method is used by the client data dispatching mechanism. This parameter contains the remote data from the client. This event indicates that a client's capability negotiation packet has been received. Event that raised when session datastructure handler is closing. This event indicates a request for creating a new runspace pool has been received on the server side A reference to the Finite State Machine. Transport manager used by this data structure handler Execution context used for stepping This class wraps a RunspacePoolInternal object. It is used to function as a server side runspacepool Default constructor for creating ServerSteppablePipelineDriver...Used by server to concurrently run 2 pipelines. decoded powershell object whether there is input for this powershell the client powershell id the client runspacepool id runspace pool driver which is creating this powershell driver apartment state for this powershell host info using which the host for this powershell will be constructed serialization options for the streams in this powershell true if the command is to be added to history list of the runspace. false, otherwise. If not null, this Runspace will be used to invoke Powershell. If null, the RunspacePool pointed by will be used. Steppable pipeline event subscriber input collection of the PowerShell pipeline Starts the exectution Close the input collection of the local powershell sender of this event, unused arguments describing this event Handle a host message response received sender of this event, unused arguments describing this event Stop the local powershell sender of this event, unused unused Add input to the local powershell's input collection sender of this event, unused arguments describing this event Checks if there is any pending input that needs processing. If so, triggers RunProcessRecord event. The pipeline execution thread catches this and calls us back when the pipeline is suspended. Performs the stop operation Changes state and sends message to the client as needed. Local PowerShell instance Instance id by which this powershell driver is identified. This is the same as the id of the powershell on the client side Server remote host Serialization options for the streams in this powershell Id of the runspace pool driver which created this object. This is the same as the id of the runspace pool at the client side which is associated with the powershell on the client side ServerPowerShellDataStructureHandler associated with this powershell driver Pipeline invocation state Checks if the steppable pipeline has input Steppablepipeline object Synchronization object Processing input Input enumerator Input collection Is the pipeline pulsed Total objects processed Event handler argument Steppable pipeline driver event handler class Handles the start pipeline event, this is called by the event manager Handles process record event Fires the start event steppable pipeline driver Fires the process record event steppable pipeline driver This class is an implementation of the abstract class ServerRemoteSessionDataStructureHandler. Constructs a ServerRemoteSession handler using the supplied transport manager. The supplied transport manager will be used to send and receive data from the remote client. Calls the transport layer connect to make a connection to the listener. This method sends the server side capability negotitation packet to the client. Send the encrypted session key to the client side encrypted session key as a string Send request to the client for sending a public key Raise the public key received event received data This method is a hook to be called from the transport manager This method calls the transport level call to close the connection to the listener. Message describing why the session is closing If the transport call fails. This method is used by the input queue dispatching mechanism. It examines the data and takes appropriate actions. The received client data. If the parameter is null. This event indicates that the client capability negotiation packet has been received. Event that raised when session datastructure handler is closing. This event indicates that the client has requested to create a new runspace pool on the server side A reference to the FSM object. The ServerRemoteHost class. Instance id. Remote host user interface. Server method executor. Client runspace pool id. Client power shell id. Host info. Transport manager. Constructor for ServerRemoteHost. Set should exit. Enter nested prompt. Exit nested prompt. Notify begin application. Notify end application. Push runspace. Pop runspace. Server method executor. The user interface. Name. Version. Instance id. Current culture. Current ui culture. Is runspace pushed. Runspace. Host info. The ServerRemoteHostUserInterface class. Raw ui. Remote host. Server method executor. Constructor for ServerRemoteHostUserInterface. Read line. Prompt for choice. Prompt for choice. User can select multiple choices Prompt. Write. Write. Write line. Write line. Write line. Write error line. Write debug line. Write progress. Write verbose line. Write warning line. Read line as secure string. Prompt for credential. Prompt for credential. Raw ui. Server remote host. The ServerRemoteHostRawUserInterface class. Remote host user interface. Server method executor. Constructor for ServerRemoteHostRawUserInterface. Read key. Flush input buffer. Scroll buffer contents. Set buffer contents. Set buffer contents. Get buffer contents. Host default data. Foreground color. Background color. Cursor position. Window position. Cursor size. Buffer size. Window size. Window title. Max window size. Max physical window size. Key available. This class wraps a RunspacePoolInternal object. It is used to function as a server side runspacepool Event that get raised when the RunspacePool is closed. Creates the runspace pool driver client runspace pool id to associate transport manager associated with this runspace pool driver maximum runspaces to open minimum runspaces to open threading options for the runspaces in the pool apartment state for the runspaces in the pool host information about client side host Contains: 1. Script to run after a RunspacePool/Runspace is created in this session. For RunspacePool case, every newly created Runspace (in the pool) will run this script. 2. ThreadOptions for RunspacePool/Runspace 3. ThreadApartment for RunspacePool/Runspace configuration of the runspace application private data True if the driver is being created by an administrator server capability reported to the client during negotiation (not the actual capability) DISC configuration hashtable Start the RunspacePoolDriver. This will open the underlying RunspacePool. Send applicaiton private data to client will be called during runspace creation and each time a new client connects to the server session Dispose the runspace pool driver and release all its resources RunspaceCreated eventhandler. This is used to set TypeTable for TransportManager. TransportManager needs TypeTable for Serializing/Deserializing objects. Invokes a script Invokes a PowerShell instance Creates a key pattern list Matches a key pattern Raised by RunspacePool whenever a new runspace is created. This is used by the driver to run startup script as well as set personal folder as the current working directory. Runspace that was created by the RunspacePool. handler to the runspace pool state changed events sender of this events arguments which describe the RunspacePool's StateChanged event handler to the runspace pool psevents Handle the invocation of powershell sender of this event, unused arguments describing this event Handle the invocation of command discovery pipeline sender of this event, unused arguments describing this event Handles host responses sender of this event, unused arguments describing this event Sets the maximum runspace of the runspace pool and sends a response back sender of this event, unused contains information about the new maxRunspaces and the callId at the client Sets the minimum runspace of the runspace pool and sends a response back sender of this event, unused contains information about the new minRunspaces and the callId at the client Gets the available runspaces from the server and sends it across to the client sender of this event, unused contains information on the callid data structure handler for communicating with client The server host associated with the runspace pool. the client runspacepool id The local runspace pool associated with this driver This class wraps a PowerShell object. It is used to function as a server side powershell Default constructor for creating ServerPowerShellDrivers decoded powershell object extra pipeline to be run after completes whether there is input for this powershell the client powershell id the client runspacepool id runspace pool driver which is creating this powershell driver apartment state for this powershell host info using which the host for this powershell will be constructed serialization options for the streams in this powershell true if the command is to be added to history list of the runspace. false, otherwise. If not null, this Runspace will be used to invoke Powershell. If null, the RunspacePool pointed by will be used. invokes the powershell asynchronously Handle state changed information from PowerShell and send it to the client sender of this event arguments describing state changed information for this powershell Handles DataAdded event from the Output of the powershell sender of this information arguments describing this event Handles DataAdded event from Error of the PowerShell sender of this event arguments describing this event Handles DataAdded event from Progress of PowerShell sender of this information, unused arguments describing this event Handles DataAdded event from Warning of PowerShell sender of this information, unused arguments describing this event Handles DataAdded from Verbose of PowerShell sender of this information, unused sender of this information Handles DataAdded from Debug of PowerShell sender of this information, unused sender of this information Send the remaining output and error information to client This method should be called before sending the state information. The client will remove the association between a powershell and runspace pool if it recieves any of the terminal states. Hence all the remaining data should be sent before this happens. Else the data will be discarded Stop the local powershell sender of this event, unused unused Add input to the local powershell's input collection sender of this event, unused arguments describing this event Close the input collection of the local powershell sender of this event, unused arguments describing this event Handle a host message response received sender of this event, unused arguments describing this event Handles the PSDataCollection idle event Input collection sync object Local PowerShell instance Instance id by which this powershell driver is identified. This is the same as the id of the powershell on the client side Serialization options for the streams in this powershell Id of the runspace pool driver which created this object. This is the same as the id of the runspace pool at the client side which is associated with the powershell on the client side ServerPowerShellDataStructureHandler associated with this powershell driver Handles all data structure handler communication with the client runspace pool Constructor which takes a server runspace pool driver and creates an associated ServerRunspacePoolDataStructureHandler Send a message with application private data to the client applicationPrivateData to send server capability negotiated during initial exchange of remoting messages / session capabilities of client and server Send a message with the RunspacePoolStateInfo to the client state info to send Send a message with the PSEventArgs to the client event to send called when session is connected from a new client call into the sessionconnect handlers for each associated powershell dshandler Process the data received from the runspace pool on the server data received Creates a powershell data structure handler from this runspace pool powershell instance id runspace pool id remote stream options local PowerShell object ServerPowerShellDataStructureHandler Returns the currently active PowerShell datastructure handler. ServerPowerShellDataStructureHandler if one is present, null otherwise. dispatch the message to the associated powershell data structure handler message to dispatch Send the specified response to the client. The client call will be blocked on the same call id on the client response to send Send the data specified as a RemoteDataObject asynchronously to the runspace pool on the remote session data to send This overload takes a RemoteDataObject and should be the one thats used to send data from within this data structure handler class Get the associated powershell data structure handler for the specified powershell id powershell id for the powershell data structure handler ServerPowerShellDataStructureHandler Remove the association of the powershell from the runspace pool sender of this event unused TypeTable used for Serialization/Deserialization. This event is raised whenever there is a request from the client to create a powershell on the server and invoke it This event is raised whenever there is a request from the client to run command discovery pipeline This event is raised when a host call response is received This event is raised when there is a request to modify the maximum runspaces in the runspace pool This event is raised when there is a request to modify the minimum runspaces in the runspace pool This event is raised when there is a request to get the available runspaces in the runspace pool Handles all PowerShell data structure handler communication with the client side PowerShell Default constructor for creating ServerPowerShellDataStructureHandler instance powershell instance id runspace pool id remote stream options transport manager local powershell object Prepare transport manager to send data to client. Send the state information to the client state information to be sent to the client Send the output data to the client data to send Send the error record to client error record to send Send the specified warning record to client warning record Send the specified debug record to client debug record Send the specified verbose record to client warning record Send the specified progress record to client progress record called when session is connected from a new client calls into observers of this event. observers include corrensponding driver that shutsdown input stream is present Process the data received from the powershell on the client data received Raise a remove association event. This is raised when the powershell has gone into a terminal state and the runspace pool need not maintain any further associations Creates a ServerRemoteHost which is associated with this powershell. Host information about the host associated PowerShell object on the client. Host associated with the RunspacePool on the server. A new ServerRemoteHost for the PowerShell. Send the data specified as a RemoteDataObject asynchronously to the runspace pool on the remote session data to send This overload takes a RemoteDataObject and should be the one thats used to send data from within this data structure handler class Handle transport manager's closing event. this event is raised when the state of associated powershell is terminal and the runspace pool has to detach the association this event is raised when the a message to stop the powershell is received from the client This event is raised when an input object is received from the client This event is raised when end of input is received from the client raised when server session is connected from a new client This event is raised when a host response is received client powershell id Runspace used to invoke PowerShell, this is used by the steppable pipeline driver. This class channels WSMan server specific notifications to subscribers. One example is shutting down. Raising shutting down WSMan server event. Event raised when shutting down WSMan server. Class implemeting Register-PSSessionConfiguration Base class for PSCustomShell commands Register-PSSessionConfiguration, Set-PSSessionConfiguration This is internal to make 3rd parties not derive from this cmdlet. This parameter enables the user to specify a shell name for the created custom shell. This parameter enables the user to load an Assembly and supply InitialSessionstate for each user connecting to the shell. This parameter can accompany with AssemblyName. This supplies the directory to search while loading the assembly specified with parameter AssemblyName. Environment variables are accepted in the string value. This parameter should be specified with AssemblyName. This supplies the type to load to get the InitialSessionState. The type should be derivided from . Parameter used to specify the RunAs credentials. ApartmentState of the Runspace created for the shell. ThreadOptions of the Runspace created for the shell. Set access mode Host mode Initialization script to run upon Runspace creation for this shell. Total data (in MB) that can be received from a remote machine targeted towards a command. Maximum size (in MB) of a deserialized object received from a remote machine. This enables the user to specify an SDDL on the shell. The default SDDL is the default used by Wsman. Shows a UI to choose permissions/access rights for this session configuration. Property that sets force parameter. This will allow restarting the WinRM service after the changes were made. If true, then the cmdlet will not attempt to restart WinRM service after completion. Typically WinRM service need to be restarted for changes to take place. Property corresponding to PSVersion parameter in the ConfigXML. This is treated as the minimum PowerShell version to load. This will allow existing endpoints creating during migration or upgrade that have PSVersion=2.0 to roll forward to PowerShell 3.0 automatically without changing the ConfigXML. SessionTypeOption TransportOption ModulesToImport Declaration initial session config file path 1. Either both "AssemblyName" and "ConfigurationTypeName" must be specified or both must not be specified. For each record, execute it, and push the results into the success stream. 1. New shell successfully registered. However cannot delete temporary plugin file {0}. Reason for failure: {1}. 1. Cannot delete temporary file {0}. Try again. Reason for failure: {1}. 2. Cannot write shell configuration data into temporary file {0}. Try again. Reason for failure: {1}. Parameter used to specify the Processor Architecture that this shell targets. On a 64bit base OS, specifying a value of 32 means that the shell is configured to launch like a 32bit process (WOW64). SessionType Only want this on non assemblyName parameter set, since assembly decides the sessiontype. Utilities for Custom shell commands Run script to restart the WinRM service. The script will write output and error into the cmdlets streams. Cmdlet's context in which the restart-service script is run. if true, then this method is a no-op. if true, then the user will not be prompted. if true, we dont attempt to restart winrm service ie. this will be a no-op. Gathers WhatIf, Confirm parameter values from the cmdlet. Checks if the current thread is running elevated. If not, throws an error. 1. Acess is denied. You need to run this cmdlet from an elevated process. Calculates the MaxPSVersion in the config xml from psVersion Converts the module path represented in the string[] into a comma separated string. Converts the version number to the format "Major.Minor" which needs to be persisted in the config xml Checks if the specified version of PowerShell is installed Class implemeting Unregister-PSSessionConfiguration Verifies if remoting cmdlets can be used This parameter enables the user to specify a shell name to remove. Property that sets force parameter. This will allow restarting the WinRM service after the changes were made. If true, then the cmdlet will not attempt to restart WinRM service after completion. Typically WinRM service need to be restarted for changes to take place. Class implemeting Get-PSSessionConfiguration Verifies if remoting cmdlets can be used Class implemeting Set-PSSessionConfiguration 1. Either both "AssemblyName" and "ConfigurationTypeName" must be specified or both must not be specified. Check if the current configuration is a workflow endpoint Class implemeting Enable-PSSessionConfiguration cmdlet 1. Either both "AssemblyName" and "ConfigurationTypeName" must be specified or both must not be specified. Configurations to Enable Property that sets force parameter. This will allow configuring the WinRM and enabling the session configurations without prompting the user. This enables the user to specify an SDDL for whom the session configuration is enabled. Property that will allow configuring WinRM with Public profile exception enabled. 1. Either both "AssemblyName" and "ConfigurationTypeName" must be specified or both must not be specified. Configurations to Enable Property that sets force parameter. This will allow configuring the WinRM and enabling the session configurations without prompting the user. 1. Either both "AssemblyName" and "ConfigurationTypeName" must be specified or both must not be specified. Property that sets force parameter. This will allow configuring the WinRM and enabling the session configurations without prompting the user. Property that will allow configuring WinRM with Public profile exception enabled. Disable-PSRemoting cmdlet Only disable the network access to the Session Configuration. The local access is still enabled Check for prerequisites and eleveation mode Invoke Disable-PSRemoting Force parameter This cmdlet executes a specified script block on one or more remote machines. The expression or command, as they will be interchangeably called, need to be contained in a script block. This is to ensure two things: 1. The expression that the user has entered is syntactically correct (its compiled) 2. The scriptblock can be converted to a powershell object before transmitting it to the remote end so that it can be run on constrained runspaces in the no language mode In general, the command script block is executed as if the user had typed it at the command line. The output of the command is the output of the cmdlet. However, since invoke-command is a cmdlet, it will unravel its output: - if the command outputs an empty array, invoke-command will output $null - if the command outputs a single-element array, invoke-command will output that single element. Additionally, the command will be run on a remote system. This cmdlet can be called in the following different ways: Execute a command in a remote machine by specifying the command and machine name invoke-command -Command {get-process} -computername "server1" Execute a command in a set of remote machines by specifying the command and the list of machines $servers = 1..10 | %{"Server${_}"} invoke-command -command {get-process} -computername $servers Create a new runspace and use it to execute a command on a remote machine $runspace = New-PSSession -computername "Server1" $credential = get-credential "user01" invoke-command -command {get-process} ¨Crunspace $runspace -credential $credential Execute a command in a set of remote machines by specifying the complete uri for the machines $uri = "http://hostedservices.microsoft.com/someservice" invoke-command -command { get-mail } - uri $uri Create a collection of runspaces and use it to execute a command on a set of remote machines $serveruris = 1..8 | %{"http://Server${_}/"} $runspaces = New-PSSession -URI $serveruris invoke-command -command {get-process} -Session $runspaces The cmdlet can also be invoked in the asynchronous mode. invoke-command -command {get-process} -computername $servers -asjob When the -AsJob switch is used, the cmdlet will emit an PSJob Object. The user can then use the other job cmdlets to work with this object Note there are two types of errors: 1. Remote invokation errors 2. Local errors. Both types of errors will be available when the user invokes a receive operation. The PSJob object has its own throttling mechanism. The result object will be stored in a global cache. If a user wants to retrieve data from the result object the user should be able to do so using the Receive-PSJob cmdlet The following needs to be noted about exception/error reporting in this cmdlet: The exception objects that are thrown by underlying layers will be written as errors, to avoid stopping the entire cmdlet in case of multi-computername or multi-Session usage (for consistency, this is true even when done using one computername or runspace) Only one expression may be executed at a time in any single runspace. Attempts to invoke an expression on a runspace that is already executing an expression shall return an error with ErrorCategory ResourceNotAvailable and notify the user that the runspace is currently busy. Some additional notes: - invoke-command issues a single scriptblock to the computer or runspace. If a runspace is specified and a command is already running in that runspace, then the second command will fail - The files necessary to execute the command (cmdlets, scripts, data files, etc) must be present on the remote system; the cmdlet is not responsible for copying them over - The entire input stream is collected and sent to the remote system before execution of the command begins (no input streaming) - Input shall be available as $input. Remote Runspaces must reference $input explicitly (input will not automatically be available) - Output from the command streams back to the client as it is available - Ctrl-C and pause/resume are supported; the client will send a message to the remote powershell instance. - By default if no -credential is specified, the host will impersonate the current user on the client when executing the command - The standard output of invoke-command is the output of the last element of the remote pipeline, with some extra properties added - If -Shell is not specified, then the value of the environment variable DEFAULTREMOTESHELLNAME is used. If this is not set, then "Microsoft.PowerShell" is used. Base class for any cmdlet which has to execute a pipeline. The following cmdlets currently fall under this category: 1. Invoke-Expression 2. Start-PSJob Base class for any cmdlet which takes a -Session parameter or a -ComputerName parameter (along with its other associated parameters). The following cmdlets currently fall under this category: 1. New-PSSession 2. Invoke-Expression 3. Start-PSJob This class defines most of the common functionality used across remoting cmdlets. It contains tons of utility functions which are used all across the remoting cmdlets Computername parameter set runspace parameter set Default shellname default application name for the connection uri Verifies if remoting cmdlets can be used Handle the object obtained from an ObjectStream's reader based on its type Resolve all the machine names provided. Basically, if a machine name is '.' assume localhost array of computer names to resolve resolved array of machine names Resolves a computer name. If its null or empty its assumed to be localhost computer name to resolve resolved computer name Load the resource corresponding to the specified errorId and return the message as a string resource String which holds the message Error message loaded from appropriate resouce cache Determines the shellname to use based on the following order: 1. ShellName parameter specified 2. DEFAULTREMOTESHELLNAME variable set 3. PowerShell The shell to launch in the remote machine Determines the appname to be used based on the following order: 1. AppName parameter specified 2. DEFAULTREMOTEAPPNAME variable set 3. WSMan application name to resolve resolved appname Skip checking for WinRM Uri parameter set Used to resolve authentication from the parameters chosen by the user. User has the following options: 1. AuthMechanism + Credential 2. CertiticateThumbPrint All the above are mutually exclusive. If there is ambiguity as specified above. Validate the PSSession objects specified and write appropriate error records. This function will lead in terminating errors when any of the validations fail Updates connection info with the data read from cmdlet's parameters and sessions variables. The following data is updated: 1. MaxURIRedirectionCount 2. MaxRecvdDataSizePerSession 3. MaxRecvdDataSizePerCommand 4. MaxRecvdObjectSize Validates computer names to check if none of them happen to be a Uri. If so this throws an error collection of computer names to validate Resolves shellname and appname The PSSession object describing the remote runspace using which the specified cmdlet operation will be performed This parameter represents the address(es) of the remote computer(s). The following formats are supported: (a) Computer name (b) IPv4 address : 132.3.4.5 (c) IPv6 address: 3ffe:8311:ffff:f70f:0:5efe:172.30.162.18 Computer names after they have been resolved (null, empty string, "." resolves to localhost) If Null or empty string is specified, then localhost is assumed. The ResolveComputerNames will include this. Specifies the credentials of the user to impersonate in the remote machine. If this parameter is not specified then the credentials of the current user process will be assumed. Port specifies the alternate port to be used in case the default ports are not used for the transport mechanism (port 80 for http and port 443 for useSSL) Currently this is being accepted as a parameter. But in future support will be added to make this a part of a policy setting. When a policy setting is in place this parameter can be used to override the policy setting This parameter suggests that the transport scheme to be used for remote connections is useSSL instead of the default http.Since there are only two possible transport schemes that are possible at this point, a SwitchParameter is being used to switch between the two. If this parameter is not specified then the value specified in the environment variable DEFAULTREMOTESHELLNAME will be used. If this is not set as well, then Microsoft.PowerShell is used. This parameters specifies the appname which identifies the connection end point on the remote machine. If this parameter is not specified then the value specified in DEFAULTREMOTEAPPNAME will be used. If thats not specified as well, then "WSMAN" will be used Allows the user of the cmdlet to specify a throttling value for throttling the number of remote operations that can be executed simultaneously A complete URI(s) specified for the remote computer and shell to connect to and create runspace for The AllowRediraction parameter enables the implicit redirection functionality Extended Session Options for controlling the session creation. Use "New-WSManSessionOption" cmdlet to supply value for this parameter. Use basic authentication to authenticate the user. Specifies the certificate thumbprint to be used to impersonate the user on the remote machine. FilePathComputername parameter set LiteralFilePathComputername parameter set FilePathRunspace parameter set FilePathUri parameter set Creates helper objects with the command for the specified remote computer names Creates helper objects with the specified command for the specified remote runspaceinfo objects Creates helper objects with the command for the specified remote connection uris Creates a pipeline from the powershell runspace on which to create the pipeline a pipeline Adds forwarded events to the local queue Closes the input streams on all the pipelines Writes an error record specifying that creation of remote runspace failed exception which is causing this error record to be written Uri which caused this exception Reads content of file and converts it to a scriptblock Creates the helper classes for the specified parameter set Get the PowerShell instance for the PSv2 remote end Generate the PowerShell instance by using the text of the scriptblock Get the PowerShell instance for the PSv3 remote end Generate the PowerShell instance by using the text of the scriptblock Get the converted script for a remote PSv2 end The new parameter names that we added to the param block The new parameter values that need to be added to the powershell instance Get the values for the using variables that are passed in. Get all Using expressions that we care about a list of UsingExpressionAsts ordered by the StartOffset Input object which gets assigned to $input when executed on the remote machine. This is the only parameter in this cmdlet which will bind with a ValueFromPipeline=true Command to execute specified as a string. This can be a single cmdlet, an expression or anything that can be internally converted into a ScriptBlock The file containing the script that the user has specified in the cmdlet. This will be converted to a powershell before its actually sent to the remote end True if FilePath should be processed as a literal path Arguments that are passed to this scriptblock Indicates that if a job/command is invoked remotely the connection should be severed right have invocation of job/command. Session names optionally provided for Disconnected parameter. When set and in loopback scenario (localhost) this enables creation of WSMan host process with the user interactive token, allowing PowerShell script network access, i.e., allows going off box. When this property is true and a PSSession is disconnected, reconnection is allowed only if reconnecting from a PowerShell session on the same box. List of operations Creates the helper classes for the specified parameter set The expression will be executed in the remote computer if a remote runspace parameter or computer name or uri is specified. 1. Identify if the command belongs to the same pipeline 2. If so, use the same GUID to create Pipeline/PowerShell InvokeAsync would have been called in ProcessRecord. Wait here for all the results to become available. This method is called when the user sends a stop signal to the cmdlet. The cmdlet will not exit until it has completed executing the command on all the runspaces. However, when a stop signal is sent, execution needs to be stopped on the pipelines corresponding to these runspaces This is called from a separate thread so need to worry about concurrency issues Handle event from the throttle manager indicating that all operations are complete Clears the internal invoke command instance on all remote runspaces Sets the throttle limit, creates the invoke expression sync job and executes the same Waits for the disconnectComplete event and then disposes the job object. Creates a disconnected session for each disconnected PowerShell object in PSInvokeExpressionSyncJob. Writes an input value to the pipeline input value to write Writes the results in the job object Write in a non-blocking manner Writes the stream objects in the specified collection collection to read from Determine if we have to throw for a "throw" statement from scripts This means that the local pipeline will be terminated as well This is valid when only one pipeline is existing. Which means, there can be only one of the following: 1. A single computer name 2. A single session 3. A single uri It can be used in conjunction with a filepath or a script block parameter It doesn't take effect with the -AsJob parameter Dispose the cmdlet internal dispose method which does the actual disposing whether called from dispose or finalize The PSSession object describing the remote runspace using which the specified cmdlet operation will be performed This parameter represents the address(es) of the remote computer(s). The following formats are supported: (a) Computer name (b) IPv4 address : 132.3.4.5 (c) IPv6 address: 3ffe:8311:ffff:f70f:0:5efe:172.30.162.18 Specifies the credentials of the user to impersonate in the remote machine. If this parameter is not specified then the credentials of the current user process will be assumed. Port specifies the alternate port to be used in case the default ports are not used for the transport mechanism (port 80 for http and port 443 for useSSL) Currently this is being accepted as a parameter. But in future support will be added to make this a part of a policy setting. When a policy setting is in place this parameter can be used to override the policy setting This parameter suggests that the transport scheme to be used for remote connections is useSSL instead of the default http.Since there are only two possible transport schemes that are possible at this point, a SwitchParameter is being used to switch between the two. If this parameter is not specified then the value specified in the environment variable DEFAULTREMOTESHELLNAME will be used. If this is not set as well, then Microsoft.PowerShell is used. This parameters specifies the appname which identifies the connection end point on the remote machine. If this parameter is not specified then the value specified in DEFAULTREMOTEAPPNAME will be used. If thats not specified as well, then "WSMAN" will be used Allows the user of the cmdlet to specify a throttling value for throttling the number of remote operations that can be executed simultaneously A complete URI(s) specified for the remote computer and shell to connect to and create runspace for Specifies if the cmdlet needs to be run asynchronously Specifies that after the command is invoked on a remote computer the remote session should be disconnected. Specifies the name of the returned session when the InDisconnectedSession switch is used. Hide/Show computername of the remote objects. Friendly name for the job object if AsJob is used The script block that the user has specified in the cmdlet. This will be converted to a powershell before its actually sent to the remote end When executing a scriptblock in the current session, tell the cmdlet not to create a new scope. The script block that the user has specified in the cmdlet. This will be converted to a powershell before its actually sent to the remote end The AllowRediraction parameter enables the implicit redirection functionality Extended Session Options for controlling the session creation. Use "New-WSManSessionOption" cmdlet to supply value for this parameter. Authentication mechanism to authenticate the user When set and in loopback scenario (localhost) this enables creation of WSMan host process with the user interactive token, allowing PowerShell script network access, i.e., allows going off box. When this property is true and a PSSession is disconnected, reconnection is allowed only if reconnecting from a PowerShell session on the same box. Encapsulates the Robust Connection retry progress bar. Constructor. Starts progress bar. Stops progress bar. This cmdlet establishes a new Runspace either on the local machine or on the specified remote machine(s). The runspace established can be used to invoke expressions remotely. The cmdlet can be used in the following ways: Open a local runspace $rs = New-PSSession Open a runspace to a remote system. $rs = New-PSSession -Machine PowerShellWorld Create a runspace specifying that it is globally scoped. $global:rs = New-PSSession -Machine PowerShellWorld Create a collection of runspaces $runspaces = New-PSSession -Machine PowerShellWorld,PowerShellPublish,PowerShellRepo Create a set of Runspaces using the Secure Socket Layer by specifying the URI form. This assumes that an shell by the name of E12 exists on the remote server. $serverURIs = 1..8 | %{ "SSL://server${_}:443/E12" } $rs = New-PSSession -URI $serverURIs Create a runspace by connecting to port 8081 on servers s1, s2 and s3 $rs = New-PSSession -computername s1,s2,s3 -port 8081 Create a runspace by connecting to port 443 using ssl on servers s1, s2 and s3 $rs = New-PSSession -computername s1,s2,s3 -port 443 -useSSL Create a runspace by connecting to port 8081 on server s1 and run shell named E12. This assumes that a shell by the name E12 exists on the remote server $rs = New-PSSession -computername s1 -port 8061 -ShellName E12 The throttle limit will be set here as it needs to be done only once per cmdlet and not for every call The runspace objects will be created using OpenAsync. At the end, the method will check if any runspace opened has already become available. If so, then it will be written to the pipeline OpenAsync would have been called from ProcessRecord. This method will wait until all runspaces are opened and then write them to the pipeline as and when they become available. This method is called when the user sends a stop signal to the cmdlet. The cmdlet will not exit until it has completed creating all the runspaces (basically the runspaces its waiting on OpenAsync is made available). However, when a stop signal is sent, CloseAsyn needs to be called to close all the pending runspaces This is called from a separate thread so need to worry about concurrency issues Dispose method of IDisposable. Gets called in the following cases: 1. Pipeline explicitly calls dispose on cmdlets 2. Called by the garbage collector Adds forwarded events to the local queue When the client remote session reports a URI redirection, this method will report the message to the user as a Warning using Host method calls. Handles state changes for Runspace Sender of this event Event information object which describes the event which triggered this method Creates the remote runspace objects when PSSession parameter is specified Creates the remote runspace objects when the URI parameter is specified Creates the remote runspace objects when the ComputerName parameter is specified Helper method to either get a user supplied runspace/session name or to generate one along with a unique Id. Runspace name array index. Runspace Id. Runspace name. Internal dispose method which does the actual dispose operations and finalize suppressions Whether method is called from Dispose or destructor Handles the throttling complete event of the throttle manager sender of this event Writes an error record specifying that creation of remote runspace failed exception which is causing this error record to be written Uri which caused this exception This parameter represents the address(es) of the remote computer(s). The following formats are supported: (a) Computer name (b) IPv4 address : 132.3.4.5 (c) IPv6 address: 3ffe:8311:ffff:f70f:0:5efe:172.30.162.18 Specifies the credentials of the user to impersonate in the remote machine. If this parameter is not specified then the credentials of the current user process will be assumed. The PSSession object describing the remote runspace using which the specified cmdlet operation will be performed Friendly names for the new PSSessions When set and in loopback scenario (localhost) this enables creation of WSMan host process with the user interactive token, allowing PowerShell script network access, i.e., allows going off box. When this property is true and a PSSession is disconnected, reconnection is allowed only if reconnecting from a PowerShell session on the same box. Class that implements the IThrottleOperation in turn wrapping the opening of a runspace asynchronously within it Opens the runspace asynchronously Closes the runspace already opened asynchronously Handler for handling runspace state changed events. This method will be registered in the StartOperation and StopOperation methods. This handler will in turn invoke the OperationComplete event for all events that are necesary - Opened, Closed, Disconnected, Broken. It will ignore all other state changes. There are two problems that need to be handled. 1) We need to make sure that the ThrottleManager StartComplete and StopComplete operation events are called or the ThrottleManager will never end (hang). 2) The HandleRunspaceStateChanged event handler remains in the Runspace StateChanged event call chain until this object is disposed. We have to disallow the HandleRunspaceStateChanged event from running and throwing an exception since this prevents other event handlers in the chain from being called. Source of this event object describing state information of the runspace Implements IDisposable. This cmdlet disconnects PS sessions (RemoteRunspaces) that are in the Opened state and returns the PS session objects in the Disconnected state. While the PS sessions are in the disconnected state no commands can be invoked on them and any existing remote running commands will not return any data. The PS sessions can be reconnected by using the Connect-PSSession cmdlet. The cmdlet can be used in the following ways: Disconnect a PS session object: > $session = New-PSSession serverName > Disconnect-PSSession $session Disconnect a PS session by name: > Disconnect-PSSession -Name $session.Name Disconnect a PS session by Id: > Disconnect-PSSession -Id $session.Id Disconnect a collection of PS sessions: > Get-PSSession | Disconnect-PSSession Base class for any cmdlet which operates on a runspace. The following cmdlets currently fall under this category: 1. Get-PSSession 2. Remove-PSSession 3. Disconnect-PSSession 4. Connect-PSSession Runspace Id parameter set session id parameter set name parameter set Gets the matching runspaces based on the parameterset write an error record when no matches are found if true write the object down the pipeline list of matching runspaces Gets the matching runspaces by computernames write an error record when no matches are found if true write the object down the pipeline list of matching runspaces Gets the matching runspaces based on name write an error record when no matches are found if true write the object down the pipeline list of matching runspaces Gets the matching runspaces based on the runspaces instance id write an error record when no matches are found if true write the object down the pipeline list of matching runspaces Gets the matching runspaces based on the session id (the short integer id which is unique for a runspace) write an error record when no matches are found if true write the object down the pipeline list of matching runspaces Write invalid argument error. RemoteRunspaceId to retrieve corresponding PSSession object Session Id of the remoterunspace info object Name of the remote runspaceinfo object Name of the computer for which the runspace needs to be returned Set up the ThrottleManager for runspace disconnect processing. Perform runspace disconnect processing on all input. End processing clean up. User has signaled a stop for this cmdlet. Handles the connect throttling complete event from the ThrottleManager. Sender EventArgs Dispose method of IDisposable. Gets called in the following cases: 1. Pipeline explicitly calls dispose on cmdlets 2. Called by the garbage collector Internal dispose method which does the actual dispose operations and finalize suppressions Whether method is called from Dispose or destructor The PSSession object or objects to be disconnected. Idle Timeout session option in seconds. Used in this cmdlet to set server disconnect idletimeout option. Output buffering mode session option. Used in this cmdlet to set server disconnect OutputBufferingMode option. Allows the user of the cmdlet to specify a throttling value for throttling the number of remote operations that can be executed simultaneously. Disconnect-PSSession does not support ComputerName parameter set. This may change for later versions. Throttle class to perform a remoterunspace disconnect operation. This cmdlet connects PS sessions (RemoteRunspaces) that are in the Disconnected state and returns those PS session objects in the Opened state. One or more session objects can be specified for connecting, or a remote computer name can be specified and in this case all disconnected remote runspaces found on the remote computer will be be connected and PSSession objects created on the local machine. The cmdlet can be used in the following ways: Connect a PS session object: > $session = New-PSSession serverName > Disconnect-PSSession $session > Connect-PSSession $session Connect a PS session by name: > Connect-PSSession $session.Name Connect a PS session by Id: > Connect-PSSession $session.Id Connect a collection of PS session: > Get-PSSession | Connect-PSSession Connect all disconnected PS sessions on a remote computer > Connect-PSSession serverName Set up the ThrottleManager for runspace connect processing. Perform runspace connect processing on all input. End processing clean up. User has signaled a stop for this cmdlet. Retrieves a collection of disconnected PSSession objects queried from remote computers. Collection of disconnected PSSession objects. Creates a collection of PSSession objects based on cmdlet parameters. OverrideParameter Collection of PSSession objects in disconnected state. Connect all disconnected sessions. Handles the connect throttling complete event from the ThrottleManager. Sender EventArgs Updates connection info with the data read from cmdlet's parameters. Dispose method of IDisposable. Gets called in the following cases: 1. Pipeline explicitly calls dispose on cmdlets 2. Called by the garbage collector Internal dispose method which does the actual dispose operations and finalize suppressions Whether method is called from Dispose or destructor The PSSession object or objects to be connected. Computer names to connect to. This parameters specifies the appname which identifies the connection end point on the remote machine. If this parameter is not specified then the value specified in DEFAULTREMOTEAPPNAME will be used. If thats not specified as well, then "WSMAN" will be used If this parameter is not specified then the value specified in the environment variable DEFAULTREMOTESHELLNAME will be used. If this is not set as well, then Microsoft.PowerShell is used. A complete URI(s) specified for the remote computer and shell to connect to and create a runspace for. The AllowRedirection parameter enables the implicit redirection functionality. RemoteRunspaceId to retrieve corresponding PSSession object Name of the remote runspaceinfo object Specifies the credentials of the user to impersonate in the remote machine. If this parameter is not specified then the credentials of the current user process will be assumed. Use basic authentication to authenticate the user. Specifies the certificate thumbprint to be used to impersonate the user on the remote machine. Port specifies the alternate port to be used in case the default ports are not used for the transport mechanism (port 80 for http and port 443 for useSSL) Currently this is being accepted as a parameter. But in future support will be added to make this a part of a policy setting. When a policy setting is in place this parameter can be used to override the policy setting This parameter suggests that the transport scheme to be used for remote connections is useSSL instead of the default http.Since there are only two possible transport schemes that are possible at this point, a SwitchParameter is being used to switch between the two. Extended session options. Used in this cmdlet to set server disconnect options. Allows the user of the cmdlet to specify a throttling value for throttling the number of remote operations that can be executed simultaneously. Throttle class to perform a remoterunspace connect operation. Enum indicating an override on which parameter is used to filter local sessions. No override. Use the Name parameter as a filter. Use the InstanceId parameter as a filter. Queries all remote computers specified in collection of WSManConnectionInfo objects and returns disconnected PSSession objects ready for connection to server. Returned sessions can be matched to Guids or Names. Collection of WSManConnectionInfo objects. Host for PSSession objects. Out stream object. Runspace repository. Throttle limit. Runspace state filter value. Array of session Guids to match to. Array of session Names to match to. Configuration name to match to. Collection of disconnected PSSession objects. Returns true if the existing runspace should be returned to the user a. If the existing runspace is not broken b. If the queried runspace is not connected to a different user. Returns Exception message. If message is WSMan Xml then the WSMan message and error code is extracted and returned. Exception Returned WSMan error code WSMan message Discontinue all remote server query operations. Compares the runspace filter state with the runspace state. Runspace object to test. Filter state to compare. Result of test. Returns the default type table for built-in PowerShell types. Runspace states that can be used as filters for querying remote runspaces. Return runspaces in any state. Return runspaces in Opened state. Return runspaces in Disconnected state. Return runspaces in Closed state. Return runspaces in Broken state. This cmdlet connects a running command associated with a PS session and then directs the command output either: a) To Host. This is the synchronous mode of the cmdlet which won't return until the running command completes and all output data is received on the client. b) To a job object. This is the asynchronous mode of the cmdlet which will return immmediately providing the job object that is collecting the running command output data. The running command becomes disconnected when the associated runspace is disconnected (via the Disconnect-PSSession cmdlet). The associated runspace object must be in the Opened state (connected) before the running command can be connected. If the associated runspace object is in the disconnected state, it will first be connected before the running command is connected. The user can specify how command output data is returned by using the public OutTarget enumeration (Host, Job). The default actions of this cmdlet is to always direct ouput to host unless a job object already exists on the client that is associated with the running command. In this case the existing job object is connected to the running command and returned. The cmdlet can be used in the following ways: Receive PS session data by session object > $session = New-PSSession serverName > $job1 = Invoke-Command $session { [script] } -asjob > Disconnect-PSSession $session > Connect-PSSession $session > Receive-PSSession $session // command output continues collecting at job object. Receive PS session data by session Id > Receive-PSSession $session.Id Receive PS session data by session instance Id > Receive-PSSession $session.InstanceId Receive PS session data by session Name. Direct output to job > Receive-PSSession $session.Name Receive a running command from a computer. > $job = Receive-PSSession -ComputerName ServerOne -Name SessionName -OutTarget Job Process input. User has signaled a stop for this cmdlet. Queries the remote computer for the specified session, creates a disconnected session object, connects the runspace/command and collects command data. Command output is either returned (OutTarget.Host) or collected in a job object that is returned (OutTarget.Job). Name of session to find. Instnace Id of session to find. Updates connection info with the data read from cmdlet's parameters. Gets the PSSession object to connect based on Id, Name, etc. Connects the running command associated with the PSSession runspace object. Command output is either returned (OutTarget.Host) or collected in a job object that is returned (OutTarget.Job). Connects session, retrieves command output data and writes to host. PSSession object. Job object associated with session. Helper method to append computer name and session GUID note properties to the PSObject before it is written. PSObject PSSession Connects session, collects command output data in a job object. If a PSRemotingJob object is passed in then that job will be (re)connected. Otherwise a new job object will be created that will be connected to the session's running command. PSSession object. Job object to connect to. Helper method to connect the runspace. If the session/runspace can't be connected or fails to be connected then a null PSSessionobject is returned. Session to connect. Optional exception object. Connected session or null. Helper method to attempt to retrieve a disconnected runspace object from the server, based on the provided session object. PSSession PSSession Helper method to search the local PS client job repository for a job associated with the provided session. PSSession object. Associated job object from the job repository. Searches runspace repository for session by Id. Id to match. PSSession object. Searches runspace repository for session by Name. Name to match. PSSession object. Searches runspace repository for session by InstanceId. InstanceId to match. PSSession object. Write invalid argument error. The PSSession object to receive data from. Session Id of PSSession object to receive data from. Computer name to receive session data from. This parameters specifies the appname which identifies the connection end point on the remote machine. If this parameter is not specified then the value specified in DEFAULTREMOTEAPPNAME will be used. If thats not specified as well, then "WSMAN" will be used If this parameter is not specified then the value specified in the environment variable DEFAULTREMOTESHELLNAME will be used. If this is not set as well, then Microsoft.PowerShell is used. A complete URI(s) specified for the remote computer and shell to connect to and create a runspace for. The AllowRedirection parameter enables the implicit redirection functionality. Instance Id of PSSession object to receive data from. Name of PSSession object to receive data from. Determines how running command output is returned on client. Provides job name when job is created for returned data. Specifies the credentials of the user to impersonate in the remote machine. If this parameter is not specified then the credentials of the current user process will be assumed. Use basic authentication to authenticate the user. Specifies the certificate thumbprint to be used to impersonate the user on the remote machine. Port specifies the alternate port to be used in case the default ports are not used for the transport mechanism (port 80 for http and port 443 for useSSL) Currently this is being accepted as a parameter. But in future support will be added to make this a part of a policy setting. When a policy setting is in place this parameter can be used to override the policy setting This parameter suggests that the transport scheme to be used for remote connections is useSSL instead of the default http.Since there are only two possible transport schemes that are possible at this point, a SwitchParameter is being used to switch between the two. Session options. Output modes available to the Receive-PSSession cmdlet. Default mode. If Synchronous mode. Receive-PSSession output data goes to host (returned by cmdlet object). Asyncronous mode. Receive-PSSession ouput data goes to returned job object. Repository of remote runspaces available in a local runspace class which has list of job objects currently active in the system. Add an item to the repository object to add Remove the specified item from the repository object to remove Get a key for the specified item item for which the key is required returns a key internal constructor Gets the specified Item Creates a repository with the specified values Gets the Repository dictionary. Internal constructor Gets a key for the specified item Adds the PSSession item to the repository if it doesn't already exist or replaces the existing one. PSSession object. Collection of runspaces available This cmdlet is used to retrieve runspaces from the global cache and write it to the pipeline. The runspaces are wrapped and returned as PSSession objects. The cmdlet can be used in the following ways: List all the available runspaces get-pssession Get the PSSession from session name get-pssession -Name sessionName Get the PSSession for the specified ID get-pssession -Id sessionId Get the PSSession for the specified instance Guid get-pssession -InstanceId sessionGuid Get PSSessions from remote computer. Optionally filter on state. get-psession -ComputerName computerName -StateFilter Disconnected Get the list of runspaces from the global cache and write them down. If no computername or instance id is specified then list all runspaces End processing clean up. User has signaled a stop for this cmdlet. Creates a connectionInfo object for each computer name and performs a remote session query for each computer filtered by the filterState parameter. Updates connection info with the data read from cmdlet's parameters. Dispose method of IDisposable. Computer names to connect to. This parameters specifies the appname which identifies the connection end point on the remote machine. If this parameter is not specified then the value specified in DEFAULTREMOTEAPPNAME will be used. If thats not specified as well, then "WSMAN" will be used A complete URI(s) specified for the remote computer and shell to connect to and create a runspace for. If this parameter is not specified then the value specified in the environment variable DEFAULTREMOTESHELLNAME will be used. If this is not set as well, then Microsoft.PowerShell is used. The AllowRediraction parameter enables the implicit redirection functionality. Session names to filter on. Instance Ids to filter on. Specifies the credentials of the user to impersonate in the remote machine. If this parameter is not specified then the credentials of the current user process will be assumed. Use basic authentication to authenticate the user. Specifies the certificate thumbprint to be used to impersonate the user on the remote machine. Port specifies the alternate port to be used in case the default ports are not used for the transport mechanism (port 80 for http and port 443 for useSSL) Currently this is being accepted as a parameter. But in future support will be added to make this a part of a policy setting. When a policy setting is in place this parameter can be used to override the policy setting This parameter suggests that the transport scheme to be used for remote connections is useSSL instead of the default http.Since there are only two possible transport schemes that are possible at this point, a SwitchParameter is being used to switch between the two. Allows the user of the cmdlet to specify a throttling value for throttling the number of remote operations that can be executed simultaneously. Filters returned remote runspaces based on runspace state. Session options. This enum is used to distinguish two sets of parameters on some of the remoting cmdlets. Use ComputerName parameter set Use Runspace Parameter set This is a static utility class that performs some of the common chore work for the the remoting cmdlets. The existence of the following registry confirms that the host machine is a WinPE HKLM\System\CurrentControlSet\Control\MiniNT IsWinPEHost indicates if the machine on which PowerShell is hosted is WinPE or not. This is a helper variable used to kep track if the IsWinPE() helper method has already checked for the WinPE specific registry key or not. If the WinPE specific registry key has not yet been checked even once then this variable will point to null. Checks the prerequisites for a cmdlet and terminates if the cmdlet is not valid IsWinPEHost is a helper method used to identify if the PowerShell is hosted on a WinPE machine. Facilitates to check if remoting is supported on the host machine. PowerShell remoting is supported on all Windows SQU's except WinPE. When PowerShell is hosted on a WinPE machine, the execution of this API would result in an InvalidOperationException being thrown, indicating that remoting is not supported on a WinPE machine. This cmdlet stops the runspace and frees the resources associated with that runspace. If any execution is in process in that runspace, it is stopped. Also, the runspace is removed from the global cache. This cmdlet can be used in the following ways: Remove the runspace specified $runspace = New-PSSession Remove-PSSession -remoterunspaceinfo $runspace Remove the runspace specified (no need for a parameter name) $runspace = New-PSSession Remove-PSSession $runspace Do the follwing actions: 1. If runspace is in opened state, a. stop any execution in process in the runspace b. close the runspace 2. Remove the runspace from the global cache Specifies the PSSession objects which need to be removed This cmdlet start invocation of jobs in background. 1. Set the throttling limit and reset operations complete 2. Create helper objects 3. For async case, write the async result object down the pipeline Create a throttle operation using NewProcessConnectionInfo ie., Out-Of-Process runspace. The expression will be executed in the remote computer if a remote runspace parameter or computer name is specified. If none other than command parameter is specified, then it just executes the command locally without creating a new remote runspace object. InvokeAsync would have been called in ProcessRecord. Wait here for all the results to become available. Dispose the cmdlet internal dispose method which does the actual disposing whether called from dispose or finalize JobDefintion Name. JobDefinition file path. Job SourceAdapter type for this job definition. Friendly name for this job object Command to execute specified as a string. This can be a single cmdlet, an expression or anything that can be internally converted into a ScriptBlock This is used in the in process case with a "ValueFromPipelineProperty" enabled in order to maintain compatibility with v1.0 Overriding to suppress this parameter Overriding to suppress this parameter Not used for OutOfProc jobs. Suppressing this parameter. Credential to use for this job Overriding to suppress this parameter Overriding to suppress this parameter Overriding to suppress this parameter Overriding to suppress this parameter Overriding to suppress this parameter Overriding to suppress this parameter Filepath to execute as a script Literal Filepath to execute as a script Use basic authentication to authenticate the user. Overriding to suppress this parameter Overriding to suppress this parameter Extended Session Options for controlling the session creation. Use "New-WSManSessionOption" cmdlet to supply value for this parameter. This is not declared as a Parameter for Start-PSJob as this is not used for background jobs. Script that is used to initialize the background job. Launces the background job as a 32-bit process. This can be used on 64-bit systems to launch a 32-bit wow process for the background job. Powershell Version to execute the background job InputObject. ArgumentList. class which has list of job objects currently active in the system. Returns the Job whose InstanceId matches the parameter. The matching Job. Null if no match is found. internal constructor Returns the instance id of the job as key job for which a key is required returns jobs guid Returns the list of available job objects Contains a pipeline and calls InvokeAsync on the pipeline on StartOperation. On StopOperation it calls StopAsync. The handler sends a StopComplete message in OperationComplete for both the functions. This is because, there is only a single state of the pipeline which raises an event on a method call. There are no separate events raised as part of method calls Indicates whether or not the server should be using the steppable pipeline Internal constructor pipeline object associated with this operation Invokes the pipeline asynchronously Closes the pipeline asynchronously Handles the state changed events for the pipeline. This is registered in both StartOperation and StopOperation. Here nothing more is done excepting raising the OperationComplete event appropriately which will be handled by the cmdlet source of this event object describing state information about the pipeline Raise an OperationComplete Event. The base event will be null in this case Raise an operation complete event. The event args which actually raises this operation complete This helper class contains a runspace and an associated pipeline. On StartOperation it calls OpenAsync on the runspace. In the handler for runspace, when the runspace is successfully opened it calls InvokeAsync on the pipeline. StartOperation is assumed complete when both the operations complete. StopOperation will call StopAsync first on the pipeline and then close the associated runspace. StopOperation is considered complete when both these operations complete. The handler sends a StopComplete message in OperationComplete for both the calls. Determines if the command should be invoked and then disconnect the remote runspace from the client. Constructor RemoteRunspace that is associated with this operation pipeline created from the remote runspace Indicates if pipeline should be disconnected after invoking command. Call OpenAsync() on the RemoteRunspace StopAsync on the pipeline Handles the state changed event for runspace operations sender of this information object describing this event Handles the state changed event for the pipeline. sender of this information object describing this event Raise an OperationComplete Event. The base event will be null in this case Raise an operation complete event. The event args which actually raises this operation complete The remote runspace created using the computer name parameter set details A helper class to resolve the path Resolves the specified path and verifies the path belongs to FileSystemProvider. Path to resolve True if wildcard expansion should be suppressed for this path. reference to calling cmdlet. This will be used for for writing errors resource base name for error strings resource string id for error when path is not from filesystem provider A fully qualified string representing filename. Resolves the specified path to PathInfo objects The path to be resolved. Each path may contain glob characters. True if wildcard expansion should be suppressed for pathToResolve. If true, resolves the path even if it doesn't exist. Calling cmdlet A string representing the resolved path. Cmdlet to get available list of results This is the base class for job cmdlet and contains some helper functions Find the jobs in repository which match matching the specified names if true, method writes the object instead of returning it in list (an empty list is retuened). write error if no match is found check if this job can be removed recurse and check in child jobs list of matching jobs Find the jobs in repository which match the specified instanceid if true, method writes the object instead of returning it in list (an empty list is retuened). write error if no match is found check if this job can be removed look in all child jobs list of matching jobs Find the jobs in repository which match the specified session ids if true, method writes the object instead of returning it in list (an empty list is retuened). write error if no match is found check if this job can be removed look in child jobs as well list of matching jobs Find the jobs in repository which match the specified command if true, method writes the object instead of returning it in list (an empty list is retuened). list of matching jobs Find the jobs in repository which match the specified state if true, method writes the object instead of returning it in list (an empty list is retuened). list of matching jobs Find the jobs which match the specified filter. Used to find the v2 jobs that match a given filter. Copies the jobs to list. if true, method writes the object instead of returning it in list (an empty list is retuened). if true, only jobs which can be removed will be checked Checks that this job object can be removed. If not, writes an error record. Job object to be removed Name of the parameter which is associated with this job object. Resource String in case of error Parameters for resource message true if object should be removed, else false All remoting cmdlets other than Start-PSJob should continue to work even if PowerShell remoting is not enabled. This is because jobs are based out of APIs and there can be other job implementations like eventing or WMI which are not based on PowerShell remoting Name of the jobs to retrieve InstanceIds for which job need to be obtained SessionId for which job need to be obtained All the job objects having this state. All the job objects having this command. All the job objects matching the values in filter Extract resutl objects corresponding to the specified names or expressions Helper method to find jobs based on parameter set. Matching jobs Filter jobs based on HasMoreData return the list of jobs after applying HasMoreData filter Find the all child jobs with specified ChildJobState in the job list returns job list including all child jobs with ChildJobState or all if IncludeChildJob is specified Applys the appropriate time filter to each job in the job list. Only Job2 type jobs can be time filtered so older Job types are skipped. IncludeChildJob parameter. ChildJobState parameter. HasMoreData parameter. Before time filter. After time filter. Newest returned count. SessionId for which job need to be obtained Cmdlet used for receiveing results from job object. This cmdlet is intended to have a slightly different behavior in the following two cases: 1. The job object to receive results from is a PSRemotingJob In this case, the cmdlet can use two additional parameters to filter results - ComputerName and Runspace The parameters help filter out results for a specified computer or runspace from the job object $job = Start-PSJob -Command 'get-process' -ComputerName server1, server2 Receive-PSJob -Job $job -ComputerName server1 $job = Start-PSJob -Command 'get-process' -Session $r1, $r2 Receive-PSJob -Job $job -Session $r1 2. The job object to receive results is a PSJob (or derivative other than PSRemotingJob) In this case, the user cannot will use the location parameter to do any filtering and will not have ComputerName and Runspace parameters $job = Get-WMIObject '....' -AsJob Receive-PSJob -Job $job -Location "Server2" The following will result in an error: $job = Get-WMIObject '....' -AsJob Receive-PSJob -Job $job -ComputerName "Server2" The parameter ComputerName cannot be used with jobs which are not PSRemotingJob Retrieve the results for the specified computers or runspaces StopProcessing - when the command is stopped, unregister all the event handlers from the jobs and decrement reference for results if we are not stopping, continue writing output as and when they are available Write the results from this Job object. This does not write from the child jobs of this job object Job object from which to write the results from Returns all the results from supplied PSDataCollection. data collection to read from collection with copy of data Write the results from this Job object. It also writes the results from its child objects recursively. Hashtable used for duplicate detection Job whose results are written Writes the job objects if required by the cmdlet collection of jobs to write this method is intended to be called only from ProcessRecord. When any changes are made ensure that this contract is not broken this method should always be called before writeExistingData is set in ProcessRecord Write the results from this Job object. It also writes the results from its child objects recursively. Job whose results are written Job object from which specific results need to be extracted Name of the computer for which the results needs to be returned Locations for which the results needs to be returned. This will cater to all kinds of jobs and not only remoting jobs Runspaces for which the results needs to be returned If the results need to be not removed from the store after being written. Default is results are removed. This cmdlet stops the asynchronously invoked remote operaitons. Stop the Job. Wait for all the stop jobs to be completed Specifies the Jobs objects which need to be removed Pass the Job object through the pipeline. This cmdlet waits for job to complete. Cancel the Wait-Job cmdlet. In this method, we initialize the timer if timeout parameter is specified. This method just collects the Jobs which will be waited on in the EndProcessing method. Wait on the collected Jobs. Dispose all managed resources. This will suppress finalizer on the object from getting called by calling System.GC.SuppressFinalize(this). Release all the resources. if true, release all the managed objects. Specifies the Jobs objects which need to be removed Complete the cmdlet when any of the job is completed, instead of waiting for all of them to be completed. If timeout is specified, the cmdlet will only wait for this number of seconds. Value of -1 means never timeout. Forces the cmdlet to wait for Finished states (Completed, Failed, Stopped) instead of persistent states, which also include Suspended and Disconnected. This cmdlet removes the Job object from the runspace wide Job repository. Once the Job object is removed, it will not be available through get-psjob command. Gets the job object as per the parameter and removes it. Wait for all the stop jobs to be completed release waiting for jobs Specifies the Jobs objects which need to be removed If state of the job is running or notstarted, this will forcefully stop it. This cmdlet suspends the jobs that are Job2. Errors are added for each Job that is not Job2. Suspend the Job. End Processing. Specifies the Jobs objects which need to be suspended If state of the job is running , this will forcefully suspend it. This cmdlet resumes the jobs that are Job2. Errors are added for each Job that is not Job2. Resume the Job. End Processing. Specifies the Jobs objects which need to be suspended Specifies whether to delay returning from the cmdlet until all jobs reach a running state. This could take significant time due to workflow throttling. Enter-PSSession cmdlet. Process record. This method will until the runspace is opened and warnings if any are reported Create temporary remote runspace. Write error create remote runspace failed. Write invalid argument error. When the client remote session reports a URI redirection, this method will report the message to the user as a Warning using Host method calls. Create runspace when computer name parameter specified. Create runspace when uri parameter specified. Get runspace matching condition. Get runspace matching runspace id. Get runspace matching session id. Get runspace matching name. Disable ThrottleLimit parameter inherited from base class. Computer name parameter. Runspace parameter. ConnectionUri parameter. RemoteRunspaceId of the remote runspace info object. SessionId of the remote runspace info object. Name of the remote runspace info object. When set and in loopback scenario (localhost) this enables creation of WSMan host process with the user interactive token, allowing PowerShell script network access, i.e., allows going off box. When this property is true and a PSSession is disconnected, reconnection is allowed only if reconnecting from a PowerShell session on the same box. Exit-PSSession cmdlet. Process record. IMPORTANT: proxy configuration is supported for HTTPS only; for HTTP, the direct connection to the server is used ProxyAccessType is not specified. That means Proxy information (ProxyAccessType, ProxyAuthenticationMechanism and ProxyCredential)is not passed to WSMan at all. use the Internet Explorer proxy configuration for the current user. Internet Explorer proxy settings for the current active network connection. This option requires the user profile to be loaded, so the option can be directly used when called within a process that is running under an interactive user account identity; if the client application is running under a user context different than the interactive user, the client application has to explicitly load the user profile prior to using this option. proxy settings configured for WinHTTP, using the ProxyCfg.exe utility Force autodetection of proxy do not use a proxy server - resolves all host names locally Options for a remote PSSession Creates a new instance of The MaximumConnectionRedirectionCount parameter enables the implicit redirection functionality. -1 = no limit 0 = no redirection If false, underlying WSMan infrastructure will compress data sent on the network. If true, data will not be compressed. Compression improves performance by reducing the amount of data sent on the network. Compression my require extra memory consumption and CPU usage. In cases where available memory / CPU is less, set this property to "true". By default the value of this property is "false". If true then Operating System won't load the user profile (i.e. registry keys under HKCU) on the remote server which can result in a faster session creation time. This option won't have any effect if the remote machine has already loaded the profile (i.e. in another session). By default, ProxyAccessType is None, that means Proxy information (ProxyAccessType, ProxyAuthenticationMechanism and ProxyCredential)is not passed to WSMan at all. The following is the definition of the input parameter "ProxyAuthentication". This parameter takes a set of authentication methods the user can select from. The available options should be as follows: - Negotiate: Use the default authentication (as defined by the underlying protocol) for establishing a remote connection. - Basic: Use basic authentication for establishing a remote connection - Digest: Use Digest authentication for establishing a remote connection Default is Negotiate. The following is the definition of the input parameter "ProxyCredential". When connecting over HTTPS, the client does not validate that the server certificate is signed by a trusted certificate authority (CA). Use only when the remote computer is trusted by other means, for example, if the remote computer is part of a network that is physically secure and isolated or the remote computer is listed as a trusted host in WinRM configuration Indicates that certificate common name (CN) of the server need not match the hostname of the server. Used only in remote operations using https. This option should only be used for trusted machines. Indicates that certificate common name (CN) of the server need not match the hostname of the server. Used only in remote operations using https. This option should only be used for trusted machines The duration for which PowerShell remoting waits before timing out for any operation. The user would like to tweak this timeout depending on whether he/she is connecting to a machine in the data center or across a slow WAN. Default: 3*60*1000 == 3minutes Specifies that no encryption will be used when doing remote operations over http. Unencrypted traffix is not allowed by default and must be enabled in the local configuration Indicates the request is encoded in UTF16 format rather than UTF8 format; UTF8 is the default. Uses Service Principal Name (SPN) along with the Port number during authentication. Determines how server in disconnected state deals with cached output data when the cache becomes filled. Default value is 'block mode' where command execution is blocked after the server side data cache becomes filled. Culture that the remote session should use UI culture that the remote session should use Total data (in bytes) that can be received from a remote machine targeted towards a command. If null, then the size is unlimited. Default is unlimited data. Maximum size (in bytes) of a deserialized object received from a remote machine. If null, then the size is unlimited. Default is 200MB object size. Application arguments the server can see in The duration for which PowerShell remoting waits before timing out on a connection to a remote machine. Simply put, the timeout for a remote runspace creation. The user would like to tweak this timeout depending on whether he/she is connecting to a machine in the data center or across a slow WAN. Default: 3 * 60 * 1000 = 3 minutes The duration for which PowerShell should wait before it times out on cancel operations (close runspace or stop powershell). For instance, when the user hits ctrl-C, New-PSSession cmdlet tries to call a stop on all remote runspaces which are in the Opening state. The user wouldn’t mind waiting for 15 seconds, but this should be time bound and of a shorter duration. A high timeout here like 3 minutes will give the user a feeling that the PowerShell client has hung. Default: 60 * 1000 = 1 minute The duration for which a Runspace on server needs to wait before it declares the client dead and closes itself down. This is especially important as these values may have to be configured differently for enterprise administration and exchange scenarios. Default: -1 -> Use current server value for IdleTimeout. This class implements New-PSSessionOption cmdlet. Spec: TBD Performs initialization of cmdlet execution. The MaximumRedirection parameter enables the implicit redirection functionality -1 = no limit 0 = no redirection If false, underlying WSMan infrastructure will compress data sent on the network. If true, data will not be compressed. Compression improves performance by reducing the amount of data sent on the network. Compression my require extra memory consumption and CPU usage. In cases where available memory / CPU is less, set this property to "true". By default the value of this property is "false". If true then Operating System won't load the user profile (i.e. registry keys under HKCU) on the remote server which can result in a faster session creation time. This option won't have any effect if the remote machine has already loaded the profile (i.e. in another session). Culture that the remote session should use UI culture that the remote session should use Total data (in bytes) that can be received from a remote machine targeted towards a command. If null, then the size is unlimited. Default is unlimited data. Maximum size (in bytes) of a deserialized object received from a remote machine. If null, then the size is unlimited. Default is unlimited object size. Specifies the output mode on the server when it is in Disconnected mode and its output data cache becomes full. Application arguments the server can see in The duration for which PowerShell remoting waits (in milliseconds) before timing out on a connection to a remote machine. Simply put, the timeout for a remote runspace creation. The user would like to tweak this timeout depending on whether he/she is connecting to a machine in the data center or across a slow WAN. The duration for which PowerShell should wait (in milliseconds) before it times out on cancel operations (close runspace or stop powershell). For instance, when the user hits ctrl-C, New-PSSession cmdlet tries to call a stop on all remote runspaces which are in the Opening state. The user wouldn’t mind waiting for 15 seconds, but this should be time bound and of a shorter duration. A high timeout here like 3 minutes will give the user a feeling that the PowerShell client has hung. The duration for which a Runspace on server needs to wait (in milliseconds) before it declares the client dead and closes itself down. This is especially important as these values may have to be configured differently for enterprise administration scenarios. By default, ProxyAccessType is None, that means Proxy information (ProxyAccessType, ProxyAuthenticationMechanism and ProxyCredential)is not passed to WSMan at all. The following is the definition of the input parameter "ProxyAuthentication". This parameter takes a set of authentication methods the user can select from. The available options should be as follows: - Negotiate: Use the default authentication (as defined by the underlying protocol) for establishing a remote connection. - Basic: Use basic authentication for establishing a remote connection - Digest: Use Digest authentication for establishing a remote connection The following is the definition of the input parameter "ProxyCredential". The following is the definition of the input parameter "SkipCACheck". When connecting over HTTPS, the client does not validate that the server certificate is signed by a trusted certificate authority (CA). Use only when the remote computer is trusted by other means, for example, if the remote computer is part of a network that is physically secure and isolated or the remote computer is listed as a trusted host in WinRM configuration The following is the definition of the input parameter "SkipCNCheck". Indicates that certificate common name (CN) of the server need not match the hostname of the server. Used only in remote operations using https. This option should only be used for trusted machines The following is the definition of the input parameter "SkipRevocation". Indicates that certificate common name (CN) of the server need not match the hostname of the server. Used only in remote operations using https. This option should only be used for trusted machines The following is the definition of the input parameter "Timeout". Defines the timeout in milliseconds for the wsman operation The following is the definition of the input parameter "UnEncrypted". Specifies that no encryption will be used when doing remote operations over http. Unencrypted traffix is not allowed by default and must be enabled in the local configuration The following is the definition of the input parameter "UTF16". Indicates the request is encoded in UTF16 format rather than UTF8 format; UTF8 is the default. Uses Service Principal Name (SPN) along with the Port number during authentication. Implementing type for WSManConfigurationOption Constructor that instantiates with default values LoadFromDefaults ConstructQuotas ConstructOptionsXmlAttributes ConstructOptionsXmlAttributes ProcessIdleTimeout in Seconds MaxIdleTimeout in Seconds MaxSessions MaxConcurrentCommandsPerSession MaxSessionsPerUser MaxMemoryPerSessionMB MaxProcessesPerSession MaxConcurrentUsers IdleTimeout in Seconds OutputBufferingMode Command to create an object for WSManConfigurationOption Overriding the base method MaxIdleTimeoutSec ProcessIdleTimeoutSec MaxSessions MaxConcurrentCommandsPerSession MaxSessionsPerUser MaxMemoryPerSessionMB MaxProcessesPerSession MaxConcurrentUsers IdleTimeoutMs OutputBufferingMode New-PSSessionConfigurationFile command implementation See Declarative Initial Session State (DISC) Gets the visibility default value Combines a hashtable into a single string block hashtable to combine stream writer string block Combines an array of hashtables into a single string block hash tables stream writer string block Combines an array of strings into a single string block string values string block Combines an array of strings or hashtables into a single string block string or hashtable values This routine builds a fragment of the config file for a particular key. It returns a formatted string that includes a comment describing the key as well as the key and its value. The manifest key to use resourceString that holds the message The formatted manifest fragment Streamwriter to get end of line character from Return a single-quoted string. Any embedded single quotes will be doubled. The string to quote The quoted string Return a script block string wrapped in curly braces. The string to wrap The wrapped string Destination path Configuration file schema version Configuration file GUID Author of the configuration file Company name Copyright information Description PowerShell version Specifies type of initial session state to use. Valid values are Empty and Default. A list of modules to import A list of assemblies to load A list of visible aliases A list of visible cmdlets A list of visible functions A list of providers A list of alises A list of functions A list of variables A list of environment variables A list of types to process A list of format data to process Languange mode Execution policy Scripts to process Test-PSSessionConfigurationFile command implementation See Declarative Initial Session Config (DISC) The output path for the generated file... Event arguments passed to TransportErrorOccured handlers. Constructor Error occurred. The transport method that raised the error Gets the error occurred. Transport method that is reporting this error. Robust Connection notifications. ConnectionStatusEventArgs CreateCompleteEventArgs Contains implementation that is common to both client and server transport managers Uses the "OnDataAvailableCallback" to handle Deserialized objects data to process priority stream this data belongs to data to process priority stream this data belongs to used by the caller to supply a callback to handle deserialized object. Since dataAvailableCallback is called in this method, and the handler may be handled by 3rd party code (eventually),this may throw any exception. The handler may be handled by 3rd party code (eventually), this may throw any exception. copy the DataReceived event handlers to the supplied transport Manager Raise the error handlers Dispose the transport and release resources. Event that is raised when a remote object is available. The event is raised from a WSMan transport thread. Since this thread can hold on to a HTTP connection, the event handler should compelete processing as fast as possible. Importantly the event handler should not generate any call that results in a user request like host.ReadLine(). Listen to this event to observe the PowerShell guid of the process'ed object. This is needed to deserialize objects coming from the network. This may be null..in which case type rehydration does not happen. At construction time we may not have typetable (server runspace is created only when a request from the client)..so this is a property on the base tranpsort manager to allow for setting at a later time. Crypto handler to be used for encrypting/decrypting secure strings A data buffer used to store data received from remote machine. Raise the Connect completed handler Raise the close completed handler Raise the ReadyForDisconnect event. Queue the robust connection notification event. Determines what kind of notification Raise the Robust Connection notification event. ConnectionStatusEventArgs Enqueue a deserialized object or an Exception to process in a thread pool thread. Processing Exception in a thread pool thread is important as calling WSManCloseShell/Command from a Receive callback results in a deadlock. Deserialized Object to process in a thread-pool thread. This should be null when is specified. Data that is neither RemoteObject or Exception. This is used by Client Command Transport manager to raise SignalCompleted callback. Error containing transport exception. Used by ServicePendingCallbacks to give the control to derived classes for processing data that the base class does not understand. Derived class specific data to process. For command transport manager this should be a boolean. The caller should make sure the call is synchronized. Method to have transport prepare for a disconnect operation. Method to resume post disconnect operations. Finalizer Event that is raised when a create operation on transport has been successfully completed The event is raised from a WSMan transport thread. Since this thread can hold on to a HTTP connection, the event handler should compelete processing as fast as possible. Importantly the event handler should not generate any call that results in a user request like host.ReadLine(). Errors (occurred during connection attempt) are reported through WSManTransportErrorOccured event. Event that is raised when a remote connection is successfully closed. The event is raised from a WSMan transport thread. Since this thread can hold on to a HTTP connection, the event handler should compelete processing as fast as possible. Importantly the event handler should not generate any call that results in a user request like host.ReadLine(). Errors (occurred during connection attempt) are reported through WSManTransportErrorOccured event. The eventhandler should make sure not to throw any exceptions. Indicated successfull completion of a connect operation on transport Errors are reported through WSManTransportErrorOccured event. Indicated successfull completion of a disconnect operation on transport Errors are reported through WSManTransportErrorOccured event. Indicated successfull completion of a reconnect operation on transport Errors are reported through WSManTransportErrorOccured event. Indicates that the transport/command is ready for a disconnect operation. Errors are reported through WSManTransportErrorOccured event. Event to pass Robust Connection notifications to client. Indicates successful processing of a delay stream request on a receive operation this event is useful when PS wants to invoke a pipeline in disconnected mode Gets the data collection which is used by this tranport manager to send data to the server. Used to log crimson messages Creates a command transport manager. This will create a new PrioritySendDataCollection which should be used to send data to the server. Connection info to be used for creating the command. Command for which transport manager is created. true if the command has input. RunspacePool data structure handler uses this method to remove association of a command transport manager from a session transport manager. Temporarily disconnect an active session Reconnect back a temporarily disconnected session. Redirect the transport manager to point to a new URI. Redirect Uri to connect to. Connection info object used for retrieving credential, auth. mechanism etc. Used by callers to prepare the session transportmanager for a URI redirection. This must be called only after Create callback (or Error form create) is received. Callers must catch the close completed event and call Redirect to perform the redirection. Reconnects a previously disconnected commandTM. Implemented by WSMan transport Note that there is not explicit disconnect on commandTM. It is implicity disconnected when disconnect is called on sessionTM . The TM's also dont maintain specific connection state This is done by DSHandlers. Used by powershell/pipeline to send a stop message to the server command This represents an abstraction for server transport manager. The actual implemention is in pspluginwkr-v3.dll. Sends an object from the server end. The object is fragmented and each fragement is sent separately. The call blocks until all the fragements are sent to the client. If there is a failure sending any of the fragments WSManTransportErrorOccured event is raised. true to immediately send data to client. reported as true when host message requests are sent to client Sends an object to the server end. The object is fragmented and each fragement is sent separately. The call blocks until all the fragements are sent to the client. If there is a failure sending any of the fragments WSManTransportErrorOccured event is raised. true to immediately send data to client. reported as true when sending host message requests are reported true Reports error from a thread pool thread. Thread Pool is used in order to not block Pipeline closing. This method is generally called when the TransportManager fails to Send data (SendDataToClient). Pipeline Execution Thread directly calls SendDataToClient method from its execution thread, so we cannot call Stop from the same thread (as it will result in a deadlock) Raises the closing event. flush data by sending data immediately to the client. reported as true when sending host message requests to client reported as true when data being reported is as object boundary, i.e the corresponding fragment is an end fragment message describing why the transport manager must be closed Prepare the transport manager to send data (because a command is about to start). This is used by underlying infrastructure to send ACK to client..so client can start sending input and other data to server. Event that is raised when this transport manager is closing. This represents an abstraction for server session transport manager. The actual implemention is in pspluginwkr-v3.dll. Server RunspacePool driver uses this method to attach to a server transport manager. Server RunspacePool driver uses this method to remove association of a command transport manager from a session transport manager. This struct is used to represent contents from configuration xml. The XML is passed to plugins by WSMan API. This helper does not validate XML content as it is already validated by WSMan. Using optionName and optionValue updates the current object 1. "optionName" is not valid in "InitializationParameters" section. 2. "startupscript" must specify a PowerShell script file that ends with extension ".ps1". Checks if the originalValue is empty. If not throws an exception 1. "optionName" is already defined Converts the value specified by to int. Multiplies the value by 1MB (1024*1024) to get the number in bytes. If value is specified, specified value as int . otherwise null. Creates the struct from initialization parameters xml. Initialization Parameters xml passed by WSMan API. This data is read from the config xml and is in the following format: 1. "optionName" is already defined 1. Unable to load type "{0}" specified in "InitializationParameters" section. InitialSessionStateProvider is used by 3rd parties to provide shell configurtion on the remote server. Tracer for Server Remote session Derived classes must override this to supply an InitialSesionState to be used to construct a Runspace for the user User Identity for which this information is requested Maximum size (in bytes) of a deserialized object received from a remote machine. If null, then the size is unlimited. Default is 10MB. User Identity for which this information is requested Total data (in bytes) that can be received from a remote machine targeted towards a command. If null, then the size is unlimited. Default is 50MB. User Identity for which this information is requested Derived classes can override this method to provide application private data that is going to be sent to the client and exposed via , and User Identity for which this information is requested Application private data or null Disose this configuraiton object. This will be called when a Runspace/RunspacePool created using InitialSessionState from this object is Closed. Initialization Parameters xml passed by WSMan API. This data is read from the config xml and is in the following format: 1. Non existent InitialSessionState provider for the shellID shellId for which the assembly is getting loaded type which is supplying the configuration. Type instance representing the EndPointConfiguration to load. This Type can be instantiated when needed. Sets the application's current working directory to and loads the assembly . Once the assembly is loaded, the application's current working directory is set back to the orginal value. Read value from the property for registry as string. Registry key from which the value is read. Caller should make sure this is not null. Name of the property. Caller should make sure this is not null. True, if the property should exist. False, otherwise. Value of the property. Provides Default InitialSessionState. Specifies type of initial session state to use. Valid values are Empty and Default. Empty session state Restricted remote server Default session state Configuration type entry Configuration file constants Checks if the given key is a valid key Verifies a string type Verifies a string array type Verifies that an array contains only string or hashtable elements DISC utilities Create an ExternalScriptInfo object from a file path. execution context The path to the file The base name of the script The ExternalScriptInfo object. Loads the configuration file into a hashtable execution context the ExternalScriptInfo object configuration hashtable Verifies the configuration hashtable configuraiton hashtable true if valid, false otherwise Checks if all paths are absolute paths Checks if a path is an absolute path Provides ISS for declaration initial session configuration Class constructor Creates an initial session state from a configuration file (DISC) Creates an alias entry Creates a function entry Creates a variable entry Applies the command (cmdlet/function/alias) visibility settings to the Attempts to get a value from a hashtable Attempts to get a hastable array from an object Attemps to get a string array from a hashtable Configuration hashtable Checks if the originalValue is empty. If not throws an exception 1. "optionName" is already defined Using optionName and optionValue updates the current object 1. "optionName" is not valid in "InitializationParameters" section. 2. "startupscript" must specify a PowerShell script file that ends with extension ".ps1". Common method to create a packet that contains only a PS Guid with element name changing Process's data. Data should be a valid XML. 1. Expected only two attributes with names "{0}" and "{1}" in "{2}" element. 2. Not enough data available to process "{0}" element. 3. Unknown node "{0}" in "{1}" element. Only "{2}" is expected in "{1}" element. Process an XmlElement. The element name must be one of the following: "Data" 1. Expected only two attributes with names "{0}" and "{1}" in "{2}" element. 2. Not enough data available to process "{0}" element. 3. Unknown node "{0}" in "{1}" element. Only "{2}" is expected in "{1}" element. A wrapper around TextWriter to allow for synchronized writing to a stream. Synchronization is required to avoid collision when multiple TransportManager's write data at the same time to the same writer Constructs the wrapper Calls writer.WriteLine() with data. Stops the writer from writing anything to the stream. This is used by session transport manager when the server process is exited but the session data structure handlers are not notified yet. So while the data structure handler is disposing we should not let anyone use the stream. Launch a new Process (PowerShell.exe -s) to perform remoting. This is used by *-Job cmdlets to support background jobs without depending on WinRM (WinRM has complex requirements like elevation to support local machine remoting) 1. There was an error in opening the associated file. Closes the server process. Create a transport manager for command Kills the server process and disposes other resources Used by ServicePendingCallbacks to give the control to derived classes for processing data that the base class does not understand. Derived class specific data to process. For command transport manager this should be a boolean. This indicate that the data will be sent without priority consideration. Large data objects will be fragmented so that each fragmented piece can fit into one message. PromptReponse may be sent with or without priority considerations. Large data objects will be fragmented so that each fragmented piece can fit into one message. DataStructure used by different remoting protocol / DataStructures to pass data to transport manager. This class holds the responsibility of fragmenting. This allows to fragment an object only once and send the fragments to various machines thus saving fragmentation time. Constructs a PrioritySendDataCollection object. Adds data to this collection. The data is fragmented in this method before being stored into the collection. So the calling thread will get affected, if it tries to add a huge object. data to be added to the collection. Caller should make sure this is not null. Priority of the data. Adds data to this collection. The data is fragmented in this method before being stored into the collection. So the calling thread will get affected, if it tries to add a huge object. The data is added with Default priority. data to be added to the collection. Caller should make sure this is not null. Clears fragmented objects stored so far in this collection. Gets the fragment or if no fragment is available registers the callback which gets called once a fragment is available. These 2 steps are performed in a synchronized way. While getting a fragment the following algorithm is used: 1. If this is the first time or if the last fragement read is an EndFragment, then a new set of fragments is chosen based on the implicit priority. PromptResponse is higher in priority order than default. 2. If last fragment read is not an EndFragment, then next fragment is chosen from the priority collection as the last fragment. This will ensure fragments are sent in order. Callback to call once data is available. (This will be used if no data is currently available). Priority stream to which the returned object belongs to, if any. If the call does not return any data, the value of this "out" parameter is undefined. A FragementRemoteObject if available, otherwise null. Callback that is called once a fragmented data is available to send. Fragemented object that can be sent to the remote end. Priority stream to which belongs to. DataStructure used by remoting transport layer to store data being received from the wire for a particular priority stream. Defragmentor used to deserialize an object. True if a client transport manager created this collection. This is used to generate custom messages for server and client. This might be needed only for ServerCommandTransportManager case where the command is run in the same thread that runs ProcessRawData (to avoid thread context switch). By default this class supports only one thread in ProcessRawData. Prepares the collection for a stream connect When reconneting from same client, its possible that fragment stream get interrupted if server is dropping data When connecting from a new client, its possible to get trailing fragments of a previously partially transmitted object Logic based on this flag, ensures such offsync/trailing fragments get ignored until the next full object starts flowing Process data coming from the transport. This method analyses the data and if an object can be created, it creates one and calls the with the deserialized object. This method does not assume all fragments to be available. So if not enough fragments are available it will simply return.. Data to process. Callback to call once a complete deserialized object is available. Defragmented Object if any, otherwise null. 1. Fragmet Ids not in sequence 2. Object Ids does not match 3. The current deserialized object size of the received data exceeded allowed maximum object size. The current deserialized object size is {0}. Allowed maximum object size is {1}. Might throw other exceptions as the deserialized object is handled here. Resets the store(s) holding received data. Dispose and release resources. Limits the deserialized object size received from a remote machine. Callback that is called once a deserialized object is available. Deserialized object that can be processed. DataStructure used by different remoting protocol / DataStructures to receive data from transport manager. This class holds the responsibility of defragmenting and deserializing. Construct a priority recieve data collection Defragmentor used to deserialize an object. True if a client transport manager created this collection. This is used to generate custom messages for server and client. Prepares receive data streams for a reconnection This might be needed only for ServerCommandTransportManager case where the command is run in the same thread that runs ProcessRawData (to avoid thread context switch). By default this class supports only one thread in ProcessRawData. Process data coming from the transport. This method analyses the data and if an object can be created, it creates one and calls the with the deserialized object. This method does not assume all fragments to be available. So if not enough fragments are available it will simply return.. Data to process. Priorty stream this data belongs to. Callback to call once a complete deserialized object is available. Defragmented Object if any, otherwise null. 1. Fragmet Ids not in sequence 2. Object Ids does not match 3. The current deserialized object size of the received data exceeded allowed maximum object size. The current deserialized object size is {0}. Allowed maximum object size is {1}. 4.The total data received from the remote machine exceeded allowed maximum. The total data received from remote machine is {0}. Allowed maximum is {1}. Might throw other exceptions as the deserialized object is handled here. Dispose and release resources. Limits the total data received from a remote machine. Limits the deserialized object size received from a remote machine. This class is used in the server side remoting scenarios. This class holds information about the incoming connection like: (a) Client's TimeZone (b) Connecting User information (c) Connection String used by the user to connect to the server. Serialization Deserialization constructor Constructs PSPrincipal using PSIdentity and a token (used to construct WindowsIdentity) Connecting User Information httpUrl element (from WSMAN_SENDER_DETAILS struct). Contains information related to the user connecting to the server Contains the TimeZone information from the client machine. Connection string used by the client to connect to the server. This is directly taken from WSMAN_SENDER_DETAILS struct (from wsman.h) Application arguments (i.e. specified in New-PSSessionOptions -ApplicationArguments) Defines the basic functionality of a PSPrincipal object. Determines if the current principal belongs to a specified rule. If we were able to get a WindowsIdentity then this will perform the check using the WindowsIdentity otherwise this will return false. If we were able to get a WindowsIdentity then this will perform the check using the WindowsIdentity otherwise this will return false. Internal overload of IsInRole() taking a WindowsBuiltInRole enum value Constructs PSPrincipal using PSIdentity and a token (used to construct WindowsIdentity) An instance of PSIdentity An instance of WindowsIdentity, if psIdentity represents a windows user. This can be null. Gets the identity of the current user principal. Gets the WindowsIdentity (if possible) representation of the current Identity. PSPrincipal can represent any user for example a LiveID user, network user within a domain etc. This property tries to convert the Identity to WindowsIdentity using the user token supplied. Gets the identity of the current principal. Defines the basic functionality of a PSIdentity object. Constructor used to construt a PSIdentity object Type of authentication used to authenticate this user. For a WSMan service autheticated user this will be one of the following: WSMAN_DEFAULT_AUTHENTICATION WSMAN_NO_AUTHENTICATION WSMAN_AUTH_DIGEST WSMAN_AUTH_NEGOTIATE WSMAN_AUTH_BASIC WSMAN_AUTH_KERBEROS WSMAN_AUTH_CLIENT_CERTIFICATE WSMAN_AUTH_LIVEID true if this user is authenticated. Name of the user Certificate details if Certifiate authentication is used. Gets the type of authentication used. For a WSMan service autheticated user this will be one of the following: WSMAN_DEFAULT_AUTHENTICATION WSMAN_NO_AUTHENTICATION WSMAN_AUTH_DIGEST WSMAN_AUTH_NEGOTIATE WSMAN_AUTH_BASIC WSMAN_AUTH_KERBEROS WSMAN_AUTH_CLIENT_CERTIFICATE WSMAN_AUTH_LIVEID Gets a value that indicates whether the user has been authenticated. Gets the name of the user. Gets the certificate details of the user if supported, null otherwise. Represents the certificate of a user. Constructor used to construt a PSCertificateDetails object Subject of the certificate. Issuer name of the certificate. Issuer thumb print of the certificate. Gets Subject of the certificate. Gets the issuer name of the certificate. Gets the issuer thumb print. WSMan TransportManager related utils Constructs a WSManTransportErrorOccuredEventArgs instance from the supplied data WSMan API handle to use to get error messages from WSMan error id(s) Session Transportmanager to use to get error messages (for redirect) Error structure supplied by callbacks from WSMan API The transport method call that reported this error. resource string that holds the message. Arguments to pass to the resource An instance of WSManTransportErrorOccuredEventArgs Helper method that escapes powershell parser recognized strings like "@{" from the error message string. This is needed to make error messages look authentic. Some WSMan error messages provide a command line to run to fix certain issues. WSMan command line has syntax that allows use of @{}. PowerShell parser treats them differently..and so when user cut and paste the command line in a PowerShell console, it wont work. This escape logic works around the issue. Helper method to convert a transport error code value to a fully qualified error Id string. transport error code Default FQEID Fully qualified error Id string Class that manages a server session. This doesn't implement IDisposable. Use Close method to clean the resources. Max uri redirection count session variable. Default max uri redirection count - wsman Static constructor to initialize WSMan Client stack. Constructor. This will create a new PrioritySendDataCollection which should be used to send data to the server. This is used for logging trace/operational crimson messages. Having this id in the logs helps a user to map which transport is created for which runspace. Connection info to use while connecting to the remote machine. crypto helper session friendly name 1. Create Session failed with a non-zero error code. Sets default timeout for all client operations in milliseconds. TODO: Sync with WSMan and figure out what the default is if we dont set. Setting session option failed with a non-zero error code. Sets timeout for Create operation in milliseconds. Setting session option failed with a non-zero error code. Sets timeout for Close operation in milliseconds Setting session option failed with a non-zero error code. Sets timeout for SendShellInput operation in milliseconds Setting session option failed with a non-zero error code. Sets timeout for Receive operation in milliseconds Setting session option failed with a non-zero error code. Sets timeout for Signal operation in milliseconds Setting session option failed with a non-zero error code. Sets a DWORD value for a WSMan Session option. Setting session option failed with a non-zero error code. Sets a string value for a WSMan Session option. Setting session option failed with a non-zero error code. Starts connecting to an existing remote session. This will result in a WSManConnectShellEx WSMan async call. Piggy backs available data in input stream as openXml in connect SOAP. DSHandler will push negotiation related messages through the open content WSManConnectShellEx failed. Starts connecting to remote end asynchronously. This will result in a WSManCreateShellEx WSMan async call. By the time this call returns, we will have a valid handle, if the operation succeeds. Make sure other methods are called only after this method returns. Thread synchronization is left to the caller. WSManCreateShellEx failed. Closes the pending Create,Send,Receive operations and then closes the shell and release all the resources. The caller should make sure this method is called only after calling ConnectAsync. Adjusts for any variations in different protocol versions. Following changes are considered - In V2, default max envelope size is 150KB while in V3 it has been changed to 500KB. With default configuration remoting from V3 client to V2 server will break as V3 client can send upto 500KB in a single Send packet So if server version is known to be V2, we'll downgrade the max env size to 150KB (V2's default) if the current value is 500KB (V3 default) server negotiated protocol version Used by callers to prepare the session transportmanager for a URI redirection. This must be called only after Create callback (or Error form create) is received. This will close the internal WSMan Session handle. Callers must catch the close completed event and call Redirect to perform the redirection. Redirect the transport manager to point to a new URI. Redirect Uri to connect to. Connection info object used for retrieving credential, auth. mechanism etc. 1. Create Session failed with a non-zero error code. Creates a command transport manager. This will create a new PrioritySendDataCollection which should be used to send data to the server. Connection info to be used for creating the command. Command for which transport manager is created. true if the command has input. Initializes the session. Uri to connect to. Connection info object used for retrieving credential, auth. mechanism etc. 1. Create Session failed with a non-zero error code. Handle transport error - calls EnqueueAndStartProcessingThread to process transport exception in a different thread Logic in transport callbacks should always use this to process a transport error Log the error message in the Crimson logger and raise error handler. receive/send operation handles and callback handles should be released/disposed from receive/send callback only. Releasing them after CloseOperation() may not cover all the scenarios, as WSMan does not guarantee that a rcv/send callback is not called after Close completed callback. Call back from worker thread / queue to raise Robust Connection notification event. ConnectionStatusEventArgs Closes current session handle by calling WSManCloseSession and clears session related resources. Robust connection maximum retry time in milliseconds Returns the WSMan's session handle that this Session transportmanager is proxying. Returns the WSManConnectionInfo used to make the connection. Class that manages a WSManAPIStaticData. Has information like APIHandle which is created using WSManInitialize, InputStreamSet, OutputStreamSet. Initializes handle by calling WSManInitialize API Finalizer which calls WSManDeInitialize. A class maintaining the transport of a command for the shell. Multiple commands will have multiple transport managers. The Transport manager manages creating / sending /receiving data and closing (terminating) the command. This is an internal constructor used by WSManClientSessionTransportManager. connection info to be used for creating the command. Shell operation handle in whose context this transport manager sends/receives data packets. The command to be sent to the remote end. true if the command has input, false otherwise. Session transport manager creating this command transport manager instance. Used by Command TM to apply session specific properties WSManConnectShellCommandEx failed. WSManRunShellCommandEx failed. Restores connection on a disconnected command Used by powershell/pipeline to send a stop message to the server command Closes the pending Create,Send,Receive operations and then closes the shell and release all the resources. Handle transport error - calls EnqueueAndStartProcessingThread to process transport exception in a different thread Logic in transport callbacks should always use this to process a transport error Log the error message in the Crimson logger and raise error handler. Used by ServicePendingCallbacks to give the control to derived classes for processing data that the base class does not understand. Derived class specific data to process. For command transport manager this should be a boolean. receive/send operation handles and callback handles should be released/disposed from receive/send callback only. Releasing them after CloseOperation() may not cover all the scenarios, as WSMan does not guarantee that a rcv/send callback is not called after Close completed callback. Method to have transport prepare for a disconnect operation. Method to resume post disconnect operations. The WinRM service cannot process the request because the request needs to be sent to a different machine. Use the redirect information to send the request to a new machine. 0x8033819B from sdk\inc\wsmerror.h The WS-Management service cannot process the request. The resource URI is missing or it has an incorrect format. Check the documentation or use the following command for information on how to construct a resource URI: "winrm help uris". The WinRM service cannon re-connect the session because the session is no longer associated with this transportmanager object. Sending data to a remote command failed with the following error message: The client cannot connect to the destination specified in the request. Verify that the service on the destination is running and is accepting requests. Consult the logs and documentation for the WS-Management service running on the destination, most commonly IIS or WinRM. If the destination is the WinRM service, run the following command on the destination to analyze and configure the WinRM service: Sending data to a remote command failed with the following error message: The WinRM client cannot complete the operation within the time specified. Check if the machine name is valid and is reachable over the network and firewall exception for Windows Remote Management service is enabled. This API is used to initialize the WinRM client; It can be used by different clients on the same process, ie svchost.exe. Returns a nonzero error code upon failure. This API deinitializes the Winrm client stack; all operations will finish before this API will return; this is a sync call; it is highly recommended that all operations are explictly cancelled and all sessions are closed before calling this API Returns non zero error code upon failure. Creates a session which can be used to perform subsequent operations Returns a non zero error code upon failure. if NULL, then connection will default to 127.0.0.1 can be null. Frees memory of session and closes all related operations before returning; this is sync call it is recommended that all pending operations are either completed or cancelled before calling this API. Returns a non zero error code upon failure WSManSetSessionOption API - set session options Returns a non zero error code upon failure An int (DWORD) data. WSManGetSessionOptionAsDword API - get a session option. Returns a non zero error code upon failure An int (DWORD) data. Function that retrieves a WSMan session option as string. Thread.CurrentUICulture will be used as the language code to get the error message in. session option to get Creates a shell on the remote end. Session in which the shell is created. The resource Uri to use to create the shell. startup information to be passed to the shell. Options to be passed with CreateShell any content that is used by the remote shell to startup. callback to notify when the create operation completes. An out parameter referening a WSMan shell operation handle for this shell. Starts a command on the remote end. Shell handle in which the command is created and run. command line for the command. arguments for the command. options. callback to notify when the operation completes. An out parameter referening a WSMan shell operation handle for this command. Registers a callback with WSMan to receive output from the remote end. If commandOperationHandle is null, then the receive callback is registered for shell. It is enough to register the callback only once. WSMan will keep on calling this callback as and when it has data for a particular command + shell. There will be only 1 callback active per command or per shell. So if there are multiple commands active, then there can be 1 callback active for each of them. TODO: How to unregister the callback Shell Operation Handle. Command Operation Handle. If null, the receive request corresponds to the shell. callback which receives the data asynchronoulsy. handle to use to cancel the operation. Send data to the remote end. Shell Operation Handle. Command Operation Handle. If null, the send request corresponds to the shell. callback to notify when the operation completes. handle to use to cancel the operation. Closes a shell or a command; if the callback associated with the operation is pending and have not completed when WSManCloseShellOperationEx is called, the function waits for the callback to finish; If the operation was not finished, the operation is cancelled and the operation callback is called with WSMAN_ERROR_OPERATION_ABORTED error; then the WSManCloseShellOperationEx callback is called with WSMAN_FLAG_CALLBACK_END_OF_OPERATION flag as result of this operation Shell handle to Close. callback to notify when the operation completes. Closes a command (signals the termination of a command); the WSManCloseCommand callback is called with WSMAN_FLAG_CALLBACK_END_OF_OPERATION flag as result of this operation Command handle to Close. callback to notify when the operation completes. Sends a signal. If is null, then the signal will be sent to shell. Closes an asynchronous operation; if the callback associated with the operation is pending and have not completed when WSManCloseOperation is called, then the function marks the operation for deletion and returns; If the callback was not called, the operation is cancelled and the operation callback is called with WSMAN_ERROR_OPERATION_ABORTED error; the operation handle is freed in all cases after the callback returns. Function that retrieves WSMan error messages with a particular error code. Thread.CurrentUICulture will be used as the language code to get the error message in. Function that retrieves WSMan error messages with a particular error code and a language code The handle returned by WSManInitialize API call. It cannot be NULL. Reserved for future use. It must be 0. Defines the RFC 3066 language code name that should be used to localize the error. It can be NULL. if not specified, the thread's UI language will be used. Represents the error code for the requested error message. This error code can be a hexadecimal or decimal component from WSManagement component, WinHttp component or other Windows operating system components. Represents the size of the output message buffer in characters, including the NULL terminator. If 0, then the "message" parameter must be NULL; in this case the function will return ERROR_INSUFFICIENT_BUFFER error and the "messageLengthUsed" parameter will be set to the number of characters needed, including NULL terminator. Represents the output buffer to store the message in. It must be allocated/deallocated by the client. The buffer must be big enough to store the message plus the NULL terminator otherwise an ERROR_INSUFFICIENT_BUFFER error will be returned and the "messageLengthUsed" parameter will be set to the number of characters needed, including NULL terminator. If NULL, then the "messageLength" parameter must be NULL; in this case the function will return ERROR_INSUFFICIENT_BUFFER error and the "messageLengthUsed" parameter will be set to the number of characters needed, including NULL terminator. Represents the effective number of characters written to the output buffer, including the NULL terminator. It cannot be NULL. If both "messageLength" and "message" parameters are 0, the function will return ERROR_INSUFFICIENT_BUFFER and "messageLengthUsed" parameter will be set to the number of characters needed, including NULL terminator A struct holding marshalled data (IntPtr). This is created to supply IDisposable pattern to safely release the unmanaged pointer. Constructs a MarshalledObject with the supplied ptr. Creates a MarshalledObject for the specified object. Must be a value type. MarshalledObject Dispose the unmanaged IntPtr. Implicit cast to IntPtr Gets the unmanaged ptr. Different Authentication Mechanisms supported by WSMan. TODO: By the look of it, this appears like a Flags enum. Need to confirm the behavior with WSMan Please keep in sync with WSManAuthenticationMechanism from C:\e\win7_powershell\admin\monad\nttargets\assemblies\logging\ETW\Manifests\Microsoft-Windows-PowerShell-Instrumentation.man Use the default authentication Use no authentication for a remote operation Use digest authentication for a remote operation Use negotiate authentication for a remote operation (may use kerboros or ntlm) Use basic authentication for a remote operation Use kerberos authentication for a remote operation Use client certificate authentication for a remote operation Use CredSSP authentication for a remote operation This is used to represent _WSMAN_AUTHENTICATION_CREDENTIALS native structure. _WSMAN_AUTHENTICATION_CREDENTIALS has a union member which cannot be easily represented in managed code. So created an interface and each union member is represented with a different structure. Used to supply _WSMAN_USERNAME_PASSWORD_CREDS type credentials for WSManCreateSession. Default constructor Constructs an WSManUserNameAuthenticationCredentials object. It is upto the caller to verify if and are valid. This API wont complain if they are Empty or Null. user name. password. can be 0 (the user did not specify an authentication mechanism, WSMan client will choose between Kerberos and Negotiate only); if it is not 0, it must be one of the values from WSManAuthenticationMechanism enumeration. Marshalled Data Dispose of the resources gets a structure represenation (used for marshalling) making password secure. Constructs an WSManCertificateThumbprintCredentials object. It is upto the caller to verify if is valid. This API wont complain if it is Empty or Null. Marshalled Data Dispose of the resources This is provided for padding as underlying WSMan's implementation uses a union, we need to pad up unused fields. Enum representing native WSManSessionOption enum. int - default timeout in ms that applies to all operations on the client side int - Robust connection maximum retry time in minutes. int - timeout in ms for WSManCreateShellEx operations int - timeout in ms for WSManReceiveShellOutputEx operations int - timeout in ms for WSManSendShellInputEx operations int - timeout in ms for WSManSignalShellEx operations int - timeout in ms for WSManCloseShellOperationEx operations int - 1 to not validate the CA on the server certificate; 0 - default int - 1 to not validate the CN on the server certificate; 0 - default int - 1 to not encrypt the messages; 0 - default int - 1 Send all network packets for remote operatons in UTF16; 0 - default is UTF8 int - 1 When using negotiate, include port number in the connection SPN; 0 - default int - Used when not talking to the main OS on a machine but, for instance, a BMC 1 Identify this machine to the server by including the MachineID header; 0 - default int -1 Enables host process to be created with interactive token. string - RFC 3066 language code string - RFC 3066 language code int - max SOAP envelope size (kb) - default 150kb from winrm config (see 'winrm help config' for more details); the client SOAP packet size cannot surpass this value; this value will be also sent to the server in the SOAP request as a MaxEnvelopeSize header; the server will use min(MaxEnvelopeSizeKb from server configuration, MaxEnvelopeSize value from SOAP). int (read only) - max data size (kb) provided by the client, guaranteed by the winrm client implementation to fit into one SOAP packet; this is an approximate value calculated based on the WSMAN_OPTION_MAX_ENVELOPE_SIZE_KB (default 150kb), the maximum possible size of the SOAP headers and the overhead of the base64 encoding which is specific to WSManSendShellInput API; this option can be used with WSManGetSessionOptionAsDword API; it cannot be used with WSManSetSessionOption API. string - DWORD - 1 to not validate the revocation status on the server certificate; 0 - default DWORD - 1 to allow default credentials for Negotiate (this is for SSL only); 0 - default DWORD - When using just a machine name in the connection string use an SSL connection. 0 means HTTP, 1 means HTTPS. Default is 0. Enum representing WSMan Shell specific options Turn off compression for Send/Receive operations. By default compression is turned on, but if communicating with a down-level box it may be necessary to do this. Other reasons for turning it off is due to the extra memory consumption and CPU utilization that is used as a result of compression. Enable the service to drop operation output when running disconnected Enable the service to block operation progress when output buffers are full Enable receive call to not immediately retrieve results. Only applicable for Receive calls on commands types of suppored WSMan data. PowerShell uses only Text and DWORD (in some places). Used to supply WSMAN_DATA_BINARY/WSMAN_DATA_TEXT type in place of _WSMAN_DATA. Default constructor Constructs a WSMAN_DATA_BINARY object. This is used to send data to remote end. Constructs a WSMAN_DATA_TEXT object. This is used to send data to remote end. Finalizer free unmanaged resources implict IntPtr conversion Gets the type of data. Gets the buffer lenfth of data. Used to supply a DWORD data in place of _WSMAN_DATA. Constructs a WSMAN_DATA_DWORD object. Creates an unmanaged ptr which holds the class data. This unmanaged ptr can be used with WSMan native API. This struct is created to honor struct boundaries between x86,amd64 and ia64. WSMan defines a generic WSMAN_DATA structure that addresses DWORD, binary, text data. WSMan allows multiple streams within a shell but powershell is using only 1 stream for input and 1 stream for output to allow sequencing of data. Because of this the following structure will have only one string to hold stream information. Constructor Free resources. Implicit cast to IntPtr Option struct used to pass optional information with WSManCreateShellEx Option set struct used to pass optional infromation with WSManCreateShellEx Options to construct this OptionSet with. Implicit IntPtr cast. Free resources. Implicit cast to IntPtr Disposes the object. implicit IntPtr. new idletimeout for the server shell that overrides the original idletimeout specified in WSManCreateShell Creates a startup info with 1 startup option. The startup option is intended to specify the version. Disposes the object. implicit IntPtr. PowerShell always uses one stream. So no need to expand this. PowerShell always uses one stream. So no need to expand this. Idle timeout working directory of the shell. Environment variables available to the shell. Environment variables available to the shell. Proxy Info used with WSManCreateSession implicit IntPtr flags used by all callback functions: WSMAN_COMPLETION_FUNCTION, WSMAN_SUBSCRIPTION_COMPLETION_FUNCTION and WSMAN_SHELL_COMPLETION_FUNCTION Completion function used by all Shell functions. Returns error->code != 0 upon error; use error->errorDetail structure for extended error informations; the callback is called for each shell operation; after a WSManReceiveShellOutput operation is initiated, the callback is called for each output stream element or if error; the underlying implementation handles the polling of stream data from the command or shell. If WSMAN_COMMAND_STATE_DONE state is received, no more streams will be received from the command, so the command can be closed using WSManCloseShellOperationEx(command). If error->code != 0, the result is guaranteed to be NULL. The error and result objects are allocated and owned by the WSMan client stack; they are valid during the callback only; the user has to synchronously copy the data in the callback. This callback function will use the current access token, whether it is a process or impersonation token. user supplied operation context. one or more flags from WSManCallbackFlags error allocated and owned by the winrm stack; valid in the callback only; shell handle associated with the user context command handle associated with the user context operation handle associated with the user context output data from command/shell; allocated internally and owned by the winrm stack. valid only within this function. See WSManReceiveDataResult. Struct which holds reference to the callback(delegate) passed to WSMan API Used in different WSMan functions to supply async callback. Used in the shell compeletion function delegate to refer to error. extended error description from the fault; language for error description (RFC 3066 language code); it can be NULL machine id; it can be NULL Constructs a WSManError from the unmanaged pointer. This involves copying data from unmanaged memory to managed heap. Pointer to unmanaged data. Used in the shell compeletion function delegate to refer to the data. The actual data. Stream the data belongs to Constructs a WSManReceiveDataResult from the unmanaged pointer. This involves copying data from unmanaged memory to managed heap. Currently PowerShell supports only text data on the wire, so this method asserst if the data is not text. Pointer to unmanaged data. LogContext is the class to keep track of context information for each event to be logged. LogContext info is collected by Msh Log Engine and passed on to log provider interface. Name of the host. Version of the host. Id of the host that is hosting current monad engine. Version of monad engine. Id for currently running runspace PipelineId of current running pipeline Command text that is typed in from commandline Type of the command, which can be Alias, CommandLet, Script, Application, etc. The value of this property is a usually coversion of CommandTypes enum into a string. Script file name if current command is executed as a result of script run. Path to the command executable file. Extension for the command executable file. Sequence Id for the event to be logged. Current user. Event happening time This property should be filled in when logging api is called directly with LogContext (when ExecutionContext is not available). Execution context is necessary for GetVariableValue Monad Logging in general is a two layer architecture. At the upper layer are the Msh Log Engine and Logging Api. At the lower layer is the Provider Interface and Log Providers. This architecture is adopted to achieve independency between Monad logging and logging details of different logging technology. This file implements the lower layer of the Monad Logging architecture. Upper layer of Msh Log architecture is implemented in MshLog.cs file. This class defines the provider interface to be implemented by each providers. Provider Interface. Corresponding to 5 categories of logging api interface, provider interface provides functions for logging a. EngineHealthEvent b. EngineLifecycleEvent c. CommandLifecycleEvent d. ProviderLifecycleEvent e. SettingsEvent constructor Provider interface function for logging health event Provider interface function for logging engine lifecycle event Provider interface function for logging command health event Provider interface function for logging command lifecycle event Provider interface function for logging pipeline execution detail. Provider interface function for logging provider health event Provider interface function for logging provider lifecycle event Provider interface function for logging settings event True if the log provider needs to use logging variables constructor DummyLogProvider does nothing to Logging EngineHealthEvent DummyLogProvider does nothing to Logging EngineLifecycleEvent Provider interface function for logging command health event DummyLogProvider does nothing to Logging CommandLifecycleEvent DummyLogProvider does nothing to Logging PipelineExecutionDetailEvent. Provider interface function for logging provider health event DummyLogProvider does nothing to Logging ProviderLifecycleEvent DummyLogProvider does nothing to Logging SettingsEvent Monad Logging in general is a two layer architecture. At the upper layer are the Msh Log Engine and Logging Api. At the lower layer is the Provider Interface and Log Providers. This architecture is adopted to achieve independency between Monad logging and logging details of different logging technology. This file implements the upper layer of the Monad Logging architecture. Lower layer of Msh Log architecture is implemented in LogProvider.cs file. Logging Api is made up of following five sets 1. Engine Health Event 2. Engine Lifecycle Event 3. Command Lifecycle Event 4. Provider Lifecycle Event 5. Settings Event Msh Log Engine provides features in following areas, 1. Loading and managing logging providers. Based on some "Provider Catalog", engine will try to load providers. First provider that is sucessfully loaded will be used for low level logging. If no providers can be loaded, a dummy provider will be used, which will essentially do nothing. 2. Implementation of logging api functions. These api functions is implemented by calling corresponding functions in provider interface. 3. Sequence Id Generation. Unique id are generated in this class. These id's will be attached to events. 4. Monad engine state management. Engine state is stored in ExecutionContext class but managed here. Later on, this feature may be moved to engine itself (where it should belongs to) when sophisticated engine state model is established. 5. Logging policy support. Events are logged or not logged based on logging policy settings (which is stored in session state of the engine. MshLog class is defined as a static class. This essentially make the logging api to be a static api. We want to provide sufficient synchronization for static functions calls. This is not needed for now because of following two reasons, a. Currently, only one monad engine can be running in one process. So logically only one event will be log at a time. b. Even in the case of multiple events are logged, underlining logging media should provide synchronization. A static dictionary to keep track of log providers for different shellId's. The value of this dictionary is never empty. A value of type DummyProvider means no logging. Static constructor Currently initialization is done in following sequence a. Try to load CrimsonLogProvider (in the case of Longhorn) b. If a fails, use the DummyLogProvider instead. (in low-level OS) In the longer turn, we may need to use a "Provider Catalog" for log provider loading. Get Log Provider based on Execution Context Get Log Provider based on Log Context Create a log provider based on a shell Id. This will set the current log provider to be dummy log. LogEngineHealthEvent: Log an engine health event. If engine state is changed, a engine lifecycle event will be logged also. This is the basic form of EngineHealthEvent logging api, in which all paramters are provided. Variant form of this function is defined below, which will make parameters additionalInfo and newEngineState optional. Execution context for the engine that is running EventId for the event to be logged Exception associated with this event Severity of this event Additional information for this event New engine state This is a variation of LogEngineHealthEvent api to make additionalInfo and newEngineState optional This is a variation of LogEngineHealthEvent api to make eventid, additionalInfo and newEngineState optional. A default event id for engine health event will be used. This is a variation of LogEngineHealthEvent api to make newEngineState optional This is a variation of LogEngineHealthEvent api to make additionalInfo optional LogEngineHealthEvent: This is an API for logging engine health event while execution context is not available. In this case, caller of this API will directly construct LogContext instance. This API is currently used only by runspace before engine start. logContext to be EventId for the event to be logged Exception associated with this event Additional information for this event LogEngineLifecycleEvent: Log an engine lifecycle event. This is the basic form of EngineLifecycleEvent logging api, in which all paramters are provided. Variant form of this function is defined below, which will make parameter additionalInfo optional. execution context for current engine instance new engine state invocationInfo for current command that is running This is a variation of basic LogEngineLifeCycleEvent api which makes invocationInfo optional. LogProviderHealthEvent: Log a command health event. Execution context for the engine that is running Exception associated with this event Severity of this event LogCommandLifecycleEvent: Log a command lifecyle event. This is the only form of CommandLifecycleEvent logging api. Execution Context for the current running engine new command state invocation data for current command that is running LogCommandLifecycleEvent: Log a command lifecyle event. This is a form of CommandLifecycleEvent which takes a commandName instead of invocationInfo. It is likely that invocationInfo is not available if the command failed security check. Execution Context for the current running engine new command state current command that is running LogPipelineExecutionDetailEvent: Log a pipeline execution detail event. Execution Context for the current running engine detail to be logged for this pipeline execution detail invocation data for current command that is running LogPipelineExecutionDetailEvent: Log a pipeline execution detail event. This is a form of PipelineExecutionDetailEvent which takes a scriptName and commandLine instead of invocationInfo. This will save the need to fill in the commandName for this event. Execution Context for the current running engine detail to be logged for this pipeline execution detail script that is currently running command line that is currently running LogProviderHealthEvent: Log a Provider health event. Execution context for the engine that is running Name of the provider Exception associated with this event Severity of this event LogProviderLifecycleEvent: Log a provider lifecyle event. This is the only form of ProviderLifecycleEvent logging api. Execution Context for current engine that is running Provider name New provider state LogSettingsEvent: Log a settings event This is the basic form of LoggingSettingsEvent API. Variation of this function defined below will make parameter invocationInfo optional. Execution context for current running engine Variable name New value for the variable Previous value for the variable Invocation data for the command that is currently running This is a variation of basic LogSettingsEvent to make "invocationInfo" optional. Get current engine state for the engine instance corresponding to executionContext passed in. Engine state is stored in ExecutionContext. Set current engine state for the engine instance corresponding to executionContext passed in. Engine state is stored in ExecutionContext. Generate LogContext structure based on executionContext and invocationInfo passed in. LogContext structure is used in log provider interface. Generate LogContext structure based on executionContext and invocationInfo passed in. LogContext structure is used in log provider interface. NeedToLogEngineHealthEvent: check whether logging engine health event is necessary. Whether to log engine event is controled by session variable "LogEngineHealthEvent" The default value for this is true (?). Reading a session variable from execution context for every single logging call may be expensive. We may need to use a different approach for this: a. ExecutionContext will cache the value for variable "LogEngineHealthEvent" b. If this variable is changed, a notification function will change the cached value in engine correspondently. This applies to other logging preference variable also. NeedToLogEngineLifecycleEvent: check whether logging engine lifecycle event is necessary. Whether to log engine lifecycle event is controled by session variable "LogEngineLifecycleEvent" The default value for this is false (?). NeedToLogCommandHealthEvent: check whether logging command health event is necessary. Whether to log command health event is controled by session variable "LogCommandHealthEvent" The default value for this is false (?). NeedToLogCommandLifecycleEvent: check whether logging command event is necessary. Whether to log command lifecycle event is controled by session variable "LogCommandLifecycleEvent" The default value for this is false (?). NeedToLogPipelineExecutionDetailEvent: check whether logging pipeline execution detail event is necessary. Whether to log command lifecycle event is controled by PSSnapin set up. Should we use session variable "LogPipelineExecutionEvent" to control this also? Currently we return true always since pipeline processor already check for whether to log logic from PSSnapin already. This may need to be changed. NeedToLogProviderHealthEvent: check whether logging Provider health event is necessary. Whether to log Provider health event is controled by session variable "LogProviderHealthEvent" The default value for this is true. NeedToLogProviderLifecycleEvent: check whether logging Provider lifecycle event is necessary. Whether to log Provider lifecycle event is controled by session variable "LogProviderLifecycleEvent" The default value for this is true. NeedToLogSettingsEvent: check whether logging settings event is necessary. Whether to log settings event is controled by session variable "LogSettingsEvent" The default value for this is false (?). generate next sequence id to be attached to current event. Log context cache Severity of the event Undefined severity. Critical event causing engine not to work. Error causing engine partially work. Problem that may not cause an immediate problem. Informational. enum for command states enum for provider states EventLogLogProvider is a class to implement Msh Provider interface using EventLog technology. EventLogLogProvider will be the provider to use if Monad is running in early windows releases from 2000 to 2003. EventLogLogProvider will be packaged in the same dll as Msh Log Engine since EventLog should always be available. Constructor. This represent a handle to EventLog Log engine health event Log engine lifecycle event Get engine lifecyle event id based on engine state Provider interface function for logging command health event Log command life cycle event. Get command lifecycle event id based on command state Log pipeline execution detail event. This may end of logging more than one event if the detail string is too long to be fit in 64K. Log one pipeline execution detail event. Detail message is already chopped up so that it will fit in 64K. Provider interface function for logging provider health event Log provider lifecycle event. Get provider lifecycle event id based on provider state. Log settings event. This is the helper function for logging an event with localizable message to event log. It will trace all exception thrown by eventlog. Fill event arguments with logContext info. In EventLog Api, arguments are passed in as an array of objects. An ArrayList to contain the event arguments The log context containing the info to fill in Fill event arguments with additionalInfo stored in a string dictionary. An arraylist to contain the event arguments A string dictionary to fill in Defines configuration information for runspace. Developers may want to derive from this class when writing their own host to host monad engine. This will allow host to control the behaviour of monad engine through customized runspace configuration. Create an instance of RunspaceConfiguration type implemented from an assembly. Assembly name from which to find runspace configuration implementation Runspace configuration instance created Exception thrown when is null or empty. Create one single shell runspace configuration object from console file Create one single shell runspace configuration object for a msh version. Create an RunspaceConfiguration-derived instance based an RunspaceConfiguration-derived type in specified assembly. The type name is defined by assembly attribute: RunspaceConfigurationTypeAttribute. Runspace configuration instance created Exception thrown when is null or empty. Create RunspaceConfiguration-derived instance based on a derived type. A type that is derived from RunspaceConfiguration Add a PSSnapin to runspace configuration. This member provides logic for adding PSSnapin. RunspaceConfiguration derived class should not override this member. name of the PSSnapin warning message Remove a PSSnapin from runspace configuration. This member provides logic for removing PSSnapin. RunspaceConfiguration derived class should not override this member. name of the PSSnapin warning message Remove duplicate entries and entries with files that cannot be loaded from the Types and Formats Gets the shell id for current runspace configuration. Gets the cmdlets defined in runspace configuration. RunspaceConfiguration derived class can override this member to provide its own cmdlet list. Gets the providers defined in runspace configuration. RunspaceConfiguration derived class can override this member to provide its own provider list. types.ps1xml information Gets the type data files defined in runspace configuration. RunspaceConfiguration derived class can override this member to provide its own types to be loaded at engine start up. Gets the format data files defined in runspace configuration. RunspaceConfiguration derived class can override this member to provide its own formats to be loaded at engine start up. Gets the scripts defined in runspace configuration. RunspaceConfiguration derived class can override this member to provide its own scripts to be include in monad engine. Gets the initialization scripts defined in runspace configuration. RunspaceConfiguration derived class can override this member to provide its own initialization scripts to be run at the start up of monad engine. Gets the assemblies defined in runspace configuration. RunspaceConfiguration derived class can override this member to provide its own assemblies to be loaded at the start up of monad engine. Gets the authorization manager to be used for runspace. RunspaceConfiguration derived class can override this member to provide its own authorization manager for monad engine. Enum for describing different kind information that can be configured in runspace configuration. Cmdlets Providers Assemblies Scripts Initialization scripts Types Formats Define class for runspace configuration entry. This abstract class is to be derived internally by Monad for different runspace configuration entries only. Developers should not derive from this class. Initiate an instance of runspace configuration entry. Name for the runspace configuration entry Initiate an instance of runspace configuration entry. Name for the runspace configuration entry The name of the PSSnapin the entry comes from. Gets name of configuration entry Gets name of PSSnapin that this configuration entry belongs to. Get whether this entry is a built-in entry. Defines class for type configuration entry. Initiate an instance for type configuration entry. Name of the type configuration entry File name that contains the types configuration information. when is null or empty Initiate an instance for type configuration entry. TypeData instance Specify the operation with the typedata Initiate an instance for type configuration entry. Name of the type configuration entry File name that contains the types configuration information. PSSnapin from which type info comes. when is null, empty or does not end in .ps1xml Initiate an instance for type configuration entry. File name that contains the types configuration information. when is null, empty or does not end in .ps1xml Gets file name that contains the types configuration information. Get the strong type data contains the type configuration information Set to true if the strong type data is to be removed Defines class for type configuration entry. Initiate an instance for type configuration entry. Name of the format configuration entry File name that contains the format configuration information. when is null or empty Initiate an instance for Format configuration entry. Name of the Format configuration entry File name that contains the Formats configuration information. PSSnapin from which the format comes. when is null, empty or does not end in .ps1xml Initiate an instance for type configuration entry. File name that contains the format configuration information. when is null or empty Initiate an instance for type configuration entry. Gets file name that contains the format configuration information. File name that contains the format configuration information. Get the typeDefinition that contains the format configuration information Class to define configuration data for cmdlets Initiate an instance for cmdlet configuration entry. Name of the cmdlet configuration entry Class that include implementation of the cmdlet Name of the help file that include help information for the cmdlet Initiate an instance for cmdlet configuration entry. Name of the cmdlet configuration entry Class that include implementation of the cmdlet PSSnapin from which the cmdlet comes. Name of the help file that include help information for the cmdlet Get class that include implementation of the cmdlet Get name of the help file that include help information for the cmdlet Define class for provider configuration entry Initiate an instance for provider configuration entry. Name of the provider configuration entry Class that include implementation of the provider Name of the help file that include help information for the provider Initiate an instance for provider configuration entry. Name of the provider configuration entry Class that include implementation of the provider Name of the help file that include help information for the provider PSSnapin from which provider comes from. Get class that include implementation of the provider. Get name of the help file that include help information for the provider Define class for script configuration entry Initiate an instance for script configuration entry. Name of the script configuration entry Content of the script Get content for the script. Configuration data for assemblies. Initiate an instance for assembly configuration entry. Strong name of the assembly Name of the assembly file Initiate an instance for assembly configuration entry. Strong name of the assembly Name of the assembly file PSSnapin information. when is null, empty or does not end in .ps1xml Get name of the assembly file Name of the assembly file Define class for runspace configuration entry collection. Constructor Constructor Reset items in the collection Remove one item from the collection when is out of range. Remove multiple items in the collection. when is out of range. Remove one item from the collection Prepend an item to the collection. Prepend items into the collection Append one item to the collection Append items to the collection. Get enumerator for this collection. Get enumerator for this collection. Update others about the collection change. Get items at a index position. Get number of items in the collection. OnUpdate handler should lock the object itself. RunspaceConfigurationHelper define some constants to be used by both Minishell api and makekit. Be very careful when trying to change values for strings below since it will be used by makekit process also. This file will be built with both monad engine and makekit. Define the class for runspace configuration type attribute. Initiate an instance of RunspaceConfigurationTypeAttribute. Runspace configuration type Get runspace configuration type Defines exception thrown when runspace configuration attribute is not defined correctly. Initiate an instance of RunspaceConfigurationAttributeException. Error detail for the exception Assembly on which runspace configuration attribute is defined or should be defined. Initiate an instance of RunspaceConfigurationAttributeException. Initiate an instance of RunspaceConfigurationAttributeException. Error message Initiate an instance of RunspaceConfigurationAttributeException. Error message Inner exception Initiate an instance of RunspaceConfigurationAttributeException. Error detail Assembly on which runspace configuration attribute is defined or should be defined. The inner exception of this exception Create the internal error record based on helpTopic. The ErrorRecord created will be stored in the _errorRecord member. Initiate a RunspaceConfigurationAttributeException instance. Serialization information Streaming context Get object data from serizliation information. Serialization information Streaming context Gets error record embedded in this exception. Get localized error message. error Gets assembly name on which runspace configuration attribute is defined or should be defined. error Gets message for this exception. Define class for runspace configuration type. Initiate an instance for RunspaceConfigurationTypeException Name of the assembly where is defined. Runspace configuration type Initiate an instance for RunspaceConfigurationTypeException Initiate an instance for RunspaceConfigurationTypeException Name of the assembly where is defined. Runspace configuration type defined in Inner exception of this exception Initiate an instance for RunspaceConfigurationTypeException Error message Initiate an instance for RunspaceConfigurationTypeException Error message Inner exception of this exception Create the internal error record based on assembly name and type. The ErrorRecord created will be stored in the _errorRecord member. Initiate a RunspaceConfigurationAttributeException instance. Serialization information Streaming context Get object data from serizliation information. Serialization information Streaming context Get the error record embedded in this exception. Get name of the assembly where runspace configuration type is defined. Get the runspace configuration type. Get message for this exception. Serves as the base class for Metadata attributes that serve as guidance to the parser and parameter binder. PSSnapins may not create custom attributes derived , since it has no public constructor. Only the sealed public subclasses and are available. Constructor with no parameters A variant of which unrolls enumeration values and validates each element individually. is like , except that if the argument value is an enumeration, will unroll the enumeration and validate each item individually. Existing enumerated validation attributes include , , , and . PSSnapins wishing to create custom enumerated argument validation attributes should derive from and override the abstract method, after which they can apply the attribute to their parameters. It is also recommended to override to return a readable string similar to the attribute declaration, for example "[ValidateRangeAttribute(5,10)]". If this attribute is applied to a string parameter, the string command argument will be validated. If this attribute is applied to a string[] parameter, each string command argument will be validated. Initializes a new instance of a class derived from ValidateEnumeratedArgumentsAttribute Overridden by subclasses to implement the validation of each parameter argument Validate that the value of is valid, and throw if it is invalid. one of the parameter arguments should be thrown for any validation failure Calls ValidateElement in each element in the enumeration argument value. object to validate The engine APIs for the context under which the prerequisite is being evaluated. PSSnapins should override instead. should be thrown for any validation failure Contains information about a cmdlet's metadata. Gets and sets the cmdlet default parameter set Gets and sets a Boolean value that indicates the Cmdlet supports ShouldProcess. By default the value is false, meaning the cmdlet doesn't support ShouldProcess. Gets and sets a Boolean value that indicates the Cmdlet supports Paging. By default the value is false, meaning the cmdlet doesn't support Paging. Gets and sets a Boolean value that indicates the Cmdlet supports Transactions. By default the value is false, meaning the cmdlet doesn't support Transactions. Gets and sets a ConfirmImpact value that indicates the "destructiveness" of the operation and when it should be confirmed. This should only be used when SupportsShouldProcess is specified. Gets and sets a HelpUri value that indicates the location of online help. This is used by Get-Help to retrieve help content when -Online is specified. Gets and sets the RemotingBehavior value that declares how this cmdlet should interact with ambient remoting. Identifies a class as a cmdlet and specifies the verb and noun identifying this cmdlet. Initializes a new instance of the CmdletAttribute class verb for the command noun for the command for invalid arguments Gets the cmdlet noun Gets the cmdlet verb Identifies PowerShell script code as behaving like a cmdlet and hence uses cmdlet parameter binding instead of script parameter binding. When true, the script will auto-generate appropriate parameter metadata to support positional parameters if the script hasn't already specified multiple parameter sets or specified positions explicitly via the . OutputTypeAttribute is used to specify the type of objects output by a cmdlet or script. Construct the attribute from an array of System.Type The types output by the cmdlet Construct the attribute from an array of names of types. The types output by the cmdlet The types specified by the attribute. Attributes implemented by a provider can use: [OutputType(ProviderCmdlet='cmdlet', typeof(...))] To specify the provider specific objects returned for a given cmdlet. The list of parameter sets this OutputType specifies. Declares an alternative name for a parameter Initiailizes a new instance of the AliasAttribute class The name for this alias for invalid arguments Gets the alias names passed to the constructor Identifies parameters to Cmdlets ParameterSetName refering to all ParameterSets Initializes a new instance of the ParameterAttribute class Gets and sets the parameter position. If not set, the parameter is named. Gets and sets the name of the parameter set this parameter belongs to. When it is not specified ParameterAttribute.AllParameterSets is assumed. Gets and sets a flag specifying if this parameter is Mandatory. When it is not specified, false is assumed and the parameter is considered optional. Gets and sets a flag that specifies that this parameter can take values from the incoming pipeline object. When it is not specified, false is assumed. Gets and sets a flag that specifies that this parameter can take values from a property in the incoming pipeline object with the same name as the parameter. When it is not specified, false is assumed. Gets and sets a flag that specifies that the remaining command line parameters should be associated with this parameter in the form of an array. When it is not specified, false is assumed. Gets and sets a short description for this parameter, suitable for presentation as a tool tip. for a null or empty value when setting Gets and sets the base name of the resource for a help message. When this field is speicifed, HelpMessageResourceId must also be specified. for a null or empty value when setting Gets and sets the Id of the resource for a help message. When this field is speicifed, HelpMessageBaseName must also be specified. for a null or empty value when setting Specifies PSTypeName of a cmdlet or function parameter. This attribute is used to restrict the type name of the parameter, when the type goes beyond the .NET type system. For example one could say: [PSTypeName("System.Management.ManagementObject#root\cimv2\Win32_Process")] to only allow Win32_Process objects to be bound to the parameter. Creates a new PSTypeNameAttribute Specifies that a parameter supports wildcards. Specify a default value and/or help comment for a command parameter. This attribute does not have any semantic meaning, it is simply an aid to tools to make it simpler to know the true default value of a command parameter (which may or may not have any correlation with, e.g., the backing store of the Parameter's property or field. Specify the default value of a command parameter. The PowerShell engine does not use this value in any way, it exists for other tools that want to reflect on cmdlets. Specify the help string for the default value of a command parameter. Validates that the length of each parameter argument's Length falls in the range specified by MinLength and MaxLength Validates that the length of each parameter argument's Length falls in the range specified by MinLength and MaxLength object to validate if is not a string with length between minLength and maxLength for invalid arguments Initializes a new instance of the ValidateLengthAttribute class Minimum required length Maximum required length for invalid arguments if maxLength is less than minLength Gets the attribute's minimum length Gets the attribute's maximum length Validates that each parameter argument falls in the range specified by MinRange and MaxRange The range values and the value to validate will all be converted to the promoted type. If minRange and maxRange are the same type, Validates that each parameter argument falls in the range specified by MinRange and MaxRange object to validate Thrown if the object to be validated does not implement IComparable, if the element type is not the same of MinRange, MaxRange, or if the element is not between MinRange and MaxRange. Initializes a new instance of the ValidateRangeAttribute class Minimum value of the range allowed. Maximum value of the range allowed. for invalid arguments if maxRange has a differnet type than minRange if maxRange is smaller than minRange if maxRange, minRange are not IComparable Gets the attribute's minimum range Gets the attribute's maximum range Validates that each parameter argument matches the RegexPattern Validates that each parameter argument matches the RegexPattern object to validate if is not a string that matches the pattern and for invalid arguments Initializes a new instance of the ValidatePatternAttribute class Pattern string to match for invalid arguments Gets the Regex pattern to be used in the validation Gets or sets the Regex options to be used in the validation Class for validating against a script block. Validates that each parameter argument matches the scriptblock object to validate if is invalid Initializes a new instance of the ValidateScriptBlockAttribute class Scriptblock to match for invalid arguments Gets the scriptblock to be used in the validation Validates that the parameter argument count is in the specified range Validates that the parameter argument count is in the specified range Object to validate The engine APIs for the context under which the validation is being evaluated. if the element is none of ICollection, IEnumerable, IList, IEnumerator if the element's lenght is not between MinLength and MAxLEngth Initializes a new instance of the ValidateCountAttribute class Minimum number of values required Maximum number of values required for invalid arguments if minLength is greater than maxLength Gets the minimum length of this attribute Gets the maximum length of this attribute Validates that each parameter argument is present in a specified set Validates that each parameter argument is present in the specified set Object to validate if element is not in the set for invalid argument Initializes a new instance of the ValidateSetAttribute class list of valid values for null arguments for invalid arguments Gets a flag specifying if we should ignore the case when performing string comparison. The default is true. Gets the values in the set Allows a NULL as the argument to a mandatory parameter Initializes a new instance of the AllowNullAttribute class Allows an empty string as the argument to a mandatory string parameter Initializes a new instance of the AllowEmptyStringAttribute class Allows an empty collection as the argument to a mandatory collection parameter Initializes a new instance of the AllowEmptyCollectionAttribute class Validates that the parameters's argument is not null Verifies the argument is not null and if it is a collection, that each element in the collection is not null. If the argument is a collection then each element is validated. The arguments to verify. The engine APIs for the context under which the validation is being evaluated. true if the argument is valid. if element is null or a collection with a null element Validates that the parameters's argument is not null, is not an empty string, and is not an empty collection. Validates that the parameters's argument is not null, is not an empty string, and is not an empty collection. If arguments is a collection, each argument is verified. The arguments to verify. The engine APIs for the context under which the validation is being evaluated. if the arguments are not valid Serves as the base class for attributes that perform argument transformation. Argument transformation attributes can be attached to and parameters to automatically transform the argument value in some fashion. The transformation might change the object, convert the type, or even load a file or AD object based on the name. Existing argument transformation attributes include . PSSnapins wishing to create custom argument transformation attributes should derive from and override the abstract method, after which they can apply the attribute to their parameters. It is also recommended to override to return a readable string similar to the attribute declaration, for example "[ValidateRangeAttribute(5,10)]". If multiple transformations are defined on a parameter, they will be invoked in series, each getting the output of the previous transformation. Initializes a new instance of the ArgumentTransformationAttribute class Method that will be overridden by the subclasses to transform the inputData parameter argument into some other object that will be used for the parameter's value. The engine APIs for the context under which the transformation is being made. parameter argument to mutate mutated object(s) Return the transformed value of . Throw if the value of is invalid, and throw for other recoverable errors. should be thrown for invalid arguments should be thrown for any problems during transformation Defines session capabilities provided by a PowerShell session Session with capabilities can be made available on a server that wants to provide a full user experience to PowerShell clients. Clients connecting to the server will be able to use implicit remoting (Import-PSSession, Export-PSSession) as well as interactive remoting (Enter-PSSession, Exit-PSSession). Session with capabibilities can be made available on a server that wants to provide workflow hosting capabilities in the specified end points. All jobs commands as well as commands for implicit remoting and interactive remoting will be made available Include language capabilities This class represents the compiled metadata for a command type. Constructs a CommandMetada object for the given CLS complaint type . CLS complaint type to inspect for Cmdlet metadata. commandType is null. If a parameter defines the same parameter-set name multiple times. If the attributes could not be read from a property or field. Construct a CommandMetadata object for the given commandInfo The commandInfo object to construct CommandMetadata for commandInfo is null. If the commandInfo is an alias to an unknown command, or if the commandInfo is an unsupported command type. Construct a CommandMetadata object for the given commandInfo The commandInfo object to construct CommandMetadata for Should common parameters be included in the metadata? commandInfo is null. If the commandInfo is an alias to an unknown command, or if the commandInfo is an unsupported command type. Construct a CommandMetadata object for a script file. The path to the script file. A copy constructor that creates a deep copy of the CommandMetadata object. Instances of Attribute and Type classes are copied by reference. object to copy Constructor used by implicit remoting Gets the metdata for the specified cmdlet from the cache or creates a new instance if its not in the cache. The name of the command that this metadata represents. The cmdlet to get the metadata for. The current engine context. The CommandMetadata for the specified cmdlet. If is null or empty. If is null. If more than int.MaxValue parameter-sets are defined for the command. If a parameter defines the same parameter-set name multiple times. If the attributes could not be read from a property or field. Constructs an instance of CommandMetadata using reflection against a bindable object The name of the command that this metadata represents. An instance of an object type that can be used to bind MSH parameters. A type is considered bindable if it has at least one field and/or property that is decorated with the ParameterAttribute. The current engine context. If null, the command and type metadata will be generated and will not be cached. If is null. If more than int.MaxValue parameter-sets are defined for the command. If a parameter defines the same parameter-set name multiple times. If the attributes could not be read from a property or field. Constructor for creating command metadata from a script block. Unlike cmdlet based on a C# type where cmdlet metadata and parameter metadata is created through reflecting the implementation type, script cmdlet has different way for constructing metadata. 1. Metadata for cmdlet itself comes from cmdlet statement, which is parsed into CmdletDeclarationNode and then converted into a CmdletAttribute object. 2. Metadata for parameter comes from parameter declaration statement, which is parsed into parameter nodes with parameter annotations. Information in ParameterNodes is eventually transformed into a dictionary of RuntimeDefinedParameters. By the time this constructor is called, information about CmdletAttribute and RuntimeDefinedParameters for the script block has been setup with the scriptblock object. A collection of attributes that were declared at the cmdlet level but were not recognized by the engine. Constructs the command metadata by using reflection against the CLR type. If more than int.MaxValue parameter-sets are defined for the command. Extracts the cmdlet data from the CmdletAttribute The CmdletAttribute to process If is null. If more than int.MaxValue parameter-sets are defined for the command. Merges parameter metadata from different sources: those that are coming from Type, CommonParameters, should process etc. true if metadata info about Verbose,Debug etc needs to be generated. false otherwise. Gets the ScriptCmdlet in string format Returns a dictionary from a command name to describing how that command can be restricted to limit attack surface while still being usable by features included in . For example the implicit remoting feature (included in ) doesn't use all parameters of Get-Help and uses only a limited set of argument values for the parameters it does use. can be passed to method to generate a body of a proxy function that forwards calls to the actual cmdlet, while exposing only the parameters listed in . Exposing only the restricted proxy function while making the actual cmdlet and its aliases private can help in reducing attack surface of the remoting server. The command metadata cache. This is separate from the parameterMetadata cache because it is specific to cmdlets. Gets the name of the command this metadata represents The Type which this CommandMetadata represents. Gets/Sets the default parameter set name True if the cmdlet declared that it supports ShouldProcess, false otherwise. True if the cmdlet declared that it supports Paging, false otherwise. When true, the command will auto-generate appropriate parameter metadata to support positional parameters if the script hasn't already specified multiple parameter sets or specified positions explicitly via the . True if the cmdlet declared that it supports transactions, false otherwise. Related link URI for Get-Help -Online The remoting capabilities of this cmdlet, when exposed in a context with ambient remoting. Indicates the "destructiveness" of the command operation and when it should be confirmed. This is only effective when the command calls ShouldProcess, which should only occur when SupportsShouldProcess is specified. Gets the parameter data for this command Gets or sets the obsolete attribute on the command Gets the merged metadata for the command including cmdlet declared parameters, common parameters, and (optionally) ShouldProcess and Transactions parameters True if the cmdlet implements dynamic parameters, or false otherwise Gets the bit in the parameter set map for the default parameter set. This class provides public functionality for serializing a PSObject Serializes an object into PowerShell CliXml The input object to serialize. Serializes to a default depth of 1 The serialized object, as CliXml Serializes an object into PowerShell CliXml The input object to serialize The depth of the members to serialize The serialized object, as CliXml Deserializes PowerShell CliXml into an object. The CliXml the represents the object to deserialize. An object that represents the serialized content Deserializes PowerShell CliXml into a list of objects. The CliXml the represents the object to deserialize. An object array represents the serialized content Default depth of serialization This class provides functionality for serializing a PSObject Creates a Serializer using default serialization context writer to be used for serialization Creates a Serializer using specified serialization context writer to be used for serialization depth of serialization if true then types.ps1xml can override depth for a particular types (using SerializationDepth property) Creates a Serializer using specified serialization context writer to be used for serialization serialization context Serializes the object object to be serialized Please note that this method shouldn't throw any exceptions. If it throws - please open a bug. Serializes passed in object object to be serialized Stream to which this object belong. Ex: Output, Error etc. Please note that this method shouldn't throw any exceptions. If it throws - please open a bug. Write the end of root element Used by Remoting infrastructure. This TypeTable instance will be used by Serializer if ExecutionContext is not avaliable (to get the ExecutionContext's TypeTable) Logs that memory used by deserialized objects is not related to the size of input xml. Used mainly to account for memory usage of cloned TypeNames when calculating memory quota usage. Limits the total data processed by the deserialization context. Deserialization context is used by PriorityReceivedDataCollection (remoting) to process incoming data from the remote end. A value of Null means that the max memory is unlimited. This class provides functionality for deserializing a PSObject Used to prefix a typename for deserialization. Creates a Deserializer using default deserialization context reader to be used for deserialization Thrown when the xml is in an incorrect format Creates a Deserializer using specified serialization context reader to be used for deserialization serialization context Thrown when the xml is in an incorrect format Read the root element tag and set the cursor to start tag of first object. Deserializes next object. Thrown when the xml is in an incorrect format Deserializes next object. stream the object belongs to (i.e. "Error", "Output", etc.) Thrown when the xml is in an incorrect format Adds "Deserialized." prefix to passed in argument if not already present Checks if an object is either a live or deserialized instance of class or one of its subclasses. true if is either a live or deserialized instance of class or one of its subclasses; false otherwise Checks if an object is a deserialized instance of class or one of its subclasses. true if is a deserialized instance of class or one of its subclasses; false otherwise Gets a new collection of typenames without "Deserialization." prefix in the typename. This will allow to map type info/format info of the orignal type for deserialized objects. Null if no type with "Deserialized." prefix is found. Otherwise with the prefix removed if any. Used by Remoting infrastructure. This TypeTable instance will be used by Deserializer if ExecutionContext is not avaliable (to get the ExecutionContext's TypeTable) Types of known type container supported by monad This internal helper class provides methods for serializing mshObject. Xml writer to be used Serialization context Used by Remoting infrastructure. This TypeTable instance will be used by Serializer if ExecutionContext is not avaliable (to get the ExecutionContext's TypeTable) Depth below top level - used to prevent infinitely deep serialization (without this protection it would be possible i.e. with SerializationDepth and recursion) Writes the start of root element Writes the end of root element Called from a separate thread will stop the serialization process This writes one object. source to be serialized. Stream to which source belongs Serializes Primitive Known Types. true if source is handled, else false. Handles primitive known type by first converting it to a PSObject.In W8, extended property data is stored external to PSObject. By coverting to PSObject, we will be able to retrieve and serialize the extended properties. This is tracked by Win8: 414042 Serializes PSObject whose base objects are of primitive known type true if source is handled, else false. Checks if source is known container type and returns appropriate information Checks if derived is of type baseType or a type derived from baseType Writes PSObject Reference Element Serializes an PSObject whose baseobject is of primitive type. source from which notes are written primitive object which is written as base object. In most cases it is same source.ImmediateBaseObject. When PSObject is serialized as string, it can be different. for more info. TypeSerializationInfo for the primitive. Serializes an PSObject whose baseobject is of primitive type and which has notes. source from which notes are written primitive object which is written as base object. In most cases it is same source.ImmediateBaseObject. When PSObject is serialized as string, it can be different. for more info. TypeSerializationInfo for the primitive. Writes start element, attributes and typeNames for PSObject. if true, TypeName information is written, else not. if not null then ToString information is written Returns true if PSObject has notes. Serialize member set. This method serializes without writing enclosing tags and attributes. enumerable containing members if this is true, write an enclosing "" tag. Serializes MemberSet. Serializes properties of PSObject Serializes properties from collection Collection of properties to serialize Name for enclosing element tag depth to which each property should be serialized Serializes IEnumerable enumerable which is serialized Serializes IDictionary dictionary which is serialized Gets the string from PSObject using the information from types.ps1xml. This string is used for serializing the PSObject at depth 0 or when pso.SerializationMethod == SerializationMethod.String. PSObject to be converted to string string value to use for serializing this PSObject. Gets the "ToString" from PSObject. PSObject to be converted to string "ToString" value Reads the information the PSObject and returns true if this object should be serialized as string PSObject to be serialized true if the object needs to be serialized as a string compute the serialization depth for an PSObject instance subtree PSObject whose serialization depth has to be computed current depth Writes null Writes raw string as item or property in Monad namespace The serializer to which the object is serialized. name of the stream to write. Do not write if null. name of property. Pass null for item string to write serialization information Writes an item or property in Monad namespace The serializer to which the object is serialized. name of property. Pass null for item object to be written serialization information about source Writes DateTime as item or property The serializer to which the object is serialized. name of property. pass null for item DateTime to write serialization information about source Writes Version The serializer to which the object is serialized. name of property. pass null for item Version to write serialization information about source Serialize scriptblock as item or property The serializer to which the object is serialized. name of property. pass null for item scriptblock to write serialization information about source Serialize URI as item or property The serializer to which the object is serialized. name of property. pass null for item URI to write serialization information about source Serialize string as item or property The serializer to which the object is serialized. name of property. pass null for item string to write serialization information about source Writes Double as item or property The serializer to which the object is serialized. name of property. pass null for item Double to write serialization information about source Writes Char as item or property The serializer to which the object is serialized. name of property. pass null for item Char to write serialization information about source Writes Boolean as item or property The serializer to which the object is serialized. name of property. pass null for item Boolean to write serialization information about source Writes Single as item or property The serializer to which the object is serialized. name of property. pass null for item single to write serialization information about source Writes TimeSpan as item or property The serializer to which the object is serialized. name of property. pass null for item DateTime to write serialization information about source Writes Single as item or property The serializer to which the object is serialized. name of property. pass null for item bytearray to write serialization information about source Writes start element in Monad namespace tag of element Writes attribute in monad namespace name of attribute value of attribute Encodes the string to escape characters which would make XmlWriter.WriteString throw an exception. string to encode encoded string Output from this method can be reverted using XmlConvert.DecodeName method (or InternalDeserializer.DecodeString). This method has been introduced to produce shorter output than XmlConvert.EncodeName (which escapes everything that can't be part of an xml name - whitespace, punctuation). This method has been split into 2 parts to optimize its performance: 1) part1 (this method) checks if there are any encodable characters and if there aren't it simply (and efficiently) returns the original string 2) part2 (EncodeString(string, int)) picks up when part1 detects the first encodable character. It avoids looking at the characters already verified by part1 and copies those already verified characters and then starts encoding the rest of the string. This is the real workhorse that encodes strings. See for more information. string to encode indexOfFirstEncodableCharacter encoded string Writes element string in monad namespace Used by Remoting infrastructure. This TypeTable instance will be used by Serializer if ExecutionContext is not avaliable (to get the ExecutionContext's TypeTable) This internal class provides methods for de-serializing mshObject. XmlReader from which object is deserialized Deserialization context Used by Remoting infrastructure. This TypeTable instance will be used by Serializer if ExecutionContext is not avaliable (to get the ExecutionContext's TypeTable) Depth below top level - used to prevent stack overflow during deserialization Version declared by the clixml being read Validates the version for correctness. Also validates that deserializer can deserialize this version. version in string format Called from a separate thread will stop the serialization process Reads one object. At this point reader should be positioned at the start tag of object. Deserialized Object. This function reads the refId attribute and creates a mshObject for that attribute mshObject which is created for refId Read type names PSObject to which TypeNames are added Read properties Read memberset. collection to which members are added read note Read List Containers Deserialize Dictionary Check if LocalName of next element is "tag" Read start element in monad namespace element tag to read true if not an empty element else false Skips an element and all its child elements. Moves cursor to next content Node. Reads Primary known type Helper function for building XmlException resource String params for format string obtained from resourceId If true, unknowntags are allowed inside PSObject Used by Remoting infrastructure. This TypeTable instance will be used by Deserializer if ExecutionContext is not avaliable (to get the ExecutionContext's TypeTable) Helper class for generating reference id. Get new reference id. New reference id Seed is incremented by one after each reference generation Assigns a RefId to the given object object to assign a RefId to RefId assigned to the object Gets a RefId already assigned for the given object or null if there is no associated ref id A delegate for serializing known type A delegate for deserializing known type This class contains serialization information about a type. Constructor Type for which this entry is created ItemTag for the type PropertyTag for the type TypeSerializerDelegate for serializing the type TypeDeserializerDelegate for deserializing the type Type for which this entry is created ItemTag for the type PropertyTag for the type TypeSerializerDelegate for serializing the type TypeDeserializerDelegate for deserializing the type Get the type for which this TypeSerializationInfo is created. Get the item tag for this type Get the Property tag for this type Gets the delegate to serialize this type Gets the delegate to deserialize this type A class for identifying types which are treated as KnownType by Monad. A KnownType is guranteed to be available on machine on which monad is running. Static constructor Gets the type serialization information about a type Type for which information is retrieved TypeSerializationInfo for the type, null if it doesn't exist Get TypeSerializationInfo using ItemTag as key ItemTag for which TypeSerializationInfo is to be fetched TypeSerializationInfo entry, null if no entry exist for the tag Array of known types. Hashtable of knowntypes. Key is Type.FullName and value is Type object. Hashtable of knowntypes. Key is ItemTag This class contains helper routined for serialization/deserialization Extracts the value of a note property from a PSObject; returns null if the property does not exist Returns the BaseObject of a note property encoded as a PSObject; returns null if the property does not exist A dictionary from object to T where 1) keys are objects, 2) keys use reference equality, 3) dictionary keeps only weak references to keys type of dictionary values is a that is limited to 1) case-insensitive strings as keys and 2) values that can be serialized and deserialized during PowerShell remoting handshake (in major-version compatible versions of PowerShell remoting) Initializes a new empty instance of the class Initializes a new instance of the class with contents copied from the hashtable. hashtable to copy into the new instance of This constructor will throw if the hashtable contains keys that are not a strings or values that are not one of primitive types that will work during PowerShell remoting handshake. Support for .NET serialization Adds an element with the specified key and value into the Hashtable The key of the element to add The value of the element to add This method will throw if the is not a string and the is not one of primitive types that will work during PowerShell remoting handshake. Use of strongly-typed overloads of this method is suggested if throwing an exception is not acceptable. Creates a new instance by doing a shallow copy of the current instance. Adds an element with the specified key and value into the Hashtable The key of the element to add The value of the element to add Adds an element with the specified key and value into the Hashtable The key of the element to add The value of the element to add Adds an element with the specified key and value into the Hashtable The key of the element to add The value of the element to add Adds an element with the specified key and value into the Hashtable The key of the element to add The value of the element to add Adds an element with the specified key and value into the Hashtable The key of the element to add The value of the element to add Adds an element with the specified key and value into the Hashtable The key of the element to add The value of the element to add Adds an element with the specified key and value into the Hashtable The key of the element to add The value of the element to add Adds an element with the specified key and value into the Hashtable The key of the element to add The value of the element to add Adds an element with the specified key and value into the Hashtable The key of the element to add The value of the element to add Adds an element with the specified key and value into the Hashtable The key of the element to add The value of the element to add Adds an element with the specified key and value into the Hashtable The key of the element to add The value of the element to add Adds an element with the specified key and value into the Hashtable The key of the element to add The value of the element to add Adds an element with the specified key and value into the Hashtable The key of the element to add The value of the element to add Adds an element with the specified key and value into the Hashtable The key of the element to add The value of the element to add Adds an element with the specified key and value into the Hashtable The key of the element to add The value of the element to add Adds an element with the specified key and value into the Hashtable The key of the element to add The value of the element to add Adds an element with the specified key and value into the Hashtable The key of the element to add The value of the element to add Adds an element with the specified key and value into the Hashtable The key of the element to add The value of the element to add Adds an element with the specified key and value into the Hashtable The key of the element to add The value of the element to add Adds an element with the specified key and value into the Hashtable The key of the element to add The value of the element to add Adds an element with the specified key and value into the Hashtable The key of the element to add The value of the element to add Adds an element with the specified key and value into the Hashtable The key of the element to add The value of the element to add Adds an element with the specified key and value into the Hashtable The key of the element to add The value of the element to add Adds an element with the specified key and value into the Hashtable The key of the element to add The value of the element to add Adds an element with the specified key and value into the Hashtable The key of the element to add The value of the element to add Adds an element with the specified key and value into the Hashtable The key of the element to add The value of the element to add Adds an element with the specified key and value into the Hashtable The key of the element to add The value of the element to add Adds an element with the specified key and value into the Hashtable The key of the element to add The value of the element to add Adds an element with the specified key and value into the Hashtable The key of the element to add The value of the element to add Adds an element with the specified key and value into the Hashtable The key of the element to add The value of the element to add Adds an element with the specified key and value into the Hashtable The key of the element to add The value of the element to add Adds an element with the specified key and value into the Hashtable The key of the element to add The value of the element to add Adds an element with the specified key and value into the Hashtable The key of the element to add The value of the element to add Adds an element with the specified key and value into the Hashtable The key of the element to add The value of the element to add Adds an element with the specified key and value into the Hashtable The key of the element to add The value of the element to add Adds an element with the specified key and value into the Hashtable The key of the element to add The value of the element to add Adds an element with the specified key and value into the Hashtable The key of the element to add The value of the element to add Adds an element with the specified key and value into the Hashtable The key of the element to add The value of the element to add If originalHash contains PSVersionTable, then just returns the Cloned copy of the original hash. Othewise, creates a clone copy and add PSVersionInfo.GetPSVersionTable to the clone and returns. Tries to get a value that might be present in a chain of nested PSPrimitiveDictionaries. For example to get $sessionInfo.ApplicationPrivateData.ImplicitRemoting.Hash you could call TryPathGet<string>($sessionInfo.ApplicationPrivateData, out myHash, "ImplicitRemoting", "Hash"). Expected type of the value The root dictionary A chain of keys leading from the root dictionary () to the value true if the value was found and was of the correct type; false otherwise Gets or sets the value associated with the specified key. The key whose value to get or set The value associated with the specified key. If the specified key is not found, attempting to get it returns null and attempting to set it creates a new element using the specified key. The setter will throw if the is not a string and the value is not one of primitive types that will work during PowerShell remoting handshake. Use of strongly-typed overloads of Add method is suggested if throwing an exception is not acceptable. Gets or sets the value associated with the specified key. The key whose value to get or set The value associated with the specified key. If the specified key is not found, attempting to get it returns null and attempting to set it creates a new element using the specified key. The setter will throw if the value is not one of primitive types that will work during PowerShell remoting handshake. Use of strongly-typed overloads of Add method is suggested if throwing an exception is not acceptable. Rehydrating type converter used during deserialization. It takes results of serializing some common types and rehydrates them back from property bags into live objects. Determines if the converter can convert the parameter to the parameter. The value to convert from The type to convert to True if the converter can convert the parameter to the parameter, otherwise false. Converts the parameter to the parameter using formatProvider and ignoreCase The value to convert from The type to convert to The format provider to use like in IFormatable's ToString true if case should be ignored the parameter converted to the parameter using formatProvider and ignoreCase if no conversion was possible Returns true if the converter can convert the parameter to the parameter The value to convert from The type to convert to True if the converter can convert the parameter to the parameter, otherwise false. Converts the parameter to the parameter using formatProvider and ignoreCase The value to convert from The type to convert to The format provider to use like in IFormatable's ToString true if case should be ignored sourceValue converted to the parameter using formatProvider and ignoreCase if no conversion was possible This method is not implemented - an overload taking a PSObject is implemented instead This method is not implemented - an overload taking a PSObject is implemented instead This method is not implemented - an overload taking a PSObject is implemented instead This method is not implemented - an overload taking a PSObject is implemented instead Gets value of a property (has to be present, value has to be non-null). Can throw any exception (which is ok - LanguagePrimitives.ConvertTo will catch that). Expected type of the property Deserialized object Property name Gets value of a property. Can throw any exception (which is ok - LanguagePrimitives.ConvertTo will catch that). Expected type of the property Deserialized object Property name Gets the boolean properties of ParameterSetMetadata object encoded as an integer The PSObject for which to obtain the flags Boolean properties of ParameterSetMetadata object encoded as an integer Gets the boolean properties of ParameterSetMetadata object encoded as an integer The PSObject for which to obtain the flags Boolean properties of ParameterSetMetadata object encoded as an integer This class contains strings required for serialization Element tag for root node Element tag for PSObject Element tag for properties TypeNames tag Tag for type item in typeanmes TypeName reference Memberset Individual notes Tag for ToString value Element tag used for IEnumerables. Element tag used for Dictionary Element tag used for Dictionary entry Value of name attribute for dictionary key part in dictnary entry Value of name attribute for dictionary value part in dictnary entry Element tag used for Stack Element tag used for Queue Element tag used for List Element tag for char property. This property is used for System.Char type Element tag for guid property. This property is used for System.Guid type Element tag for boolean property. This property is used for System.Boolean type Element tag for unsignedByte property. This property is used for System.Byte type Element tag for dateTime property. This property is used for System.DateTime type Element tag for decimal property. This property is used for System.Decimal type Element tag for double property. This property is used for System.Double type Element tag for duration property. This property is used for System.TimeSpan type Element tag for float property. This property is used for System.Single type Element tag for int property. This property is used for System.Int32 type Element tag for long property. This property is used for System.Int64 type Element tag for byte property. This property is used for System.SByte type Element tag for short property. This property is used for System.Int16 type Element tag for base64Binary property. This property is used for System.IO.Stream type Element tag for scriptblock property. This property is used for System.Management.Automation.ScriptBlock type Element tag for string property. This property is used for System.String type Element tag for secure string property This property is used for System.Security.SecureString type Element tag for unsignedShort property. This property is used for System.UInt16 Stream type Element tag for unsignedInt property. This property is used for System.UInt32 type Element tag for unsignedLong property. This property is used for System.Long type Element tag for anyUri property. This property is used for System.Uri type Element tag for Version property Element tag for XmlDocument Element tag for property whose value is null Element tag for PSObjectReference property. This property is used for a reference to a property bag String for reference id attribute String for name attribute String for version attribute String for stream attribute Monad namespace Prefix string for monad namespace shell environment variable environment variable that will define the default application name for the connection uri helper fns helper fn to check byte[] arg for null. arg to check name of the arg Does not return a value helper fn to check arg for empty or null. Throws ArgumentNullException on either condition. arg to check name of the arg Does not return a value helper fn to check arg for null. Throws ArgumentNullException on either condition. arg to check name of the arg Does not return a value helper fn to check arg for null. arg to check name of the arg Does not return a value Gets TypeTable by querying the ExecutionContext stored in Thread-Local-Storage. This will return null if ExecutionContext is not available. Gets the application base for current monad version applicationbase path for current monad version installation if caller doesn't have permission to read the key Checks if the current process is using WOW returns current major version of monad ( that is running ) in a string format. string Cannot return a Version object as minor number is a requirement for version object. Coverts a string to version format. Monad supports only major.minor version format. If input string is of format "x.x.x.x" then a null will be returned. Only "x.x" format is supported. string representing version A Version Object. Checks whether current monad session supports version specified by ver. Version to check true if supported, false otherwise Checks whether current monad session supports version specified by checkVersion. Version to check true if supported, false otherwise Checks whether current monad session supports NetFrameworkVersion specified by checkVersion. The specified version is treated as the the minimum required version of .NET framework. Version to check true if version to check is higher than the known highest version true if supported, false otherwise String representing the Default shellID. String used to control directory location for PowerShell Profile uses this to control profile loading. The name of the subdirectory that contains packages. An array of path separator characters... Provides enumerated values to use to set wildcard pattern matching options. Indicates that no special processing is required. Specifies that the wildcard pattern is compiled to an assembly. This yields faster execution but increases startup time. Specifies case-insensitive matching. Specifies culture-invariant matching. Represents a wildcard pattern. Initializes and instance of the WildcardPattern class for the specified wildcard pattern. The wildcard pattern to match The constructed WildcardPattern object if wildCardType == None, the pattern does not have wild cards Initializes an instance of the WildcardPattern class for the specified wildcard pattern expression, with options that modify the pattern. The wildcard pattern to match. Wildcard options The constructed WildcardPattern object if wildCardType == None, the pattern does not have wild cards Instantiate internal regex member if not already done. true on success, false otherwise Indicates whether the wildcard pattern specified in the WildcardPattern constructor finds a match in the input string. The string to search for a match. true if the wildcard pattern finds a match; otherwise, false Escape special chars, except for those specified in , in a string by replacing them with their escape codes. The input string containing the text to convert. Array of characters that not to escape A string of characters with any metacharacters, except for those specified in , converted to their escaped form. Escape special chars in a string by replacing them with their escape codes. The input string containing the text to convert. A string of characters with any metacharacters converted to their escaped form. Checks to see if the given string has any wild card characters in it. String which needs to be checked for the presence of wildcard chars true if the string has wild card chars, false otherwise. Currently { '*', '?', '[' } are considered wild card chars and '`' is the escape character. Unescapes any escaped characters in the input string. The input string containing the text to convert. A string of characters with any escaped characters converted to their unescaped form. If is null. Converts this wildcard to a string that can be used as a right-hand-side operand of the LIKE operator of WQL. For example: "a*" will be converted to "a%". wildcard pattern converted to regex pattern. Thrown when a wildcard pattern is invalid. Constructor for class WildcardPatternException that takes an ErrorRecord to use in constructing this exception. This is the recommended constructor to use for this exception. ErrorRecord object containing additional information about the error condition. constructed object Constructs an instance of the WildcardPatternException object. Constructs an instance of the WildcardPatternException object taking a message parameter to use in cnstructing the exception. The string to use as the exception message Constructor for class WildcardPatternException that takes both a message to use and an inner exception to include in this object. The exception message to use The innerException object to encapsulate. Constructor for class WildcardPatternException for serialization. serialization information streaming context A base class for parsers of patterns. Called from method to indicate the beginning of the wildcard pattern. Default implementation simply returns. object that includes both the text of the pattern () and the pattern options () Called from method to indicate that the next part of the pattern should match a literal character . Called from method to indicate that the next part of the pattern should match any string, including an empty string. Called from method to indicate that the next part of the pattern should match any single character. Called from method to indicate the end of the wildcard pattern. Default implementation simply returns. Called from method to indicate the beginning of a bracket expression. Bracket expressions of are a greatly simplified version of bracket expressions of POSIX wildcards (http://www.opengroup.org/onlinepubs/9699919799/functions/fnmatch.html). Only literal characters and character ranges are supported. Negation (with either '!' or '^' characters), character classes ([:alpha:]) and other advanced features are not supported. Called from method to indicate that the bracket expression should include a literal character . Called from method to indicate that the bracket expression should include all characters from character range starting at and ending at Called from method to indicate the end of a bracket expression. PowerShell v1 and v2 treats all characters inside as literal characters, except '-' sign which denotes a range. In particular it means that '^', '[', ']' are escaped within the bracket expression and don't have their regex-y meaning. This method should be kept "internal" Parses , calling appropriate overloads in Pattern to parse Parser to call back Convert a string with wild cards into its equivalent regex A list of glob patterns and their equivalent regexes glob pattern regex ------------- ------- *foo* foo foo ^foo$ foo*bar ^foo.*bar$ foo`*bar ^foo\*bar$ for a more cases see the unit-test file RegexTest.cs Parses a into a Wildcard pattern to parse Regular expression equivalent to Translates a into a DOS wildcard Converts into a DOS wildcard The base class for Cmdlet providers that expose a single level of items. The ContainerCmdletProvider class is base class that a provider derives from to implement methods that allow the use of a set of core commands against the objects that the provider gives access to. By deriving from this class users can take advantage of all the features of the as well as globbing and the following commands when targetting this provider: get-childitem rename-item new-item remove-item set-location push-location pop-location get-location -stack The base class for Cmdlet providers that expose an item as an MSH path. The ItemCmdletProvider class is a base class that a provider derives from to inherit a set of methods that allows the Monad engine to provide a core set of commands for getting and setting of data on one or more items. A provider should derive from this class if they want to take advantage of the item core commands that are already implemented by the Monad engine. This allows users to have common commands and semantics across multiple providers. The base class for Cmdlet providers that can be exposed through MSH drives. Although it is possible to derive from this base class to implement a Cmdlet Provider, in most cases one should derive from , , or The base class for Cmdlet provider. Although it is possible to derive from this base class to implement a Cmdlet Provider, in most cases one should derive from , , or Defines the base class for all of the classes the provide implementations for a particular data store or item for the MSH core commands. The context under which the provider is running. This will change between each invocation of a method in this class or derived classes. The information that the Monad engine stores on behalf of the provider. An instance of the PSTraceSource class used for trace output using "CmdletProviderClasses" as the category. Sets the provider information that is stored in the Monad engine into the provider base class. The provider information that is stored by the Monad engine. If is null. Checks whether the filter of the provider is set. Can be overriden by derived class when additional filters are defined. Whether the filter of the provider is set. Called when the provider is first initialized. It sets the context of the call and then calls the derived providers Start method. The information about the provider. The context under which this method is being called. Gets an object that defines the additional parameters for the Start implementation for a provider. The context under which this method is being called. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. Called when the provider is being removed. It sets the context of the call and then calls the derived providers Stop method. The context under which this method is being called. Internal wrapper for the GetProperty protected method. This method will only be called if the provider implements the IPropertyCmdletProvider interface. The path to the item to retrieve properties from. A list of properties that should be retrieved. If this parameter is null or empty, all properties should be retrieved. The context under which this method is being called. Gives the provider a chance to attach additional parameters to the get-itemproperty cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. A list of properties that should be retrieved. If this parameter is null or empty, all properties should be retrieved. The context under which this method is being called. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. Internal wrapper for the SetProperty protected method. This method will only be called if the provider implements the IPropertyCmdletProvider interface. The path to the item to set the properties on. A PSObject which contains a collection of the name, type, value of the properties to be set. The context under which this method is being called. Gives the provider a chance to attach additional parameters to the set-itemproperty cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. A PSObject which contains a collection of the name, type, value of the properties to be set. The context under which this method is being called. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. Internal wrapper for the ClearProperty protected method. This method will only be called if the provider implements the IPropertyCmdletProvider interface. The path to the item from which the property should be cleared. The name of the property that should be cleared. The context under which this method is being called. Implement this method when you are providing access to a data store that allows dynamic clearing of properties. Gives the provider a chance to attach additional parameters to the clear-itemproperty cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. A list of properties that should be cleared. If this parameter is null or empty, all properties should be cleared. The context under which this method is being called. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. Internal wrapper for the NewProperty protected method. This method will only be called if the provider implements the IDynamicPropertyCmdletProvider interface. The path to the item on which the new property should be created. The name of the property that should be created. The type of the property that should be created. The new value of the property that should be created. The context under which this method is being called. Implement this method when you are providing access to a data store that allows dynamic creation of properties. Gives the provider a chance to attach additional parameters to the new-itemproperty cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. The name of the property that should be created. The type of the property that should be created. The new value of the property that should be created. The context under which this method is being called. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. Internal wrapper for the RemoveProperty protected method. This method will only be called if the provider implements the IDynamicPropertyCmdletProvider interface. The path to the item on which the property should be removed. The name of the property to be removed The context under which this method is being called. Implement this method when you are providing access to a data store that allows dynamic removal of properties. Gives the provider a chance to attach additional parameters to the remove-itemproperty cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. The name of the property that should be removed. The context under which this method is being called. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. Internal wrapper for the RenameProperty protected method. This method will only be called if the provider implements the IDynamicPropertyCmdletProvider interface. The path to the item on which the property should be renamed. The name of the property that should be renamed. The new name for the property. The context under which this method is being called. Implement this method when you are providing access to a data store that allows dynamic renaming of properties. Gives the provider a chance to attach additional parameters to the rename-itemproperty cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. The name of the property that should be renamed. The name of the property to rename it to. The context under which this method is being called. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. Internal wrapper for the CopyProperty protected method. This method will only be called if the provider implements the IDynamicPropertyCmdletProvider interface. The path to the item from which the property should be copied. The name of the property that should be copied. The path to the item to which the property should be copied. The name of the property that should be copied to. The context under which this method is being called. Implement this method when you are providing access to a data store that allows dynamic copying of properties. Gives the provider a chance to attach additional parameters to the copy-itemproperty cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. The name of the property that should be copied. The path to the item to which the property should be copied. The name of the property that should be copied to. The context under which this method is being called. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. Internal wrapper for the MoveProperty protected method. This method will only be called if the provider implements the IDynamicPropertyCmdletProvider interface. The path to the item from which the property should be moved. The name of the property that should be moved. The path to the item to which the property should be moved. The name of the property that should be moved to. The context under which this method is being called. Implement this method when you are providing access to a data store that allows dynamic moving of properties. Gives the provider a chance to attach additional parameters to the move-itemproperty cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. The name of the property that should be copied. The path to the item to which the property should be copied. The name of the property that should be copied to. The context under which this method is being called. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. Internal wrapper for the GetContentReader protected method. This method will only be called if the provider implements the IContentCmdletProvider interface. The path to the item to retrieve content from. The context under which this method is being called. An instance of the IContentReader for the specified path. Gives the provider a chance to attach additional parameters to the get-content cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. The context under which this method is being called. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. Internal wrapper for the GetContentWriter protected method. This method will only be called if the provider implements the IContentCmdletProvider interface. The path to the item to set content on. The context under which this method is being called. An instance of the IContentWriter for the specified path. Gives the provider a chance to attach additional parameters to the add-content and set-content cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. The context under which this method is being called. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. Internal wrapper for the ClearContent protected method. This method will only be called if the provider implements the IContentCmdletProvider interface. The path to the item to clear the content from. The context under which this method is being called. Gives the provider a chance to attach additional parameters to the clear-content cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. The context under which this method is being called. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. Gives the provider the opportunity to initialize itself. The information about the provider that is being started. The default implementation returns the ProviderInfo instance that was passed. To have session state maintain persisted data on behalf of the provider, the provider should derive from and add any properties or methods for the data it wishes to persist. When Start gets called the provider should construct an instance of its derived ProviderInfo using the providerInfo that is passed in and return that new instance. Gets an object that defines the additional parameters for the Start implementation for a provider. Overrides of this method should return an object that has properties and fields decorated with parsing attributes similar to a cmdlet class or a . The default implemenation returns null. (no additional parameters) Called by session state when the provider is being removed. A provider should override this method to free up any resources that the provider was using. The default implementation does nothing. Gets the resource string corresponding to baseName and resourceId from the current assembly. You should override this if you require a different behavior. the base resource name the resource id the resource string corresponding to baseName and resourceId When overriding this method, the resource string for the specified resource should be retrieved from a localized resource assembly. Returns true if a transaction is available and active. Converts the incoming object to a PSObject and then adds extra data as notes. Then it writes the shell object to the context. The item being written out. The path of the item being written out. True if the item is a container, false otherwise. Converts the incoming object to a PSObject and then adds extra data as notes. Then it writes the shell object to the context. The item being written out. The path of the item being written out. Wraps the item in a PSObject and attaches some notes to the object that deal with path information. The item to be wrapped. The path to the item. A PSObject that wraps the item and has path information attached as notes. if is null. Writes an item to the output as a PSObject with extra data attached as notes. The item to be written. The path of the item being written. True if the item is a container, false otherwise. Writes a property object to the output as a PSObject with extra data attached as notes. The properties to be written. The path of the item being written. Writes a Security Descriptor object to the output as a PSObject with extra data attached as notes. The Security Descriptor to be written. The path of the item from which the Security Descriptor was retrieved. Internal wrapper for the GetSecurityDescriptor protected method. This method will only be called if the provider implements the ISecurityDescriptorCmdletProvider interface. The path to the item to retrieve the security descriptor from. Specifies the parts of a security descriptor to retrieve. The context under which this method is being called. Nothing. An instance of an object that represents the security descriptor for the item specifed by the path should be written to the context. Internal wrapper for the SetSecurityDescriptor protected method. This method will only be called if the provider implements the ISecurityDescriptorCmdletProvider interface. The path to the item to set the new security descriptor on. The new security descriptor for the item. The context under which this method is being called. Nothing. The security descriptor object that was set should be written to the context. Gets or sets the context for the running command. On set, if the context contains credentials and the provider doesn't support credentials, or if the context contains a filter parameter and the provider does not support filters. Indicates whether stop has been requested on this provider. Gets the instance of session state for the current runspace. Gets the instance of the provider interface APIs for the current runspace. Gets the instance of the command invocation APIs for the current runspace. Gets the credentials under which the operation should run. The information about the provider that is stored in the runspace on behalf of the provider. If a derived type of ProviderInfo was returned from the Start method, it will be set here in all subsequent calls to the provider. The drive information associated with the context of the current operation. The dynamic parameters object populated with the values as specified by the user. Gets the force property. Gives the provider guidance on how vigorous it should be about performing the operation. If true, the provider should do everything possible to perform the operation. If false, the provider should attempt the operation but allow even simple errors to terminate the operation. For example, if the user tries to copy a file to a path that already exists and the destination is read-only, if force is true, the provider should copy over the existing read-only file. If force is false, the provider should write an error. Gets the provider specific filter that was supplied by the caller. Gets the include wildcard patterns which is used to determine which items will be included when taking an action. Gets the exclude wildcard patterns which is used to determine which items will be excluded when taking an action. Gets the host interaction APIs. Gets an object that surfaces the current PowerShell transaction. When this object is disposed, PowerShell resets the active transaction Internal wrapper for the NewDrive protected method. It is called instead of the protected method that is overridden by derived classes so that the context of the command can be set. The PSDriveInfo object the represents the drive to be mounted. The context under which this method is being called. The drive that was returned from the protected NewDrive method. Gives the provider to attach additional parameters to the New-PSDrive cmdlet. The context under which this method is being called. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. Internal wrapper for the RemoveDrive protected method. It is called instead of the protected method that is overridden by derived classes so that the context of the command can be set. The PSDriveInfo object the represents the mounted drive. The context under which this method is being called. The drive that was returned from the protected RemoveDrive method. Internal wrapper for the InitializeDefaultDrives protected method. It is called instead of the protected method that is overridden by derived classes so that the context of the command can be set. The context under which this method is being called. An array of drives returned from the protected InitializeDefaultDrives method. Gives the provider an opportunity to validate the drive that is being added. It also allows the provider to modify parts of the PSDriveInfo object. This may be done for performance or reliability reasons or to provide extra data to all calls using the Drive. The proposed new drive. The new drive that is to be added to the MSH namespace. This can either be the same object that was passed in or a modified version of it. The default implementation returns the drive that was passed. This method gives the provider an opportunity to associate provider specific data with a drive. This is done by deriving a new class from and adding any properties, methods, or fields that are necessary. When this method gets called, the override should create an instance of the derived PSDriveInfo using the passed in PSDriveInfo. The derived PSDriveInfo should then be returned. Each subsequent call into the provider that uses this drive will have access to the derived PSDriveInfo via the PSDriveInfo property provided by the base class. Any failures should be sent to the method and null should be returned. Gives the provider an opportunity to attach additional parameters to the New-PSDrive cmdlet. Overrides of this method should return an object that has properties and fields decorated with parsing attributes similar to a cmdlet class or a . The default implemenation returns null. (no additional parameters) Gives the provider an opportunity to clean up any provider specific data for the drive that is going to be removed. The Drive object the represents the mounted drive. If the drive can be removed it should return the drive that was passed in. If the drive cannot be removed, null should be returned or an exception should be thrown. The default implementation returns the drive that was passed. A provider should override this method to free any resources that may be associated with the drive being removed. Gives the provider the ability to map drives after initialization. A collection of the drives the provider wants to be added to the session upon initialization. The default implementation returns an empty collection. After the Start method is called on a provider, the InitializeDefaultDrives method is called. This is an opportunity for the provider to mount drives that are important to it. For instance, the Active Directory provider might mount a drive for the defaultNamingContext if the machine is joined to a domain. All providers should mount a root drive to help the user with discoverability. This root drive might contain a listing of a set of locations that would be interesting as roots for other mounted drives. For instance, the Active Directory provider my create a drive that lists the naming contexts found in the namingContext attributes on the RootDSE. This will help users discover interesting mount points for other drives. Internal wrapper for the GetItem protected method. It is called instead of the protected method that is overridden by derived classes so that the context of the command can be set. The path to the item to retrieve. The context under which this method is being called. Nothing is returned, but all objects should be written to the WriteObject method. Gives the provider to attach additional parameters to the get-item cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. The context under which this method is being called. Overrides of this method should return an object that has properties and fields decorated with parsing attributes similar to a cmdlet class or a . The default implemenation returns null. (no additional parameters) Internal wrapper for the SetItem protected method. It is called instead of the protected method that is overridden by derived classes so that the context of the command can be set. The path to the item to set. The value of the item specified by the path. The context under which this method is being called. The item that was set at the specified path. Gives the provider to attach additional parameters to the set-item cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. The value of the item specified by the path. The context under which this method is being called. Overrides of this method should return an object that has properties and fields decorated with parsing attributes similar to a cmdlet class or a . The default implemenation returns null. (no additional parameters) Internal wrapper for the ClearItem protected method. It is called instead of the protected method that is overridden by derived classes so that the context of the command can be set. The path to the item to clear. The context under which this method is being called. Gives the provider to attach additional parameters to the clear-item cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. The context under which this method is being called. Overrides of this method should return an object that has properties and fields decorated with parsing attributes similar to a cmdlet class or a . The default implemenation returns null. (no additional parameters) Internal wrapper for the InvokeDefaultAction protected method. It is called instead of the protected method that is overridden by derived classes so that the context of the command can be set. The path to the item to perform the default action on. The context under which this method is being called. Gives the provider to attach additional parameters to the invoke-item cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. The context under which this method is being called. Overrides of this method should return an object that has properties and fields decorated with parsing attributes similar to a cmdlet class or a . The default implemenation returns null. (no additional parameters) Internal wrapper for the Exists protected method. It is called instead of the protected method that is overridden by derived classes so that the context of the command can be set. The path to the item to see if it exists. The context under which this method is being called. True if the item exists, false otherwise. Gives the provider to attach additional parameters to the test-path cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. The context under which this method is being called. Overrides of this method should return an object that has properties and fields decorated with parsing attributes similar to a cmdlet class or a . The default implemenation returns null. (no additional parameters) Internal wrapper for the IsValidPath protected method. It is called instead of the protected method that is overridden by derived classes so that the context of the command can be set. The path to check for validity. The context under which this method is being called. True if the path is syntactically and semantically valid for the provider, or false otherwise. This test should not verify the existance of the item at the path. It should only perform syntactic and semantic validation of the path. For instance, for the file system provider, that path should be canonicalized, syntactically verified, and ensure that the path does not refer to a device. Internal wrapper for the ExpandPath protected method. It is called instead of the protected method that is overridden by derived classes so that the context of the command can be set. Only called for providers that declare the ExpandWildcards capability. The path to expand. Expansion must be consistent with the wildcarding rules of PowerShell's WildcardPattern class. The context under which this method is being called. A list of provider paths that this path expands to. They must all exist. Gets the item at the specified path. The path to the item to retrieve. Nothing is returned, but all objects should be written to the WriteItemObject method. Providers override this method to give the user access to the provider objects using the get-item and get-childitem cmdlets. Providers that declare of ExpandWildcards, Filter, Include, or Exclude should ensure that the path passed meets those requirements by accessing the appropriate property from the base class. By default overrides of this method should not write objects that are generally hidden from the user unless the Force property is set to true. For instance, the FileSystem provider should not call WriteItemObject for hidden or system files unless the Force property is set to true. The default implementation of this method throws an . Gives the provider an opportunity to attach additional parameters to the get-item cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. Overrides of this method should return an object that has properties and fields decorated with parsing attributes similar to a cmdlet class or a . The default implemenation returns null. (no additional parameters) Sets the item specified by the path. The path to the item to set. The value of the item specified by the path. Nothing. The item that was set should be passed to the WriteItemObject method. Providers override this method to give the user the ability to modify provider objects using the set-item cmdlet. Providers that declare of ExpandWildcards, Filter, Include, or Exclude should ensure that the path passed meets those requirements by accessing the appropriate property from the base class. By default overrides of this method should not set or write objects that are generally hidden from the user unless the Force property is set to true. An error should be sent to the WriteError method if the path represents an item that is hidden from the user and Force is set to false. The default implementation of this method throws an . Gives the provider an opportunity to attach additional parameters to the set-item cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. The value of the item specified by the path. Overrides of this method should return an object that has properties and fields decorated with parsing attributes similar to a cmdlet class or a . The default implemenation returns null. (no additional parameters) Clears the item specified by the path. The path to the item to clear. Nothing. The item that was cleared should be passed to the WriteItemObject method. Providers override this method to give the user the ability to clear provider objects using the clear-item cmdlet. Providers that declare of ExpandWildcards, Filter, Include, or Exclude should ensure that the path passed meets those requirements by accessing the appropriate property from the base class. By default overrides of this method should not clear or write objects that are generally hidden from the user unless the Force property is set to true. An error should be sent to the WriteError method if the path represents an item that is hidden from the user and Force is set to false. The default implementation of this method throws an . Gives the provider an opportunity to attach additional parameters to the clear-item cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. Overrides of this method should return an object that has properties and fields decorated with parsing attributes similar to a cmdlet class or a . The default implemenation returns null. (no additional parameters) Invokes the default action on the specified item. The path to the item to perform the default action on. Nothing. The item that was set should be passed to the WriteItemObject method. The default implemenation does nothing. Providers override this method to give the user the ability to invoke provider objects using the invoke-item cmdlet. Think of the invocation as a double click in the Windows Shell. This method provides a default action based on the path that was passed. Providers that declare of ExpandWildcards, Filter, Include, or Exclude should ensure that the path passed meets those requirements by accessing the appropriate property from the base class. By default overrides of this method should not invoke objects that are generally hidden from the user unless the Force property is set to true. An error should be sent to the WriteError method if the path represents an item that is hidden from the user and Force is set to false. Gives the provider an opportunity to attach additional parameters to the invoke-item cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. Overrides of this method should return an object that has properties and fields decorated with parsing attributes similar to a cmdlet class or a . The default implemenation returns null. (no additional parameters) Determines if an item exists at the specified path. The path to the item to see if it exists. True if the item exists, false otherwise. Nothing. The item that was set should be passed to the WriteItemObject method. Providers override this method to give the user the ability to check for the existence of provider objects using the set-item cmdlet. Providers that declare of ExpandWildcards, Filter, Include, or Exclude should ensure that the path passed meets those requirements by accessing the appropriate property from the base class. The implemenation of this method should take into account any form of access to the object that may make it visible to the user. For instance, if a user has write access to a file in the file system provider bug not read access, the file still exists and the method should return true. Sometimes this may require checking the parent to see if the child can be enumerated. The default implementation of this method throws an . Gives the provider an opportunity to attach additional parameters to the test-path cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. Overrides of this method should return an object that has properties and fields decorated with parsing attributes similar to a cmdlet class or a . The default implemenation returns null. (no additional parameters) Providers must override this method to verify the syntax and semantics of their paths. The path to check for validity. True if the path is syntactically and semantically valid for the provider, or false otherwise. This test should not verify the existance of the item at the path. It should only perform syntactic and semantic validation of the path. For instance, for the file system provider, that path should be canonicalized, syntactically verified, and ensure that the path does not refer to a device. Expand a provider path that contains wildcards to a list of provider paths that the path represents.Only called for providers that declare the ExpandWildcards capability. The path to expand. Expansion must be consistent with the wildcarding rules of PowerShell's WildcardPattern class. A list of provider paths that this path expands to. They must all exist. Internal wrapper for the GetChildItems protected method. It is called instead of the protected method that is overridden by derived classes so that the context of the command can be set. The path (or name in a flat namespace) to the item from which to retrieve the children. True if all children in a subtree should be retrieved, false if only a single level of children should be retrieved. This parameter should only be true for the NavigationCmdletProvider derived class. The context under which this method is being called. Nothing is returned, but all children should be written to the Write*Object or Write*Objects method. Gives the provider to attach additional parameters to the get-childitem cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. True if all children in a subtree should be retrieved, false if only a single level of children should be retrieved. This parameter should only be true for the NavigationCmdletProvider derived class. The context under which this method is being called. Overrides of this method should return an object that has properties and fields decorated with parsing attributes similar to a cmdlet class or a . The default implemenation returns null. (no additional parameters) Internal wrapper for the GetChildNames protected method. It is called instead of the protected method that is overridden by derived classes so that the context of the command can be set. The path to the item from which to retrieve the child names. Determines if all containers should be returned or only those containers that match the filter(s). The context under which this method is being called. Nothing is returned, but all names should be written to the Write*Object or Write*Objects method. The child names are the leaf portion of the path. Example, for the file system the name for the path c:\windows\system32\foo.dll would be foo.dll or for the directory c:\windows\system32 would be system32. For Active Directory the child names would be RDN values of the child objects of the container. Gets a new provider-specific path and filter (if any) that corresponds to the given path. The path to the item. Unlike most other provider APIs, this path is likely to contain PowerShell wildcards. The provider-specific filter currently applied. The new path to the item. The new filter. The context under which this method is being called. True if the path or filter were altered. False otherwise. Providers override this method if they support a native filteing syntax that can offer performance improvements over wildcard matching done by the PowerShell engine. If the provider can handle a portion (or all) of the PowerShell wildcard with semantics equivalent to the PowerShell wildcard, it may adjust the path to exclude the PowerShell wildcard. If the provider can augment the PowerShell wildcard with an approximate filter (but not replace it entirely,) it may simply return a filter without modifying the path. In this situation, PowerShell's wildcarding will still be applied to a smaller result set, resulting in improved performance. The default implementation of this method leaves both Path and Filter unmodified. Gives the provider to attach additional parameters to the get-childitem -name cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. The context under which this method is being called. Overrides of this method should return an object that has properties and fields decorated with parsing attributes similar to a cmdlet class or a . The default implemenation returns null. (no additional parameters) Internal wrapper for the RenameItem protected method. It is called instead of the protected method that is overridden by derived classes so that the context of the command can be set. The path to the item to rename. The name to which the item should be renamed. This name should always be relative to the parent container. The context under which this method is being called. Nothing is returned, but all renamed items should be written to the Write*Object or Write*Objects. Gives the provider to attach additional parameters to the rename-item cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. The name to which the item should be renamed. This name should always be relative to the parent container. The context under which this method is being called. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. Internal wrapper for the New protected method. It is called instead of the protected method that is overridden by derived classes so that the context of the command can be set. The path to the item to create. The provider defined type of the item to create. This is a provider specific type that the provider can use to create a new instance of an item at the specified path. The context under which this method is being called. Nothing is returned, but all new items should be written to the Write*Object or Write*Objects. Gives the provider to attach additional parameters to the new-item cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. The provider defined type of the item to create. This is a provider specific type that the provider can use to create a new instance of an item at the specified path. The context under which this method is being called. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. Internal wrapper for the Remove protected method. It is called instead of the protected method that is overridden by derived classes so that the context of the command can be set. The path to the item to remove. True if all children in a subtree should be removed, false if only a single level of children should be removed. This parameter should only be true for NavigationCmdletProvider and its derived classes. The context under which this method is being called. Gives the provider to attach additional parameters to the remove-item cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. True if all children in a subtree should be removed, false if only a single level of children should be removed. This parameter should only be true for NavigationCmdletProvider and its derived classes. The context under which this method is being called. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. Internal wrapper for the HasChildItems protected method. It is called instead of the protected method that is overridden by derived classes so that the context of the command can be set. The path to the item to see if it has children. The context under which this method is being called. True if the item has children, false otherwise. For implementers of ContainerCmdletProvider classes and those derived from it, if a null or empty path is passed, the provider should consider any items in the data store to be children and return true. Internal wrapper for the Copy protected method. It is called instead of the protected method that is overridden by derived classes so that the context of the command can be set. The path of the item to copy. The path of the item to copy to. Tells the provider to recurse sub-containers when copying. The context under which this method is being called. Nothing. All objects that are copied should be written to the Write*Object or Write*Objects methods. Gives the provider to attach additional parameters to the copy-item cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. The path of the item to copy to. Tells the provider to recurse sub-containers when copying. The context under which this method is being called. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. Gets the children of the item at the specified path. The path (or name in a flat namespace) to the item from which to retrieve the children. True if all children in a subtree should be retrieved, false if only a single level of children should be retrieved. This parameter should only be true for the NavigationCmdletProvider derived class. Nothing is returned, but all objects should be written to the WriteItemObject method. Providers override this method to give the user access to the provider objects using the get-childitem cmdlets. Providers that declare of ExpandWildcards, Filter, Include, or Exclude should ensure that the path passed meets those requirements by accessing the appropriate property from the base class. By default overrides of this method should not write objects that are generally hidden from the user unless the Force property is set to true. For instance, the FileSystem provider should not call WriteItemObject for hidden or system files unless the Force property is set to true. The provider implementation is responsible for preventing infinite recursion when there are circular links and the like. An appropriate terminating exception should be thrown if this situation occurs. The default implementation of this method throws an . Gives the provider an opportunity to attach additional parameters to the get-childitem cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. True if all children in a subtree should be retrieved, false if only a single level of children should be retrieved. This parameter should only be true for the NavigationCmdletProvider derived class. Overrides of this method should return an object that has properties and fields decorated with parsing attributes similar to a cmdlet class or a . The default implemenation returns null. (no additional parameters) Gets names of the children of the specified path. The path to the item from which to retrieve the child names. Determines if all containers should be returned or only those containers that match the filter(s). Nothing is returned, but all objects should be written to the WriteItemObject method. Providers override this method to give the user access to the provider objects using the get-childitem -name cmdlet. Providers that declare of ExpandWildcards, Filter, Include, or Exclude should ensure that the path passed meets those requirements by accessing the appropriate property from the base class. The exception to this is if is true, then any child name for a container should be returned even if it doesn't match the Filter, Include, or Exclude. By default overrides of this method should not write the names of objects that are generally hidden from the user unless the Force property is set to true. For instance, the FileSystem provider should not call WriteItemObject for hidden or system files unless the Force property is set to true. The provider implementation is responsible for preventing infinite recursion when there are circular links and the like. An appropriate terminating exception should be thrown if this situation occurs. The default implementation of this method throws an . Gets a new provider-specific path and filter (if any) that corresponds to the given path. The path to the item. Unlike most other provider APIs, this path is likely to contain PowerShell wildcards. The provider-specific filter currently applied. The new path to the item. The new filter. True if the path or filter were altered. False otherwise. Providers override this method if they support a native filteing syntax that can offer performance improvements over wildcard matching done by the PowerShell engine. If the provider can handle a portion (or all) of the PowerShell wildcard with semantics equivalent to the PowerShell wildcard, it may adjust the path to exclude the PowerShell wildcard. If the provider can augment the PowerShell wildcard with an approximate filter (but not replace it entirely,) it may simply return a filter without modifying the path. In this situation, PowerShell's wildcarding will still be applied to a smaller result set, resulting in improved performance. The default implementation of this method leaves both Path and Filter unmodified. PowerShell wildcarding semantics are handled by the System.Management.Automation.Wildcardpattern class. Gives the provider an opportunity to attach additional parameters to the get-childitem -name cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. Overrides of this method should return an object that has properties and fields decorated with parsing attributes similar to a cmdlet class or a . The default implemenation returns null. (no additional parameters) Renames the item at the specified path to the new name provided. The path to the item to rename. The name to which the item should be renamed. This name should always be relative to the parent container. Nothing is returned, but the renamed items should be written to the WriteItemObject method. Providers override this method to give the user the ability to rename provider objects using the rename-item cmdlet. Providers that declare of ExpandWildcards, Filter, Include, or Exclude should ensure that the path passed meets those requirements by accessing the appropriate property from the base class. By default overrides of this method should not allow renaming objects that are generally hidden from the user unless the Force property is set to true. For instance, the FileSystem provider should not allow renaming of a hidden or system file unless the Force property is set to true. This method is intended for the modification of the item's name only and not for Move operations. An error should be written to if the parameter contains path separators or would cause the item to change its parent location. The default implementation of this method throws an . Gives the provider an opportunity to attach additional parameters to the rename-item cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. The name to which the item should be renamed. This name should always be relative to the parent container. Overrides of this method should return an object that has properties and fields decorated with parsing attributes similar to a cmdlet class or a . The default implemenation returns null. (no additional parameters) Creates a new item at the specified path. The path to the item to create. The provider defined type for the object to create. This is a provider specific type that the provider can use to create a new instance of an item at the specified path. Nothing is returned, but the renamed items should be written to the WriteItemObject method. Providers override this method to give the user the ability to create new provider objects using the new-item cmdlet. The parameter is a provider specific string that the user specifies to tell the provider what type of object to create. For instance, in the FileSystem provider the parameter can take a value of "file" or "directory". The comparison of this string should be case-insensitive and you should also allow for least ambiguous matches. So if the provider allows for the types "file" and "directory", only the first letter is required to disambiguate. If refers to a type the provider cannot create, the provider should produce an with a message indicating the types the provider can create. The parameter can be any type of object that the provider can use to create the item. It is recommended that the provider accept at a minimum strings, and an instance of the type of object that would be returned from GetItem() for this path. can be used to convert some types to the desired type. The default implementation of this method throws an . Gives the provider an opportunity to attach additional parameters to the new-item cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. The provider defined type of the item to create. This is a provider specific type that the provider can use to create a new instance of an item at the specified path. Overrides of this method should return an object that has properties and fields decorated with parsing attributes similar to a cmdlet class or a . The default implemenation returns null. (no additional parameters) Removes (deletes) the item at the specified path The path to the item to remove. True if all children in a subtree should be removed, false if only a single level of children should be removed. This parameter should only be true for NavigationCmdletProvider and its derived classes. Nothing should be returned or written from this method. Providers override this method to allow the user the ability to remove provider objects using the remove-item cmdlet. Providers that declare of ExpandWildcards, Filter, Include, or Exclude should ensure that the path passed meets those requirements by accessing the appropriate property from the base class. By default overrides of this method should not remove objects that are generally hidden from the user unless the Force property is set to true. For instance, the FileSystem provider should not remove a hidden or system file unless the Force property is set to true. The provider implementation is responsible for preventing infinite recursion when there are circular links and the like. An appropriate terminating exception should be thrown if this situation occurs. The default implementation of this method throws an . Gives the provider an opportunity to attach additional parameters to the remove-item cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. True if all children in a subtree should be removed, false if only a single level of children should be removed. This parameter should only be true for NavigationCmdletProvider and its derived classes. Overrides of this method should return an object that has properties and fields decorated with parsing attributes similar to a cmdlet class or a . The default implemenation returns null. (no additional parameters) Determines if the item at the specified path has children. The path to the item to see if it has children. True if the item has children, false otherwise. Nothing is returned, but all objects should be written to the WriteItemObject method. Providers override this method to give the provider infrastructure the ability to determine if a particular provider object has children without having to retrieve all the child items. For implementers of classes and those derived from it, if a null or empty path is passed, the provider should consider any items in the data store to be children and return true. The default implementation of this method throws an . Copies an item at the specified path to an item at the . The path of the item to copy. The path of the item to copy to. Tells the provider to recurse sub-containers when copying. Nothing is returned, but all the objects that were copied should be written to the WriteItemObject method. Providers override this method to give the user the ability to copy provider objects using the copy-item cmdlet. Providers that declare of ExpandWildcards, Filter, Include, or Exclude should ensure that the path and items being copied meets those requirements by accessing the appropriate property from the base class. By default overrides of this method should not copy objects over existing items unless the Force property is set to true. For instance, the FileSystem provider should not copy c:\temp\foo.txt over c:\bar.txt if c:\bar.txt already exists unless the Force parameter is true. If exists and is a container then Force isn't required and should be copied into the container as a child. If is true, the provider implementation is responsible for preventing infinite recursion when there are circular links and the like. An appropriate terminating exception should be thrown if this situation occurs. The default implementation of this method throws an . Gives the provider an opportunity to attach additional parameters to the copy-item cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. The path of the item to copy to. Tells the provider to recurse sub-containers when copying. Overrides of this method should return an object that has properties and fields decorated with parsing attributes similar to a cmdlet class or a . The default implemenation returns null. (no additional parameters) The context of the core command that is being run. This includes data like the user name and password, as well as callbacks for streaming output, prompting, and progress. This allows the providers to be called in a variety of situations. The most common will be from the core cmdlets themselves but they can also be called programmatically either by having the results accumulated or by providing delgates for the various streams. NOTE: USER Feedback mechanism are only enabled for the CoreCmdlet case. This is because we have not seen a use-case for them in the other scenarios. An instance of the PSTraceSource class used for trace output using "CmdletProviderContext" as the category. Constructs the context under which the core command providers operate. The context of the engine. If is null. Constructs the context under which the core command providers operate. The context of the engine. The origin of the caller of this API If is null. Constructs the context under which the core command providers operate. The command object that is running. The credentials the core command provider should use. The drive under which this context should operate. If is null. If contains a null Host or Context reference. Constructs the context under which the core command providers operate. The command object that is running. The credentials the core command provider should use. If is null. If contains a null Host or Context reference. Constructs the context under which the core command providers operate. The command object that is running. If is null. If contains a null Host or Context reference. Constructs the context under which the core command providers operate using an existing context. A CmdletProviderContext instance to copy the filters, ExecutionContext, Credentials, Drive, and Force options from. If is null. If the constructor that takes a context to copy is called, this will be set to the context being copied. The execution context of the engine. The credentials under which the operation should run. The drive under which this context is operating. The force parameter gives guidance to providers on how vigorously they should try to perform an operation. The provider specific filter used to determine which items to act upon. A glob string used to include items upon which to act. A glob string used to exclude items upon which to act. A flag that determines if the provider should glob the paths or not The command which defines the context. This should not be made visible to anyone and should only be set through the constructor. This defines the default behavior for the WriteObject method. If it is true, a call to either of these methods will result in an immediate call to the command WriteObject(s) method, or to the write(s)ObjectDelegate if one has been supplied. If it is false, the objects will be accumulated until the GetObjects method is called. This defines the default behavior for the WriteError method. If it is true, a call to this method will result in an immediate call to the command WriteError method, or to the writeErrorDelegate if one has been supplied. If it is false, the objects will be accumulated until the GetErrorObjects method is called. A collection in which objects that are written using the WriteObject(s) methods are accumulated if is false. A collection in which objects that are written using the WriteError method are accumulated if is false. The instance of the provider that is currently executing in this context. The dynamic parameters for the provider that is currently executing in this context. Copies the include, exclude, and provider filters from the specified context to this context. The context to copy the filters from. Returns true if a transaction is available and active. Confirm the operation with the user Name of the target resource being acted upon true iff the action should be performed The ActionPreference.Stop or ActionPreference.Inquire policy triggered a terminating error. The pipeline failure will be ActionPreferenceStopException. Also, this occurs if the pipeline was already stopped. Confirm the operation with the user Name of the target resource being acted upon What action was being performed true iff the action should be performed The ActionPreference.Stop or ActionPreference.Inquire policy triggered a terminating error. The pipeline failure will be ActionPreferenceStopException. Also, this occurs if the pipeline was already stopped. Confirm the operation with the user This should contain a textual description of the action to be performed. This is what will be displayed to the user for ActionPreference.Continue. This should contain a textual query of whether the action should be performed, usually in the form of a question. This is what will be displayed to the user for ActionPreference.Inquire. This is the caption of the window which may be displayed if the user is prompted whether or not to perform the action. It may be displayed by some hosts, but not all. true iff the action should be performed The ActionPreference.Stop or ActionPreference.Inquire policy triggered a terminating error. The pipeline failure will be ActionPreferenceStopException. Also, this occurs if the pipeline was already stopped. Confirm the operation with the user This should contain a textual description of the action to be performed. This is what will be displayed to the user for ActionPreference.Continue. This should contain a textual query of whether the action should be performed, usually in the form of a question. This is what will be displayed to the user for ActionPreference.Inquire. This is the caption of the window which may be displayed if the user is prompted whether or not to perform the action. It may be displayed by some hosts, but not all. Indicates the reason(s) why ShouldProcess returned what it returned. Only the reasons enumerated in are returned. true iff the action should be performed The ActionPreference.Stop or ActionPreference.Inquire policy triggered a terminating error. The pipeline failure will be ActionPreferenceStopException. Also, this occurs if the pipeline was already stopped. Ask the user whether to continue/stop or break to a subshell Message to display to the user. This routine will append the text "Continue" to ensure that people know what question they are answering. Dialog caption if the host uses a dialog. True if the user wants to continue, false if not. Ask the user whether to continue/stop or break to a subshell Message to display to the user. This routine will append the text "Continue" to ensure that people know what question they are answering. Dialog caption if the host uses a dialog. Indicates whether the user selected YesToAll Indicates whether the user selected NoToAll True if the user wants to continue, false if not. Writes the object to the Verbose pipe. The string that needs to be written. Writes the object to the Warning pipe. The string that needs to be written. Writes a debug string. The String that needs to be written. Sets the filters that are used within this context. The include filters which determines which items are included in operations within this context. The exclude filters which determines which items are excluded from operations within this context. The provider specific filter for the operation. Gets an array of the objects that have been accumulated and the clears the collection. An object array of the objects that have been accumulated through the WriteObject method. Gets an array of the error objects that have been accumulated and the clears the collection. An object array of the objects that have been accumulated through the WriteError method. If there are any errors accumulated, the first error is thrown. If a CmdletProvider wrote any exceptions to the error pipeline, it is wrapped and then thrown. If there are any errors accumulated, the first error is thrown. If true, the error will be wrapped in a ProviderInvocationException before being thrown. If false, the error will be thrown as is. If is true, the first exception that was written to the error pipeline by a CmdletProvider is wrapped and thrown. If is false, the first exception that was written to the error pipeline by a CmdletProvider is thrown. Writes all the accumulated errors to the specified context using WriteError The context to write the errors to. If is null. Writes an object to the output. The object to be written. If streaming is on and the writeObjectHandler was specified then the object gets written to the writeObjectHandler. If streaming is on and the writeObjectHandler was not specified and the command object was specified, the object gets written to the WriteObject method of the command object. If streaming is off the object gets written to an accumulator collection. The collection of written object can be retrieved using the AccumulatedObjects method. The CmdletProvider could not stream the results because no cmdlet was specified to stream the output through. If the pipeline has been signaled for stopping but the provider calls this method. Writes the error to the pipeline or accumulates the error in an internal buffer. The error record to write to the pipeline or the internal buffer. The CmdletProvider could not stream the error because no cmdlet was specified to stream the output through. If the pipeline has been signaled for stopping but the provider calls this method. If the error pipeline hasn't been supplied a delegate or a command then this method will determine if any errors have accumulated. True if the errors are being accumulated and some errors have been accumulated. False otherwise. Call this on a separate thread when a provider is using this context to do work. This method will call the StopProcessing method of the provider. This makes the origin of the provider request visible to the internals Gets the execution context of the engine Gets or sets the provider instance for the current execution context. Gets or sets the dynamic parameters for the context Returns MyInvocation from the underlying cmdlet Determines if the Write* calls should be passed through to the command instance if there is one. The default value is true. The drive associated with this context. If is null on set. Gets the user name under which the operation should run. Gets the flag that determines if the command requested a transaction. Gets an object that surfaces the current PowerShell transaction. When this object is disposed, PowerShell resets the active transaction Gets or sets the Force property that is passed to providers. The provider specific filter that should be used when determining which items an action should take place on. A glob string that signifies which items should be included when determining which items the action should occur on. A glob string that signifies which items should be excluded when determining which items the action should occur on. Gets or sets the property that tells providers (that declare their own wildcard support) to suppress wildcard expansion. This is set when the user specifies the -LiteralPath parameter to one of the core commands. The list of contexts to which the StopProcessing calls should be referred. An interface that can be implemented on a Cmdlet provider to expose an item's content. An IContentCmdletProvider provider implements a set of methods that allows the use of a set of core commands against the data store that the provider gives access to. By implementing this interface users can take advantage the commands that expose the contents of an item. get-content set-content clear-content This interface should only be implemented on derived classes of , , , or . A namespace provider should implemented this interface if items in the namespace have content the provide wishes to expose. Gets the content reader for the item at the specified path. The path to the item to get the content reader for. Overrides of this method should return an for the item specified by the path. Providers that declare of ExpandWildcards, Filter, Include, or Exclude should ensure that the path passed meets those requirements by accessing the appropriate property from the base class. By default overrides of this method should not return a content reader for objects that are generally hidden from the user unless the Force property is set to true. An error should be sent to the WriteError method if the path represents an item that is hidden from the user and Force is set to false. Gives the provider an opportunity to attach additional parameters to the get-content cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. Overrides of this method should return an object that has properties and fields decorated with parsing attributes similar to a cmdlet class or a . The default implemenation returns null. (no additional parameters) Gets the content writer for the item at the specified path. The path to the item to get the content writer for. An IContentWriter for the item at the specified path. Overrides of this method should return an for the item specified by the path. Providers that declare of ExpandWildcards, Filter, Include, or Exclude should ensure that the path passed meets those requirements by accessing the appropriate property from the base class. By default overrides of this method should not return a content writer for objects that are generally hidden from the user unless the Force property is set to true. An error should be sent to the WriteError method if the path represents an item that is hidden from the user and Force is set to false. Gives the provider an opportunity to attach additional parameters to the set-content and add-content cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. Overrides of this method should return an object that has properties and fields decorated with parsing attributes similar to a cmdlet class or a . The default implemenation returns null. (no additional parameters) Clears the content from the specified item. The path to the item to clear the content from. Overrides of this method should remove any content from the object but not remove (delete) the object itself. Providers that declare of ExpandWildcards, Filter, Include, or Exclude should ensure that the path passed meets those requirements by accessing the appropriate property from the base class. By default overrides of this method should not clear or write objects that are generally hidden from the user unless the Force property is set to true. An error should be sent to the WriteError method if the path represents an item that is hidden from the user and Force is set to false. Gives the provider an opportunity to attach additional parameters to the clear-content cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. Overrides of this method should return an object that has properties and fields decorated with parsing attributes similar to a cmdlet class or a . The default implemenation returns null. (no additional parameters) A Cmdlet provider that implements the IContentCmdletProvider interface must provide an object that implements this interface when GetContentReader() is called. The interface allows for reading content from an item. Reads the content from the item. The number of "blocks" of data to be read from the item. An array of the blocks of data read from the item. A "block" of content is provider specific. For the file system a "block" may be considered a line of text, a byte, a character, or delimited string. The implementation of this method should break the content down into meaningful blocks that the user may want to manipulate individually. The number of blocks to return is indicated by the parameter. Moves the current "block" to be read to a position relative to a place in the reader. An offset of the number of blocks to seek from the origin. The place in the stream to start the seek from. The implemenation of this method moves the content reader number of blocks from the specified . See for a description of what a block is. Closes the reader. Further reads should fail if the reader has been closed. The implementation of this method should close any resources held open by the reader. A Cmdlet provider that implements the IContentCmdletProvider interface must provide an object that implements this interface when GetContentWriter() is called. The interface allows for writing content to an item. Writes content to the item. An array of content "blocks" to be written to the item. The blocks of content that were successfully written to the item. A "block" of content is provider specific. For the file system a "block" may be considered a byte, a character, or delimited string. The implementation of this method should treat each element in the parameter as a block. Each additional call to this method should append any new values to the content writer's current location until is called. Moves the current "block" to be written to a position relative to a place in the writer. An offset of the number of blocks to seek from the origin. The place in the stream to start the seek from. The implemenation of this method moves the content writer number of blocks from the specified . See for a description of what a block is. Closes the writer. Further writes should fail if the writer has been closed. The implementation of this method should close any resources held open by the writer. An interface that can be implemented on a Cmdlet provider to expose the dynamic manipulation of properties. An IDynamicPropertyCmdletProvider provider implements a set of methods that allows the use of a set of core commands against the data store that the provider gives access to. By implementing this interface users can take advantage the commands that expose the creation and deletion of properties on an item. rename-itemproperty remove-itemproperty new-itemproperty etc. This interface should only be implemented on derived classes of , , , or . A Cmdlet provider should implemented this interface if items in the namespace have dynamic properties the provide wishes to expose. An interface that can be implemented by a Cmdlet provider to expose properties of an item. An IPropertyCmdletProvider provider implements a set of methods that allows the use of a set of core commands against the data store that the provider gives access to. By implementing this interface users can take advantage the commands that expose the contents of an item. get-itemproperty set-itemproperty etc. This interface should only be implemented on derived classes of , , , or . A namespace provider should implemented this interface if items in the namespace have properties the provide wishes to expose. Gets the properties of the item specified by the path. The path to the item to retrieve properties from. A list of properties that should be retrieved. If this parameter is null or empty, all properties should be retrieved. Nothing. The property that was retrieved should be passed to the WritePropertyObject method. Providers override this method to give the user the ability to add properties to provider objects using the get-itemproperty cmdlet. Providers that declare of ExpandWildcards, Filter, Include, or Exclude should ensure that the path passed meets those requirements by accessing the appropriate property from the base class. By default overrides of this method should not retrieve properties from objects that are generally hidden from the user unless the Force property is set to true. An error should be sent to the WriteError method if the path represents an item that is hidden from the user and Force is set to false. An can be used as a property bag for the properties that need to be returned if the contains multiple properties to write. Gives the provider an opportunity to attach additional parameters to the get-itemproperty cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. A list of properties that should be retrieved. If this parameter is null or empty, all properties should be retrieved. Overrides of this method should return an object that has properties and fields decorated with parsing attributes similar to a cmdlet class or a . The default implemenation returns null. (no additional parameters) Sets the specified properties of the item at the specified path. The path to the item to set the properties on. A PSObject which contains a collection of the name, type, value of the properties to be set. Nothing. The property that was set should be passed to the WritePropertyObject method. Providers override this method to give the user the ability to set the value of provider object properties using the set-itemproperty cmdlet. Providers that declare of ExpandWildcards, Filter, Include, or Exclude should ensure that the path passed meets those requirements by accessing the appropriate property from the base class. By default overrides of this method should not retrieve properties from objects that are generally hidden from the user unless the Force property is set to true. An error should be sent to the WriteError method if the path represents an item that is hidden from the user and Force is set to false. An can be used as a property bag for the properties that need to be returned if the contains multiple properties to write. is a property bag containing the properties that should be set. See for more information. Gives the provider an opportunity to attach additional parameters to the get-itemproperty cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. A PSObject which contains a collection of the name, type, value of the properties to be set. Overrides of this method should return an object that has properties and fields decorated with parsing attributes similar to a cmdlet class or a . The default implemenation returns null. (no additional parameters) Clears a property of the item at the specified path. The path to the item on which to clear the property. The name of the property to clear. Nothing. The property that was cleared should be passed to the WritePropertyObject method. Providers override this method to give the user the ability to clear the value of provider object properties using the clear-itemproperty cmdlet. Providers that declare of ExpandWildcards, Filter, Include, or Exclude should ensure that the path passed meets those requirements by accessing the appropriate property from the base class. By default overrides of this method should not clear properties from objects that are generally hidden from the user unless the Force property is set to true. An error should be sent to the WriteError method if the path represents an item that is hidden from the user and Force is set to false. An can be used as a property bag for the properties that need to be returned if the contains multiple properties to write. Gives the provider an opportunity to attach additional parameters to the clear-itemproperty cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. The name of the property to clear. Overrides of this method should return an object that has properties and fields decorated with parsing attributes similar to a cmdlet class or a . The default implemenation returns null. (no additional parameters) Creates a new property on the specified item. The path to the item on which the new property should be created. The name of the property that should be created. The type of the property that should be created. The new value of the property that should be created. Nothing. The new property that was created should be passed to the WritePropertyObject method. Providers override this method to give the user the ability to add properties to provider objects using the new-itemproperty cmdlet. Providers that declare of ExpandWildcards, Filter, Include, or Exclude should ensure that the path passed meets those requirements by accessing the appropriate property from the base class. By default overrides of this method should not create new properties on objects that are generally hidden from the user unless the Force property is set to true. An error should be sent to the WriteError method if the path represents an item that is hidden from the user and Force is set to false. Gives the provider an opportunity to attach additional parameters to the new-itemproperty cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. The name of the property that should be created. The type of the property that should be created. The new value of the property that should be created. Overrides of this method should return an object that has properties and fields decorated with parsing attributes similar to a cmdlet class or a . The default implemenation returns null. (no additional parameters) Removes a property on the item specified by the path. The path to the item on which the property should be removed. The name of the property to be removed. Nothing. Providers override this method to give the user the ability to remove properties from provider objects using the remove-itemproperty cmdlet. Providers that declare of ExpandWildcards, Filter, Include, or Exclude should ensure that the path passed meets those requirements by accessing the appropriate property from the base class. By default overrides of this method should not remove properties on objects that are generally hidden from the user unless the Force property is set to true. An error should be sent to the WriteError method if the path represents an item that is hidden from the user and Force is set to false. Gives the provider an opportunity to attach additional parameters to the remove-itemproperty cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. The name of the property that should be removed. Overrides of this method should return an object that has properties and fields decorated with parsing attributes similar to a cmdlet class or a . The default implemenation returns null. (no additional parameters) Renames a property of the item at the specified path The path to the item on which to rename the property. The property to rename. The new name of the property. Nothing. The new property that was renamed should be passed to the WritePropertyObject method. Providers override this method to give the user the ability to rename properties of provider objects using the rename-itemproperty cmdlet. Providers that declare of ExpandWildcards, Filter, Include, or Exclude should ensure that the path passed meets those requirements by accessing the appropriate property from the base class. By default overrides of this method should not rename properties on objects that are generally hidden from the user unless the Force property is set to true. An error should be sent to the WriteError method if the path represents an item that is hidden from the user and Force is set to false. Gives the provider an opportunity to attach additional parameters to the rename-itemproperty cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. The property to rename. The new name of the property. Overrides of this method should return an object that has properties and fields decorated with parsing attributes similar to a cmdlet class or a . The default implemenation returns null. (no additional parameters) Copies a property of the item at the specified path to a new property on the destination item. The path to the item on which to copy the property. The name of the property to copy. The path to the item on which to copy the property to. The destination property to copy to. Nothing. The new property that was copied to should be passed to the WritePropertyObject method. Providers override this method to give the user the ability to copy properties of provider objects using the copy-itemproperty cmdlet. Providers that declare of ExpandWildcards, Filter, Include, or Exclude should ensure that the path passed meets those requirements by accessing the appropriate property from the base class. By default overrides of this method should not copy properties from or to objects that are generally hidden from the user unless the Force property is set to true. An error should be sent to the WriteError method if the path represents an item that is hidden from the user and Force is set to false. Gives the provider an opportunity to attach additional parameters to the copy-itemproperty cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. The name of the property to copy. The path to the item on which to copy the property to. The destination property to copy to. Overrides of this method should return an object that has properties and fields decorated with parsing attributes similar to a cmdlet class or a . The default implemenation returns null. (no additional parameters) Moves a property on an item specified by the path. The path to the item on which to move the property. The name of the property to move. The path to the item on which to move the property to. The destination property to move to. Nothing. The new property that was created should be passed to the WritePropertyObject method. Providers override this method to give the user the ability to move properties from one provider object to another using the move-itemproperty cmdlet. Providers that declare of ExpandWildcards, Filter, Include, or Exclude should ensure that the path passed meets those requirements by accessing the appropriate property from the base class. By default overrides of this method should not move properties on or to objects that are generally hidden from the user unless the Force property is set to true. An error should be sent to the WriteError method if the path represents an item that is hidden from the user and Force is set to false. Gives the provider an opportunity to attach additional parameters to the move-itemproperty cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. The name of the property to copy. The path to the item on which to copy the property to. The destination property to copy to. Overrides of this method should return an object that has properties and fields decorated with parsing attributes similar to a cmdlet class or a . The default implemenation returns null. (no additional parameters) Provides an interface that allows simplified interaction with namespaces that support security descriptors. The methods on this interface allow a common set of commands to manage the security on any namespace that supports this interface. This interface should only be implemented on derived classes of , , , or . A namespace provider should implement this interface if items in the namespace are protected by Security Descriptors. Gets the security descriptor for the item at the specified path. The path of the item to from which to retrieve the security descriptor. The sections of the security descriptor to retrieve, if your provider supports them. Nothing. Write the security descriptor to the context's pipeline for the item specifed by the path using the WriteSecurityDescriptorObject method. Sets the security descriptor for the item at the specified path. The path of the item to for which to set the security descriptor. The new security descriptor for the item. This should replace the previously existing security descriptor. Nothing. After setting the security descriptor to the value passed in, write the new security descriptor to the context's pipeline for the item specifed by the path using the WriteSecurityDescriptorObject method. Creates a new empty security descriptor of the same type as the item specified by the path. For example, if "path" points to a file system directory, the descriptor returned will be of type DirectorySecurity. Path of the item to use to determine the type of resulting SecurityDescriptor. The sections of the security descriptor to create. A new ObjectSecurity object of the same type as the item specified by the path. Creates a new empty security descriptor of the specified type. This method is used as a convenience function for consumers of your provider. The type of Security Descriptor to create. Your provider should understand a string representation for each of the types of SecurityDescriptors that it supports. For example, the File System provider performs a case-insensitive comparison against "file" for a FileSecurity descriptor, and "directory" or "container" for a DirectorySecurity descriptor. The sections of the security descriptor to create. A new ObjectSecurity object of the specified type. Implements the interfaces used by navigation commands to work with the virtual drive system. An instance of the PSTraceSource class used for trace output using "LocationGlobber" as the category. User level tracing for path resolution. Constructs an instance of the LocationGlobber from the current SessionState The instance of session state on which this location globber acts. If is null. Converts a PowerShell path containing glob characters to PowerShell paths that match the glob string. A PowerShell path containing glob characters. If true, a ItemNotFoundException will not be thrown for non-existing paths. Instead an appropriate path will be returned as if it did exist. The provider instance used to resolve the path. The PowerShell paths that match the glob string. If is null. If is a provider-qualified path and the specified provider does not exist. If the provider throws an exception when its MakePath gets called. If the provider does not support multiple items. If the home location for the provider is not set and starts with a "~". If does not contain glob characters and could not be found. Converts a PowerShell path containing glob characters to PowerShell paths that match the glob string. A PowerShell path containing glob characters. If true, a ItemNotFoundException will not be thrown for non-existing paths. Instead an appropriate path will be returned as if it did exist. The context under which the command is running. The instance of the provider used to resolve the path. The PowerShell paths that match the glob string. If or is null. If is a provider-qualified path and the specified provider does not exist. If the provider throws an exception when its MakePath gets called. If the provider does not support multiple items. If the home location for the provider is not set and starts with a "~". If does not contain glob characters and could not be found. If has been signaled for StopProcessing. Converts a PowerShell path containing glob characters to the provider specific paths matching the glob strings. A PowerShell path containing glob characters. If true, a ItemNotFoundException will not be thrown for non-existing paths. Instead an appropriate path will be returned as if it did exist. Returns the information of the provider that was used to do the globbing. The instance of the provider used to resolve the path. An array of provider specific paths that matched the PowerShell glob path. If is null. If the path is a provider-qualified path for a provider that is not loaded into the system. If the refers to a drive that could not be found. If the provider used to build the path threw an exception. If the provider that the represents is not a NavigationCmdletProvider or ContainerCmdletProvider. If the starts with "~" and the home location is not set for the provider. If the provider associated with the threw an exception when its GetParentPath or MakePath was called while processing the . If does not contain glob characters and could not be found. Any exception can be thrown by the provider that is called to build the provider path. Converts a PowerShell path containing glob characters to the provider specific paths matching the glob strings. A PowerShell path containing glob characters. If true, a ItemNotFoundException will not be thrown for non-existing paths. Instead an appropriate path will be returned as if it did exist. The context under which the command is running. Returns the information of the provider that was used to do the globbing. The instance of the provider used to resolve the path. An array of provider specific paths that matched the PowerShell glob path. If or is null. If the path is a provider-qualified path for a provider that is not loaded into the system. If the refers to a drive that could not be found. If the provider used to build the path threw an exception. If the provider that the represents is not a NavigationCmdletProvider or ContainerCmdletProvider. If the starts with "~" and the home location is not set for the provider. If the provider associated with the threw an exception when its GetParentPath or MakePath was called while processing the . If does not contain glob characters and could not be found. Any exception can be thrown by the provider that is called to build the provider path. Given a provider specific path that contains glob characters, this method will perform the globbing using the specified provider and return the matching provider specific paths. The path containing the glob characters to resolve. If true, a ItemNotFoundException will not be thrown for non-existing paths. Instead an appropriate path will be returned as if it did exist. The ID of the provider to use to do the resolution. The instance of the provider that was used to resolve the path. An array of provider specific paths that match the glob path. If is null. If references a provider that does not exist. If the references a provider that is not a ContainerCmdletProvider. If the provider used to build the path threw an exception. If the starts with "~" and the home location is not set for the provider. If does not contain glob characters and could not be found. Any exception can be thrown by the provider that is called to build the provider path. Given a provider specific path that contains glob characters, this method will perform the globbing using the specified provider and return the matching provider specific paths. The path containing the glob characters to resolve. The path must be in the form providerId::providerPath. If true, a ItemNotFoundException will not be thrown for non-existing paths. Instead an appropriate path will be returned as if it did exist. The provider identifier for the provider to use to do the globbing. The context under which the command is occurring. An instance of the provider that was used to perform the globbing. An array of provider specific paths that match the glob path. If , , or is null. If references a provider that does not exist. If the references a provider that is not a ContainerCmdletProvider. If the provider used to build the path threw an exception. If the starts with "~" and the home location is not set for the provider. Any exception can be thrown by the provider that is called to build the provider path. Gets a provider specific path when given an Msh path without resolving the glob characters. An Msh path. A provider specifc path that the Msh path represents. If is null. If the path is a provider-qualified path for a provider that is not loaded into the system. If the refers to a drive that could not be found. If the provider used to build the path threw an exception. If the provider that the represents is not a NavigationCmdletProvider or ContainerCmdletProvider. If the starts with "~" and the home location is not set for the provider. If the provider specified by threw an exception. Any exception can be thrown by the provider that is called to build the provider path. Gets a provider specific path when given an Msh path without resolving the glob characters. An Msh path. The information of the provider that was used to resolve the path. A provider specifc path that the Msh path represents. If is null. If the path is a provider-qualified path for a provider that is not loaded into the system. If the refers to a drive that could not be found. If the provider used to build the path threw an exception. If the provider that the represents is not a NavigationCmdletProvider or ContainerCmdletProvider. If the starts with "~" and the home location is not set for the provider. If the provider specified by threw an exception when its GetParentPath or MakePath was called while processing the . Any exception can be thrown by the provider that is called to build the provider path. Gets a provider specific path when given an Msh path without resolving the glob characters. An Msh path. The context of the command. A provider specifc path that the Msh path represents. If is null. If the path is a provider-qualified path for a provider that is not loaded into the system. If the refers to a drive that could not be found. If the provider used to build the path threw an exception. If the provider that the represents is not a NavigationCmdletProvider or ContainerCmdletProvider. If the starts with "~" and the home location is not set for the provider. If the provider specified by threw an exception when its GetParentPath or MakePath was called while processing the . Any exception can be thrown by the provider that is called to build the provider path. Returns a provider specific path for given PowerShell path. Either a PowerShell path or a provider path in the form providerId::providerPath The command context under which this operation is occurring. This parameter is filled with the provider information for the given path. This parameter is filled with the PowerShell drive that represents the given path. If a provider path is given drive will be null. The provider specific path generated from the given path. If or is null. If the path is a provider-qualified path for a provider that is not loaded into the system. If the refers to a drive that could not be found. If the provider used to build the path threw an exception. If the provider that the represents is not a NavigationCmdletProvider or ContainerCmdletProvider. If the starts with "~" and the home location is not set for the provider. If the provider specified by threw an exception when its GetParentPath or MakePath was called while processing the . Determines if the specified path is a provider. This is done by looking for two colons in a row. Anything before the colons is considered the provider ID, and everything after is considered a namespace specific path. The path to check to see if it is a provider path. True if the path is a provider path, false otherwise. If is null. Determines if the specified path is a provider. This is done by looking for two colons in a row. Anything before the colons is considered the provider ID, and everything after is considered a namespace specific path. The path to check to see if it is a provider path. The name of the provider if the path is a provider qualified path. True if the path is a provider path, false otherwise. If is null. Determines if the given path is relative or absolute The path used in the determination true if the path is an absolute path, false otherwise. If is null. Determines if the given path is relative or absolute The path used in the determination If the path is absolute, this out parameter will be the drive name of the drive that is referenced. true if the path is an absolute path, false otherwise. The instance of session state on which this globber acts. Removs the back tick "`" from any of the glob characters in the path. The path to remove the glob escaping from. The path with the glob characters unescaped. If is null. Determines if the given drive name is a "special" name defined by the shell. For instance, "default", "current", "global", and "scope[##]" are scopes for variables and are considered shell virtual drives. The name of the drive to check to see if it is a shell virtual drive. This out parameter is filled with the scope that the drive name represents. It will be null if the driveName does not represent a scope. true, if the drive name is a shell virtual drive like "Default" or "global", false otherwise. If is null. The comparison is done using a case-insensitive comparison using the Invariant culture. This is internal so that it is accessible to SessionState. If is null. Gets a provider specific path that represents the specified path and is relative to the root of the PowerShell drive. Can be a relative or absolute path. The context which the core command is running. Escape the wildcards in the current location. Use when this path will be passed through globbing. This out parameter returns the drive that was specified by the . If is an absolute path this value may be something other than the current working drive. If the path refers to a non-existent drive, this parameter is set to null, and an exception is thrown. The provider instance that was used. A provider specific relative path to the root of the drive. The path is parsed to determine if it is a relative path to the current working drive or if it is an absolute path. If it is a relative path the provider specific path is generated using the current working directory, the drive root, and the path specified. If the path is an absolute path the provider specific path is generated by stripping of anything before the : and using that to find the appropriate drive. The provider specific path is then generated the same as the relative path using the specified drive instead of the current working drive. This is internal so that it can be called from SessionState If is null. If the refers to a drive that could not be found. If the provider specified by threw an exception when its GetParentPath or MakePath was called while processing the . If the provider is not a NavigationCmdletProvider. If has been signaled for StopProcessing. Builds a provider specific path from the current working directory using the specified relative path The drive to generate the provider specific path from. The relative path to add to the absolute path in the drive. Escape the wildcards in the current location. Use when this path will be passed through globbing. An instance of the provider to use if MakePath or GetParentPath need to be called. The context which the core command is running. A string with the joined current working path and relative path. If or is null. If the provider specified by threw an exception when its GetParentPath or MakePath was called while processing the . If the provider is not a NavigationCmdletProvider. If has been signaled for StopProcessing. Uses the drive and a relative working path to construct a string which has a fully qualified provider specific path The drive to use as the root of the path. The relative working directory to the specified drive. The context which the core command is running. A string which is contains the fully qualified path in provider specific form. If or is null. If the provider throws an exception when its MakePath gets called. Parses the provider-qualified path into the provider name and the provider-internal path. The provider-qualified path to parse. The name of the provider specified by the path is returned through this out parameter. The provider-internal path. If is null. If is not in the correct format. Given a provider specific path that contains glob characters, this method will perform the globbing using the specified provider and return the matching provider specific paths. The path containing the glob characters to resolve. If true, a ItemNotFoundException will not be thrown for non-existing paths. Instead an appropriate path will be returned as if it did exist. The provider that will be used to glob the . The context under which the command is occurring. An array of provider specific paths that match the glob path and filter (if supplied via the context). This method is internal because we don't want to expose the provider instances outside the engine. If , , or is null. If the provider used to build the path threw an exception. If the starts with "~" and the home location is not set for the provider. If has been signaled for StopProcessing. Any exception can be thrown by the provider that is called to build the provider path. Determines if the specified path contains any globing characters. These characters are defined as '?' and '*'. The path to search for globing characters. True if the path contains any of the globing characters, false otherwise. If is null. Determines if the path and context are such that we need to run through the globbing algorithm. The path to check for glob characters. The context to check for filter, include, or exclude expressions. True if globbing should be performed (the path has glob characters, or the context has either a an include, or an exclude expression). False otherwise. Generates an array of provider specific paths from the single provider specific path using globing rules. A path that may or may not contain globing characters. If true, a ItemNotFoundException will not be thrown for non-existing paths. Instead an appropriate path will be returned as if it did exist. The drive that the path is relative to. The provider that implements the namespace for the path that we are globing over. The context the provider uses when performing the operation. An array of path strings that match the globing rules applied to the path parameter. First the path is checked to see if it contains any globing characters ('?' or '*'). If it doesn't then the path is returned as the only element in the array. If it does, GetParentPath and GetLeafPathName is called on the path and each element is stored until the path doesn't contain any globing characters. At that point GetChildNames() is called on the provider with the last parent path that doesn't contain a globing character. All the results are then matched against leaf element of that parent path (which did contain a glob character). We then walk out of the recursion and apply the same procedure to each leaf element that contained globing characters. The procedure above allows us to match globing strings in multiple sub-containers in the namespace without having to have knowledge of the namespace paths, or their syntax. Example: dir c:\foo\*\bar\*a??.cs Calling this method for the path above would return all files that end in 'a' and any other two characters followed by ".cs" in all the subdirectories of foo that have a bar subdirectory. If , , or is null. If the provider used to build the path threw an exception. If the provider that the represents is not a NavigationCmdletProvider or ContainerCmdletProvider. If the starts with "~" and the home location is not set for the provider. If the provider associated with the threw an exception when its GetParentPath or MakePath was called while processing the . If does not contain glob characters and could not be found. If has been signaled for StopProcessing. Any exception can be thrown by the provider that is called to build the provider path. Gets either a drive-qualified or provider-qualified path based on the drive information. The path to create a qualified path from. The drive used to qualify the path. Either a drive-qualified or provider-qualified Msh path. The drive's Hidden property is used to determine if the path returned should be provider (hidden=true) or drive (hidden=false) qualified. If or is null. Removes the provider or drive qualifier from a Msh path. The path to remove the qualifier from. The drive information used to determine if a provider qualifier or drive qualifier should be removed from the path. The path with the Msh qualifier removed. Given an Msh relative or absolute path, returns a drive-qualified absolute path. No globbing or relative path character expansion is done. The path to get the drive qualified path from. The drive the path should be qualified with. A drive-qualified absolute Msh path. If or is null. Removes the drive qualifier from a drive qualified MSH path The path to remove the drive qualifier from. The path without the drive qualifier. Given an Msh path, returns a provider-qualified path. No globbing or relative path character expansion is done. The path to get the drive qualified path from. The provider the path should be qualified with. A drive-qualified absolute Msh path. If or is null. Removes the provider qualifier from a provider-qualified MSH path The path to remove the provider qualifier from. The path without the provider qualifier. Generates a collection of containers and/or leaves that are children of the containers in the currentDirs parameter and match the glob expression in the parameter. A collection of paths that should be searched for leaves that match the expression. The drive the Msh path is relative to. A single element of a path that may or may not contain a glob expression. This parameter is used to search the containers in for children that match the glob expression. True if the is the last element to glob over. If false, we need to get all container names from the provider even if they don't match the filter. The provider associated with the paths that are being passed in the and parameters. The provider must derive from ContainerCmdletProvider or NavigationCmdletProvider in order to get globbing. The context the provider uses when performing the operation. A collection of fully qualified namespace paths whose leaf element matches the expression. If or is null. If the provider used to build the path threw an exception. If the provider that the represents is not a NavigationCmdletProvider or ContainerCmdletProvider. If the starts with "~" and the home location is not set for the provider. If the provider associated with the threw an exception when its GetParentPath or MakePath was called while processing the . If has been signaled for StopProcessing. Any exception can be thrown by the provider that is called to build the provider path. Generates an array of provider specific paths from the single provider specific path using globing rules. A path that may or may not contain globing characters. If true, a ItemNotFoundException will not be thrown for non-existing paths. Instead an appropriate path will be returned as if it did exist. The provider that implements the namespace for the path that we are globing over. The context the provider uses when performing the operation. An array of path strings that match the globing rules applied to the path parameter. First the path is checked to see if it contains any globing characters ('?' or '*'). If it doesn't then the path is returned as the only element in the array. If it does, GetParentPath and GetLeafPathName is called on the path and each element is stored until the path doesn't contain any globing characters. At that point GetChildPathNames() is called on the provider with the last parent path that doesn't contain a globing character. All the results are then matched against leaf element of that parent path (which did contain a glob character). We then walk out of the recursion and apply the same procedure to each leaf element that contained globing characters. The procedure above allows us to match globing strings in multiple sub-containers in the namespace without having to have knowledge of the namespace paths, or their syntax. Example: dir c:\foo\*\bar\*a??.cs Calling this method for the path above would return all files that end in 'a' and any other two characters followed by ".cs" in all the subdirectories of foo that have a bar subdirectory. If or is null. If the provider used to build the path threw an exception. If the starts with "~" and the home location is not set for the provider. or if the provider is implemented in such a way as to cause the globber to go into an infinite loop. If has been signaled for StopProcessing. Any exception can be thrown by the provider that is called to build the provider path. Generates a collection of containers and/or leaves that are children of the containers in the currentDirs parameter and match the glob expression in the parameter. A collection of paths that should be searched for leaves that match the expression. A single element of a path that may or may not contain a glob expression. This parameter is used to search the containers in for children that match the glob expression. True if the is the last element to glob over. If false, we need to get all container names from the provider even if they don't match the filter. The provider associated with the paths that are being passed in the and parameters. The provider must derive from ContainerCmdletProvider or NavigationCmdletProvider in order to get globbing. The context the provider uses when performing the operation. A collection of fully qualified namespace paths whose leaf element matches the expression. If or is null. If the provider used to build the path threw an exception. If the starts with "~" and the home location is not set for the provider. If has been signaled for StopProcessing. Any exception can be thrown by the provider that is called to build the provider path. Gets the child names in the specified path by using the provider The path of the directory to get the child names from. If this is an Msh Path, dirIsProviderPath must be false, If this is a provider-internal path, dirIsProviderPath must be true. The element that we are ultimately looking for. Used to set filters on the context if desired. Determines if the GetChildNames call should get all containers even if they don't match the filter. The context to be used for the command. The context is copied to a new context, the results are accumulated and then returned. Specifies whether the dir parameter is a provider-internal path (true) or Msh Path (false). The drive to use to qualify the Msh path if dirIsProviderPath is false. The provider to use to get the child names. Returns the modified dir path. If dirIsProviderPath is true, this is the unescaped dir path. If dirIsProviderPath is false, this is the unescaped resolved provider path. A collection of PSObjects whose BaseObject is a string that contains the name of the child. If or is null. If the path is a provider-qualified path for a provider that is not loaded into the system. If the refers to a drive that could not be found. If the provider used to build the path threw an exception. If the provider that the represents is not a NavigationCmdletProvider or ContainerCmdletProvider. If the starts with "~" and the home location is not set for the provider. If the provider associated with the threw an exception when its GetParentPath or MakePath was called while processing the . If has been signaled for StopProcessing. Any exception can be thrown by the provider that is called to build the provider path. Determines if the specified PSObject contains a string that matches the specified wildcard patterns. The PSObject that contains the child names. The glob matcher. The include matcher wildcard patterns. The exclude matcher wildcard patterns. The name of the child which was extracted from the childObject and used for the matches. True if the string in the childObject matches the stringMatcher and includeMatcher wildcard patterns, and does not match the exclude wildcard patterns. False otherwise. Converts a back tick '`' escape into back slash escape for all occurrences in the string. A string that may or may not have back ticks as escape characters. A string that has the back ticks replaced with back slashes except in the case where there are two back ticks in a row. In that case a single back tick is returned. The following rules apply to the conversion: 1. All \ characters are expanded to be \\ 2. Any ` not followed by a ` is converted to a \ 3. Any ` that is followed by a ` collapses the two into a single ` 4. Any other character is immediately appended to the result. If is null. Determines if the path is relative to a provider home based on the ~ character. The path to determine if it is a home path. True if the path contains a ~ at the beginning of the path or immediately following a provider designator ("provider::") Is is null. Determines if the specified path looks like a remote path. (starts with // or \\. The path to check to determine if it is a remote path. True if the path starts with // or \\, or false otherwise. If is null. Generates the path for the home location for a provider when given a path starting with ~ or "provider:~" followed by a relative path. The path to generate into a home path. The path representing the path to the home location for a provider. This may be either a fully qualified provider path or a PowerShell path. If is null. If is a provider-qualified path and the specified provider does not exist. If the provider throws an exception when its MakePath gets called. If the provider does not support multiple items. If the home location for the provider is not set and starts with a "~". The base class for a Cmdlet provider that expose a hierarchy of items and containers. The NavigationCmdletProvider class is a base class that provider can derive from to implement a set of methods that allow the use of a set of core commands against the data store that the provider gives access to. By implementing this interface users can take advantage the recursive commands, nested containers, and relative paths. Internal wrapper for the MakePath protected method. It is called instead of the protected method that is overridden by derived classes so that the context of the command can be set. The parent segment of a path to be joined with the child. The child segment of a path to be joined with the parent. The context under which this method is being called. A string that represents the parent and child segments of the path joined by a path separator. This method should use lexical joining of two path segments with a path separator character. It should not validate the path as a legal fully qualified path in the provider namespace as each parameter could be only partial segments of a path and joined they may not generate a fully qualified path. Example: the file system provider may get "windows\system32" as the parent parameter and "foo.dll" as the child parameter. The method should join these with the "\" separator and return "windows\system32\foo.dll". Note that the returned path is not a fully qualified file system path. Also beware that the path segments may contain characters that are illegal in the provider namespace. These characters are most likely being used for globbing and should not be removed by the implementation of this method. Internal wrapper for the GetParentPath protected method. It is called instead of the protected method that is overridden by derived classes so that the context of the command can be set. A fully qualified provider specific path to an item. The item may or may not exist. The fully qualified path to the root of a drive. This parameter may be null or empty if a mounted drive is not in use for this operation. If this parameter is not null or empty the result of the method should not be a path to a container that is a parent or in a different tree than the root. The context under which this method is being called. The path of the parent of the path parameter. This should be a lexical splitting of the path on the path separator character for the provider namespace. For example, the file system provider should look for the last "\" and return everything to the left of the "\". Internal wrapper for the NormalizeRelativePath method. It is called instead of the protected method that is overridden by derived classes so that the context of the command can be set. A fully qualified provider specific path to an item. The item should exist or the provider should write out an error. The path that the return value should be relative to. The context under which this method is being called. A normalized path that is relative to the basePath that was passed. The provider should parse the path parameter, normalize the path, and then return the normalized path relative to the basePath. This method does not have to be purely syntactical parsing of the path. It is encouraged that the provider actually use the path to lookup in its store and create a relative path that matches the casing, and standardized path syntax. Internal wrapper for the GetChildName protected method. It is called instead of the protected method that is overridden by derived classes so that the context of the command can be set. The fully qualified path to the item The leaf element in the path. The context under which this method is being called. This should be implemented as a split on the path separator. The characters in the fullPath may not be legal characters in the namespace but may be used in globing or regular expression matching. The provider should not error unless there are no path separators in the fully qualified path. Internal wrapper for the IsItemContainer protected method. It is called instead of the protected method that is overridden by derived classes so that the context of the command can be set. The path to the item to determine if it is a container. The context under which this method is being called. true if the item specified by path is a container, false otherwise. Internal wrapper for the MoveItem protected method. It is called instead of the protected method that is overridden by derived classes so that the context of the command can be set. The path to the item to be moved. The path of the destination container. The context under which this method is being called. Nothing. All objects that are moved should be written to the WriteObject method. Gives the provider to attach additional parameters to the move-item cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. The path of the destination container. The context under which this method is being called. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. Joins two strings with a path a provider specific path separator. The parent segment of a path to be joined with the child. The child segment of a path to be joined with the parent. A string that represents the parent and child segments of the path joined by a path separator. This method should use lexical joining of two path segments with a path separator character. It should not validate the path as a legal fully qualified path in the provider namespace as each parameter could be only partial segments of a path and joined they may not generate a fully qualified path. Example: the file system provider may get "windows\system32" as the parent parameter and "foo.dll" as the child parameter. The method should join these with the "\" separator and return "windows\system32\foo.dll". Note that the returned path is not a fully qualified file system path. Also beware that the path segments may contain characters that are illegal in the provider namespace. These characters are most likely being used for globbing and should not be removed by the implementation of this method. Removes the child segment of a path and returns the remaining parent portion. A fully qualified provider specific path to an item. The item may or may not exist. The fully qualified path to the root of a drive. This parameter may be null or empty if a mounted drive is not in use for this operation. If this parameter is not null or empty the result of the method should not be a path to a container that is a parent or in a different tree than the root. The path of the parent of the path parameter. This should be a lexical splitting of the path on the path separator character for the provider namespace. For example, the file system provider should look for the last "\" and return everything to the left of the "\". Normalizes the path that was passed in and returns the normalized path as a relative path to the basePath that was passed. A fully qualified provider specific path to an item. The item should exist or the provider should write out an error. The path that the return value should be relative to. A normalized path that is relative to the basePath that was passed. The provider should parse the path parameter, normalize the path, and then return the normalized path relative to the basePath. This method does not have to be purely syntactical parsing of the path. It is encouraged that the provider actually use the path to lookup in its store and create a relative path that matches the casing, and standardized path syntax. Note, the base class implemenation uses GetParentPath, GetChildName, and MakePath to normalize the path and then make it relative to basePath. All string comparisons are done using StringComparison.InvariantCultureIngoreCase. Get the common base path of two paths One path Another path Gets the name of the leaf element in the specified path. The fully qualified path to the item The leaf element in the path. This should be implemented as a split on the path separator. The characters in the fullPath may not be legal characters in the namespace but may be used in globing or regular expression matching. The provider should not error unless there are no path separators in the fully qualified path. Determines if the item specified by the path is a container. The path to the item to determine if it is a container. true if the item specified by path is a container, false otherwise. Providers override this method to give the user the ability to check to see if a provider object is a container using the test-path -container cmdlet. Providers that declare of ExpandWildcards, Filter, Include, or Exclude should ensure that the path passed meets those requirements by accessing the appropriate property from the base class. The default implementation of this method throws an . Moves the item specified by path to the specified destination. The path to the item to be moved. The path of the destination container. Nothing is returned, but all the objects that were moved should be written to the WriteItemObject method. Providers override this method to give the user the ability to move provider objects using the move-item cmdlet. Providers that declare of ExpandWildcards, Filter, Include, or Exclude should ensure that the path and items being moved meets those requirements by accessing the appropriate property from the base class. By default overrides of this method should not move objects over existing items unless the Force property is set to true. For instance, the FileSystem provider should not move c:\temp\foo.txt over c:\bar.txt if c:\bar.txt already exists unless the Force parameter is true. If exists and is a container then Force isn't required and should be moved into the container as a child. The default implementation of this method throws an . Gives the provider an opportunity to attach additional parameters to the move-item cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. The path of the destination container. Overrides of this method should return an object that has properties and fields decorated with parsing attributes similar to a cmdlet class or a . The default implemenation returns null. (no additional parameters) Tokenizes the specified path onto a stack The path to tokenize. The base part of the path that should not be tokenized. A stack containing the tokenized path with leaf elements on the bottom of the stack and the most ancestoral parent at the top. Given the tokenized path, the relative pathing elements are removed. A stack containing path elements where the leaf most element is at the bottom of the stack and the most ancestoral parent is on the top. Generally this stack comes from TokenizePathToStack(). The path being normalized. Just used for error reporting. The base path to make the path relative to. Just used for error reporting. Determines whether to throw an exception on non-existing paths. A stack in reverse order with the path elements normalized and all relative pathing tokens removed. Pops each leaf element of the stack and uses MakePath to generate the relative path The stack containing the leaf elements of the path. A path that is made up of the leaf elements on the given stack. The elements on the stack start from the leaf element followed by its parent followed by its parent, etc. Each following element on the stack is the parent of the one before it. An object that represents a path. This is the internal mechanism to get the hidden drive. The drive associated with this PathInfo. Gets a string representing the MSH path. A string representing the MSH path. The constructor of the PathInfo object. The drive that contains the path The provider that contains the path. The path this object represents. The session state associated with the drive, provider, and path information. If , , , or is null. Gets the drive that contains the path. Gets the provider that contains the path. Gets the provider internal path for the PSPath that this PathInfo represents. The provider encountered an error when resolving the path. The path was a home relative path but the home path was not set for the provider. Gets the MSH path that this object represents. This interface needs to be implemented by providers that want users to see provider-specific help. Called by the help system to get provider-specific help from the provider. Name of command that the help is requested for. Full path to the current location of the user or the full path to the location of the property that the user needs help about. The MAML help XML that should be presented to the user. Declares a class as a Cmdlet provider. The class must be derived from System.Management.Automation.Provider.CmdletProvider to be recognized by the runspace. Constructor for the attribute. The provider name. An enumeration of the capabilities that the provider implements beyond the default capabilities that are required. If is null or empty. If contains any of the following characters: \ [ ] ? * : Gets the name of the provider. Gets the flags that represent the capabilities of the provider. This enumeration defines the capabilities that the provider implements. The provider does not add any additional capabilities beyond what the Monad engine provides. The provider does the inclusion filtering for those commands that take an Include parameter. The Monad engine should not try to do the filtering on behalf of this provider. Note, the provider should make every effort to filter in a way that is consistent with the Monad engine. This option is allowed because in many cases the provider can be much more efficient at filtering. The provider does the exclusion filtering for those commands that take an Exclude parameter. The Monad engine should not try to do the filtering on behalf of this provider. Note, the provider should make every effort to filter in a way that is consistent with the Monad engine. This option is allowed because in many cases the provider can be much more efficient at filtering. The provider can take a provider specific filter string. When this attribute is specified a provider specific filter can be passed from the Core Commands to the provider. This filter string is not interpretted in any way by the Monad engine. The provider does the wildcard matching for those commands that allow for it. The Monad engine should not try to do the wildcard matching on behalf of the provider when this flag is set. Note, the provider should make every effort to do the wildcard matching in a way that is consistent with the Monad engine. This option is allowed because in many cases wildcard matching cannot occur via the path name or because the provider can do the matching in a much more efficient manner. The provider supports ShouldProcess. When this capability is specified, the -Whatif and -Confirm parameters become available to the user when using this provider The provider supports credentials. When this capability is specified and the user passes credentials to the core cmdlets, those credentials will be passed to the provider. If the provider doesn't specify this capability and the user passes credentials, an exception is thrown. The provider supports transactions. When this capability is specified, PowerShell lets the provider participate in the current PowerShell transaction. The provider does not support this capability and the user attempts to apply a transaction to it, an exception is thrown. An object that represents a stack of paths. Constructor for the PathInfoStack class. The name of the stack. A stack object containing PathInfo objects If is null. If is null or empty. Gets the name of the stack Defines a drive that exposes a provider path to the user. A cmdlet provider may want to derive from this class to provide their own public members or to cache information related to the drive. For instance, if a drive is a connection to a remote machine and making that connection is expensive, then the provider may want keep a handle to the connection as a member of their derived class and use it when the provider is invoked. An instance of the PSTraceSource class used for trace output using "SessionState" as the category. This is the same category as the SessionState tracer class. The current working directory for the virtual drive as a relative path from Root The name of the virtual drive The provider information for the provider that implements the functionality for the drive. Sets the root of the drive. The root path to set for the drive. This method can only be called during drive creation. A NotSupportedException if this method is called outside of drive creation. If is null. If this method gets called any other time except during drive creation. The root of the virtual drive The description for this virtual drive The user name to use with this drive. This flag is used to determine if we should allow the drive root to be changed through the SetRoot method. Constructs a new instance of the PSDriveInfo using another PSDriveInfo as a template. An existing PSDriveInfo object that should be copied to this instance. A protected constructor that derived classes can call with an instance of this class. This allows for easy creation of derived PSDriveInfo objects which can be created in CmdletProvider's NewDrive method using the PSDriveInfo that is passed in. If is null. Constructs a drive that maps an MSH Path in the shell to a Cmdlet Provider. The name of the drive. The name of the provider which implements the functionality for the root path of the drive. The root path of the drive. For example, the root of a drive in the file system can be c:\windows\system32 The description for the drive. The credentials under which all operations on the drive should occur. If null, the current user credential is used. ArgumentNullException - if , , or is null. Constructs a drive that maps an MSH Path in the shell to a Cmdlet Provider. The name of the drive. The name of the provider which implements the functionality for the root path of the drive. The root path of the drive. For example, the root of a drive in the file system can be c:\windows\system32 The description for the drive. The credentials under which all operations on the drive should occur. If null, the current user credential is used. The network path of the drive. This field would be populted only if PSDriveInfo is targeting the network drive or else this filed is null for local drives. ArgumentNullException - if , , or is null. Constructs a drive that maps an MSH Path in the shell to a Cmdlet Provider. The name of the drive. The name of the provider which implements the functionality for the root path of the drive. The root path of the drive. For example, the root of a drive in the file system can be c:\windows\system32 The description for the drive. The credentials under which all operations on the drive should occur. If null, the current user credential is used. It indicates if the the created PSDrive would be persisted across PowerShell sessions. ArgumentNullException - if , , or is null. Gets the name of the drive as a string. Returns a String that is that name of the drive. Determines if the drive should be hidden from the user. Sets the name of the drive to a new name. The new name for the drive. This must be internal so that we allow the renaming of drives via the Core Command API but not through a reference to the drive object. More goes in to renaming a drive than just modifying the name in this class. If is null or empty. Sets the provider of the drive to a new provider. The new provider for the drive. This must be internal so that we allow the renaming of providers. All drives must be associated with the new provider name and can be changed using the Core Command API but not through a reference to the drive object. More goes in to renaming a provider than just modifying the provider in this class. If is null. Traces the virtual drive Compares this instance to the specified drive. A PSDriveInfo object to compare. A signed number indicating the relative values of this instance and object specified. Return Value: Less than zero Meaning: This instance is less than object. Return Value: Zero Meaning: This instance is equal to object. Return Value: Greater than zero Meaning: This instance is greater than object or object is a null reference. Compares this instance to the specified object. The object must be a PSDriveInfo. An object to compare. A signed number indicating the relative values of this instance and object specified. If is not a PSDriveInfo instance. Compares this instance to the specified object. An object to compare. True if the drive names are equal, false otherwise. Compares this instance to the specified object. An object to compare. True if the drive names are equal, false otherwise. Equality operator for the drive determines if the drives are equal by having the same name. The first object to compare to the second. The second object to compare to the first. True if the objects are PSDriveInfo objects and have the same name, false otherwise. Inequality operator for the drive determines if the drives are not equal by using the drive name. The first object to compare to the second. The second object to compare to the first. True if the PSDriveInfo objects do not have the same name, false otherwise. Compares the specified drives to determine if drive1 is less than drive2. The drive to determine if it is less than the other drive. The drive to compare drive1 against. True if the lexical comparison of drive1's name is less than drive2's name. Compares the specified drives to determine if drive1 is greater than drive2. The drive to determine if it is greater than the other drive. The drive to compare drive1 against. True if the lexical comparison of drive1's name is greater than drive2's name. Gets the hash code for this instance. The result of base.GetHashCode() Gets or sets the current working directory for the drive. Gets the name of the drive Gets the name of the provider that root path of the drive represents. Gets the root path of the drive. Gets or sets the description for the drive. Gets the credential to use with the drive. Determines if the root of the drive can be modified during drive creation through the SetRoot method. True if the drive is being created and the root can be modified through the SetRoot method. False otherwise. True if the drive was automounted by the system, false otherwise. True if the drive was automounted by the system, and then manually removed by the user. Gets or sets the Persist Switch parameter. If this switch parmter is set then the created PSDrive would be persisted across PowerShell sessions. Get or sets the value indicating if the created drive is a network drive. Gets or sets the UNC path of the drive. This property would be populated only if the cereated PSDrive is targeting a network drive or else this property would be null. Gets or sets the hidden property. The hidden property determines if the drive should be hidden from the user. True if the drive should be hidden from the user, false otherwise. Information about a loaded Cmdlet Provider A cmdlet provider may want to derive from this class to provide their own public members to expose to the user or to cache information related to the provider. The instance of session state the provider belongs to. A hidden drive for the provider that is used for setting the location to a provider-qualified path. Gets the string representation of the instance which is the name of the provider. The name of the provider. If single-shell, the name is pssnapin-qualified. If custom-shell, the name is just the provider name. Constructs an instance of the class using an existing reference as a template. The provider information to copy to this instance. This constructor should be used by derived types to easily copying the base class members from an existing ProviderInfo. This is designed for use by a during calls to their method. If is null. Constructor for the ProviderInfo class. The instance of session state that the provider is being added to. The type that implements the provider The name of the provider. The help file for the provider. The Snap-In name for the provider. If is null or empty. If is null. If is null. Constructor for the ProviderInfo class. The instance of session state that the provider is being added to. The type that implements the provider The alternate name to use for the provider instead of the one specified in the .cmdletprovider file. The description of the provider. The home path for the provider. This must be an MSH path. The help file for the provider. The Snap-In for the provider. If or is null. If is null or empty. Determines if the passed in name is either the fully-qualified pssnapin name or short name of the provider. The name to compare with the provider name. True if the name is the fully-qualified pssnapin name or the short name of the provider. Creates an instance of the provider An instance of the provider or null if one could not be created. If an instance of the provider could not be created because the type could not be found in the assembly. Get the output types specified on this provider for the cmdlet requested. Gets the System.Type of the class that implements the provider. Gets the help file path for the provider. Gets the name of the provider. Gets the full name of the provider including the pssnapin name if available Gets the Snap-in in which the provider is implemented. Gets the pssnapin name that the provider is implemented in. Get the name of the module exporting this provider. Gets the module the defined this provider. Gets or sets the description for the provider Gets the capabilies that are implemented by the provider. Gets or sets the home for the provider. The location can be either a fully qualified provider path or an Msh path. This is the location that is substituted for the ~. Gets an enumeration of drives that are available for this provider. Gets the hidden drive for the provider that is used for setting a location to a provider-qualified path. Define the various unicode special characters that the parser has to deal with. Canonicalize the quote charater - map all of the aliases for " or ' into their ascii equivalent. The character to map The mapped character. Implements the exit keyword. Used by InternalHost.ExitNestedPrompt() to pop out of an interpreter level... Used by the debugger to terminate the execution of the current command. Used by Select-Object cmdlet to stop all the upstream cmdlets, but continue executing downstream cmdlets. The semantics of stopping is intended to mimic a user pressing Ctrl-C [but which only affects upstream cmdlets]. A enum corresponding to the options on the -split operator. Use simple string comparison when evaluting the delimiter. Cannot be used with RegexMatch. Use regular expression matching to evaluate the delimiter. This is the default behavior. Cannot be used with SimpleMatch. CultureInvariant: Ignores cultural differences in language when evaluting the delimiter. Valid only with RegexMatch. Ignores unescaped whitespace and comments marked with #. Valid only with RegexMatch. Regex multiline mode, which recognizes the start and end of lines, as well as the start and end of strings. Valid only with RegexMatch. Singleline is the default. Regex Singleline mode, which recognizes only the start and end of strings. Valid only with RegexMatch. Singleline is the default. Forces case-insensitive matching, even if -cSplit is specified. Ignores non-named match groups, so that only explicit capture groups are returned in the result list. A static class holding various operations specific to the msh interpreter such as various math operations, ToString() and a routine to extract the base object from an PSObject in a canonical fashion. Construct the various caching structures used by the runtime routines... Convert an object into an int, avoiding boxing small integers... The int to convert The reference equivalent A helper routine that turns the argument object into an integer. It handles PSObject and conversions. The position to use for error reporting. The result could not be represented as an integer This is a helper function for converting an object to a particular type. It will throw exception with information about token representing the object. private method used to call the op_* operations for the math operators left operand right operand name of the operation method to perform The position to use for error reporting. the string to use in error messages representing the op The result of the operation An error occurred performing the operation, see inner exception Implementation of the PowerShell unary -join operator... The execution context to use The position to use for error reporting. left operand The result of the operator Implementation of the PowerShell binary -join operator The execution context to use The position to use for error reporting. left operand right operand The result of the operator The implementation of the PowerShell -replace operator.... The execution context in which to evaluate the expression The position to use for error reporting. The object on which to replace the values The replacement description. True for -ireplace/-replace, false for -creplace The result of the operator Implementation of the PowerShell type operators... The execution context to use The position to use for error reporting. left operand right operand The result of the operator Implementation of the PowerShell type operators... The execution context to use The position to use for error reporting. left operand right operand The result of the operator Implementation of the PowerShell -like operator The execution context to use The position to use for error reporting. left operand right operand ignore case? true for -notlike, false for -like The result of the operator Implementation of the PowerShell -match operator The execution context to use The position to use for error reporting. left operand right operand ignore case? true for -notmatch, false for -match The result of the operator Implementation of the PowerShell -contains/-notcontains operators (and case sensitive variants) The execution context to use The position to use for error reporting. left operand right operand ignore case? true for -contains, false for -notcontains The result of the operator Cache regular expressions... The string to find the pattern for The options used to create the regex... A case-insensitive Regex... A routine used to advance an enumerator and catch errors that might occur performing the operation The execution context used to see if the pipeline is stopping The position to use for error reporting. THe enumerator to advance. An error occurred moving to the next element in the enumeration True if the move succeeded Wrapper caller for enumerator.MoveNext - handles and republishes errors... The position to use for error reporting. The enumerator to read from Retrieves the obj's type full name the object we want to retrieve the type's full name from The obj's type full name Launch a method on an object. This will handle .NET native methods, COM methods and ScriptBlock notes. Native methods currently take precidence over notes... The position to use for error reporting. The object to call the method on. It shouldn't be an msh object The name of the method to call Invocation constraints The arguments to pass to the method. Set to true if you want to call a static method. If not automation null, then this must be a settable propery Wraps the exception returned from the method call The maximum scope depth would be exceeded Internal exception from a flow control statement This is a simple enumerator class that just enumerates of a range of numbers. It's used in enumerating elements when the range operator .. is used. Create a new instance of an interpreter exception The target object for this exception. Type of exception to build The position to use for error reporting. ResourceID to look up template message, and also ErrorID Resource string that holds the error message Insertion parameters to message A new instance of the specified exception type Create a new instance of an interpreter exception The object associated with the problem Type of exception to build The position to use for error reporting. ResourceID to look up template message, and also ErrorID Resource string which holds the error message inner exception Insertion parameters to message New instance of an interpreter exception Create a new instance of an interpreter exception Type of exception to build The position to use for error reporting. Message ErrorID inner exception New instance of ParseException An object representing a pre-compiled block of powershell script. This class track a block of script in a compiled form. It is also used for direct invocation of the script block. 1. Overview Script block comes in two forms, a. Full form (cmdlet form) This comes in following format { begin { statementlist; } process { statementlist; } end { statementlist; } } This form is used for running the script in a pipeline like a cmdlet. b. Simple form This comes in following format { statementlist; } 2. Script block execution For the full form (or cmdlet form) of script block, the script block itself is part of a pipeline. Its execution is handled through ScriptCommandProcessor, which involves execution of begin/process/end blocks like a cmdlet. If a scriptblock in simple form is used in a pipeline, its execution is done through ScriptCommandProcessor also, with some of begin/process/end blocks default to be empty. A script block in simple form can be directly invoked (outside of a pipeline context). For example, {"text"}.Invoke() A scriptblock can be directly invoked internally or externally through runspace API. This class will handle the logic for direct invocation of script blocks. Create a script block object based on a script string to be parsed immediately. Engine context for this script block The string to compile. Create a script block based on a script to be parsed when execution context is provided. The string to compile. Returns a new scriptblock bound to a module. Any local variables in the callers context will be copied into the module. Returns PowerShell object representing the pipeline contained in this ScriptBlock Some ScriptBlocks are too complicated to be converted into a PowerShell object. For those ScriptBlocks a is thrown. ScriptBlock cannot be converted into a PowerShell object if - It contains more than one statement - It references variables undeclared in param(...) block - It uses redirection to a file - It uses dot sourcing - Command names can't be resolved (i.e. if an element of a pipeline is another scriptblock) Declaration of variables in a param(...) block is enforced, because undeclared variables are assumed to be variables from a remoting server. Since we need to fully evaluate parameters of commands of a PowerShell object's we reject all variables references that refer to a variable from a remoting server. arguments for the ScriptBlock (providing values for variables used within the ScriptBlock); can be null PowerShell object representing the pipeline contained in this ScriptBlock Thrown when this ScriptBlock cannot be expressed as a PowerShell object. For example thrown when there is more than one statement, if there are undeclared variables, if redirection to a file is used. Thrown when evaluation of command arguments results in an exception. Might depend on the value of $errorActionPreference variable. For example trying to translate the following ScriptBlock will result in this exception: $errorActionPreference = "stop"; $sb = { get-foo $( throw ) }; $sb.GetPowerShell() Thrown when there is no ExecutionContext associated with this ScriptBlock object. Returns PowerShell object representing the pipeline contained in this ScriptBlock, using variables supplied in the dictionary. variables to be supplied as context to the ScriptBlock (providing values for variables explicitly requested by the 'using:' prefix. arguments for the ScriptBlock (providing values for variables used within the ScriptBlock); can be null PowerShell object representing the pipeline contained in this ScriptBlock Thrown when this ScriptBlock cannot be expressed as a PowerShell object. For example thrown when there is more than one statement, if there are undeclared variables, if redirection to a file is used. Thrown when evaluation of command arguments results in an exception. Might depend on the value of $errorActionPreference variable. For example trying to translate the following ScriptBlock will result in this exception: $errorActionPreference = "stop"; $sb = { get-foo $( throw ) }; $sb.GetPowerShell() Thrown when there is no ExecutionContext associated with this ScriptBlock object and no variables are supplied. Returns PowerShell object representing the pipeline contained in this ScriptBlock, using variables supplied in the dictionary. variables to be supplied as context to the ScriptBlock (providing values for variables explicitly requested by the 'using:' prefix. key-value pairs from the variables that actually get used by the 'using:' prefix variables arguments for the ScriptBlock (providing values for variables used within the ScriptBlock); can be null PowerShell object representing the pipeline contained in this ScriptBlock Thrown when this ScriptBlock cannot be expressed as a PowerShell object. For example thrown when there is more than one statement, if there are undeclared variables, if redirection to a file is used. Thrown when evaluation of command arguments results in an exception. Might depend on the value of $errorActionPreference variable. For example trying to translate the following ScriptBlock will result in this exception: $errorActionPreference = "stop"; $sb = { get-foo $( throw ) }; $sb.GetPowerShell() Thrown when there is no ExecutionContext associated with this ScriptBlock object and no variables are supplied. Get a steppable pipeline object. A steppable pipeline object Get a steppable pipeline object. A steppable pipeline object Execute this node with the specified arguments. The arguments show up in the script as $args with $_ being the first argument. The arguments to this script. The object(s) generated during the execution of the script block returned as a collection of PSObjects Thrown if the maximum scope depth has been exceeded Thrown if a script runtime exceptionexception occurred An internal (non-public) exception from a flow control statement Execute this node with the specified arguments. The arguments show up in the script as $args. This overload return the raw (unwrapped) result so it can be more efficient. The arguments to pass to this scriptblock. The object(s) generated during the execution of the script block. They may or may not be wrapped in PSObject. It's up to the caller to check. Thrown if the maximum scope depth has been exceeded Thrown if a script runtime exceptionexception occurred An internal (non-public) exception from a flow control statement This is a helper function to process script invocation result. This does normal array reduction in the case of a one-element array. Get the delegate method as a call back. Returns the current execution context from TLS, or raises an exception if it is null. An attempt was made to use the scriptblock outside the engine Execute this node with the specified arguments. The arguments show up in the script as $args with $_ being the first argument. The value of the $_ variable for the script block. If AutomationNull.Value, the $_ variable is not created. The value of the $input variable for the script block. If AutomationNull.Value, the $input variable is not created. The arguments to this script. The object(s) generated during the execution of the script block returned as a collection of PSObjects The maximum scope depth would be exceeded A script exception occurred Internal exception from a flow control statement This is a helper function to wrap script execution results in PSObjects. Execute this node with the specified arguments. The arguments show up in the script as $args with $_ being the first argument. The value of the $_ variable for the script block. If AutomationNull.Value, the $_ variable is not created. The value of the $input variable for the script block. If AutomationNull.Value, the $input variable is not created. The arguments to this script. The object(s) generated during the execution of the script block returned as a collection of PSObjects The maximum scope depth would be exceeded A script exception occurred Internal exception from a flow control statement Handles OnScriptBlockInvoke event, this is called by the event manager Protected constructor to support ISerializable. Returns the text of the script block. The return value might not match the original text exactly. Support for . Check the script block to see if it uses any language constructs not allowed in restricted language mode. The commands that are allowed. The variables allowed in this scriptblock. If this is null, then the default variable set will be allowed. If it is an empty list, no variables will be allowed. If it is "*" then any variable will be allowed. The environment variables that are allowed. Return all attributes on a script block. The script file that defined this script block... Get/set whether this scriptblock is a filter. Get the PSModuleInfo object for the module that defined this scriptblock. Return the PSToken object for this function definition... The internal session state object associated with this scriptblock... The session state instance that should be used when evaluating this scriptblock. Returns the AST corresponding to the script block. A steppable pipeline wrapper object... Begin execution of a steppable pipeline. This overload doesn't reroute output and error pipes. true if you plan to write input into this pipe; false otherwise Begin execution of a steppable pipeline, using the command running currently in the specified context to figure out how to route the output and errors. true if you plan to write input into this pipe; false otherwise context used to figure out how to route the output and errors. Begin execution of a steppable pipeline, using the calling command to figure out how to route the output and errors. This is the most effective way to start stepping. The command you're calling this from (i.e. instance of PSCmdlet or value of $PSCmdlet variable) Process a single input object. The object to process a collection of 0 or more result objects Process a single PSObject. This overload exists to deal with the fact that the PowerShell runtime will PSBase an object before passing it to a .NET API call with argument type object. The input object to process Process with no input. This is used in the case where Begin() was called with $false so we won't send any input to be processed. The result of the execution End the execution of this steppable pipeline. This will complete the execution and dispose the results. IDisposable implementation When this object is disposed, the contained pipeline should also be disposed. Finalizer for class SteppablePipeline Defines the exception thrown when conversion from ScriptBlock to PowerShell is forbidden (i.e. when the script block has undeclared variables or more than one statement) Initializes a new instance of ScriptBlockToPowerShellNotSupportedException with the message set to typeof(ScriptBlockToPowerShellNotSupportedException).FullName Initializes a new instance of ScriptBlockToPowerShellNotSupportedException setting the message the exception's message Initializes a new instance of ScriptBlockToPowerShellNotSupportedException setting the message and innerException the exception's message the exceptions's inner exception Recommended constructor for the class String that uniquelly identifies each thrown Exception The inner exception The error message Arguments to the resource string Initializes a new instance of ScriptBlockToPowerShellNotSupportedException with serialization parameters serialization information streaming context Defines Event arguments passed to OnScriptBlockInvocationEventHandler Constructs ScriptBlockInvocationEventArgs The scriptblock to invoke /// The value of the $_ variable for the script block. If AutomationNull.Value, the $_ variable is not created. The value of the $input variable for the script block. If AutomationNull.Value, the $input variable is not created. The output pipe which has the results of the invocation The information about current state of the runspace. The arguments to this script. scriptBlock is null Holds the exception thrown during scriptblock invocation. Implements a cmdlet that applies a script block to each element of the pipeline. Execute the begin scriptblock at the start of processing The maximum scope depth would be exceeded could not parse script see Pipeline.Invoke see Pipeline.Invoke Execute the processing script blocks on the current pipeline object which is passed as it's only parameter. The maximum scope depth would be exceeded could not parse script see Pipeline.Invoke see Pipeline.Invoke Do method invocation with arguments Get the string representation of the passed-in object Get the value by taking _propertyOrMethodName as the key, if the input object is a IDictionary. Unroll the object to be output. If it's of type IEnumerator, unroll and output it by calling WriteOutIEnumerator. If it's not, unroll and output it by calling WriteObject(obj, true) Unroll an IEnumerator and output all entries. Check if the language mode is the restrictedLanguageMode before invoking a method. Write out error message and return true if we are in restrictedLanguageMode. Generate the appropriate error record Execute the end scriptblock when the pipeline is complete The maximum scope depth would be exceeded could not parse script see Pipeline.Invoke see Pipeline.Invoke This parameter specifies the current pipeline object The script block to apply in begin processing The script block to apply The script block to apply in complete processing The remaining script blocks to apply The property or method name The arguments passed to a method invocation Implements a cmdlet that applys a script block to each element of the pipeline. If the result of that application is true, then the current pipeline object is passed on, otherwise it is dropped. Execute the script block passing in the current pipeline object as it's only parameter. The maximum scope depth would be exceeded could not parse script see Pipeline.Invoke see Pipeline.Invoke Get the value based on the given property name the value of the property Get the matched PSMembers This parameter specifies the current pipeline object The script block to apply The property to retrieve value The value to compare against Binary operator -Equal It's the default parameter set, so -EQ is not mandatory. Case sensitive binary operator -ceq Binary operator -NotEqual Case sensitive binary operator -cne Binary operator -GreaterThan Case sensitive binary operator -cgt Binary operator -LessThan Case sensitive binary operator -clt Binary operator -GreaterOrEqual Case sensitive binary operator -cge Binary operator -LessOrEqual Case sensitive binary operator -cle Binary operator -Like Case sensitive binary operator -clike Binary operator -NotLike Case sensitive binary operator -cnotlike Binary operator -Match Case sensitive binary operator -cmatch Binary operator -NotMatch Case sensitive binary operator -cnotmatch Binary operator -Contains Case sensitive binary operator -ccontains Binary operator -NotContains Case sensitive binary operator -cnotcontains Binary operator -In Case sensitive binary operator -cin Binary operator -NotIn Case sensitive binary operator -cnotin Binary operator -Is Binary operator -IsNot Implements a cmdlet that sets the script debugging options. Execute the begin scriptblock at the start of processing Sets the script tracing level Turns stepping on and off Turns strict mode on and off. Turns all script debugging features off. Set-StrictMode causes the interpreter to throw an exception in the following cases: * Referencing an unassigned variable * Referencing a non-existent property of an object * Calling a function as a method (with parentheses and commas) * Using the variable expansion syntax in a string literal w/o naming a variable, i.e. "${}" Parameters: -Version allows the script author to specify which strict mode version to enforce. -Off turns strict mode off Note: Unlike Set-PSDebug -strict, Set-StrictMode is not engine-wide, and only affects the scope it was defined in. Set the correct version for strict mode checking in the current scope. The following is the definition of the input parameter "Off". Turns strict mode off The following is the definition of the input parameter "Version". Turns strict mode in the current scope. To make it easier to specify a version, we add some conversions that wouldn't happen otherwise: * A simple integer, i.e. 2 * A string without a dot, i.e. "2" * The string 'latest', which we interpret to be the current version of PowerShell. PSParser class This is a class providing the interface for parsing a script into a collection of tokens, which primarily can be used for syntax colorization. Classes provided for syntax colorization includes, 1. PSParser: this class provides the main interface to be used. 2. PSToken: this class provides a public representation of powershell tokens. 3. PSParseError: this class provides a public representation of syntax errors. These three classes are provided for exposing interfaces only. They should not be used in PowerShell engine code. Constructor This constructor is made private intentionally. The only way to create an instance of PSParser object is from PSParser pool maintained in this class. Parse a script into a collection of tokens. script to parse errors happened during parsing collection of tokens generated during parsing Although this API returns most parse-time exceptions in the errors collection, there are some scenarios where resource limits will result in an exception being thrown by this API. This allows the caller to distinguish between a successful parse with errors and a failed parse. All exceptions thrown will be derived from System.Mnagement.Automation.RuntimeException but may contain an inner exception that describes the real issue. Parse a script into a collection of tokens. script to parse, as an array of lines errors happened during parsing collection of tokens generated during parsing Although this API returns most parse-time exceptions in the errors collection, there are some scenarios where resource limits will result in an exception being thrown by this API. This allows the caller to distinguish between a successful parse with errors and a failed parse. All exceptions thrown will be derived from System.Mnagement.Automation.RuntimeException but may contain an inner exception that describes the real issue. Return collection of tokens generated for recent parsing task. Return collection of errors happened for recent parsing task. This is public class for representing a powershell token. There is already an internal class Token for representing the token. This class wraps the internal Token class for providing limited information to syntax editor. Map a V3 token to a V2 PSTokenType The V3 token The V2 PSTokenType Resulting text for the token. The text here represents the content of token. It can be the same as the text chunk within script resulting into this token, but usually is not the case. For example, -name in following command result into a parameter token. get-process -name foo Text property in this case is 'name' instead of '-name'. Token type. Offset of token start in script buffer. Offset of token end in script buffer. Line number of token start. StartLine, StartColumn, EndLine, and EndColumn are 1-based, i.e., first line has a line number 1 and first character in a line has column number 1. Position of token start in start line. Line number of token end. Position of token end in end line. PowerShell token types. Unknown token Command For example, 'get-process' in get-process -name foo Command Parameter For example, '-name' in get-process -name foo Command Argument For example, 'foo' in get-process -name foo Number For example, 12 in $a=12 String For example, "12" in $a="12" Variable For example, $a in $a="12" Property name or method name For example, Name in $a.Name Loop label For example, :loop in :loop foreach($a in $b) { $a } Attributes For example, Mandatory in param([Mandatory] $a) Types For example, [string] in $a = [string] 12 Operators For example, + in $a = 1 + 2 Group Starter For example, { in if ($a -gt 4) { $a++; } Group Ender For example, } in if ($a -gt 4) { $a++; } Keyword For example, if in if ($a -gt 4) { $a++; } Comment For example, #here in #here if ($a -gt 4) { $a++; } Statement separator. This is ';' For example, ; in #here if ($a -gt 4) { $a++; } New line. This is '\n' For example, \n in #here if ($a -gt 4) { $a++; } Line continuation For example, ` in get-command -name ` foo Position token Position token are bogus tokens generated for identifying a location in the script. This is a class that represents a syntax error from parsing. The token that indicates the error location. This can either be the real token at which place the error happens or a position token indicating the location where error happens. Error message. normalized parameter class to be constructed from the command line parameters using the metadata information provided by an instance of CommandParameterDefinition it's basically the hash table with the normalized values metadata base class for hashtable entry definitions it contains the key name and the allowable types it also provides hooks for type expansion metadata abstract base class to contain hash entries definitions for a key name, verify it is a legal entry: 1. it must match (partial match allowed) 2. it must be unambiguous (if partial match) If an error condition occurs, an exception will be thrown key to verify invocation context for error reporting matching hash table entry engine to process a generic object[] from the command line and generate a list of MshParameter objects , given the metadata provided by a class derived from CommandParameterDefinition helper class to hold a resolved expression and its originating parameter Helper method to handle PSComputerName and PSShowComputerName properties from the formating objects. If PSShowComputerName exists and is false, removes PSComputerName from the display. PSShowComputerName is an internal property..so this property is always removed from the display. internal class to manage the grouping algorithm for the format-xxx commands Initalize with the grouping property data name of the grouping porperty dispaly name of the property compute the string value of the grouping property object to use to compute the property value true if there was an update value of the display label passed in. value of the current active grouping key name of the current grouping key the current value of the grouping key base class for the various types of formatting shapes Let the view prepare itself for RemoteObjects. Specific view generators can use this call to customize display for remote objects like showing/hiding computername property etc. update the current value of the grouping key object to use for the update true if the value of the key changed class to process a complex control directive and generate the corresponding formatting tokens class to generate a complex view from properties given an object, generate a tree-like view of the object object to process parameters from the command line complex view entry to send to the output command recursive call to display an object object to display current level in the traversal list of parameters from the command line list of format tokens to add to recursive call to display an object enumeration to display current level in the traversal list of format tokens to add to display a leaf value object to display list of format tokens to add to determine if we have to stop the expansion object to verify current level of recursion treat as scalar check name of the type to check true if it has to be treated as a scalar identation added to each level in the recursion Let the view prepare itself for RemoteObjects. This will add "ComputerName" to the table columns. Let the view prepare itself for RemoteObjects. This will add "ComputerName" to the table columns. Method to filter resolved expressions as per table view needs. For v1.0, table view supports only 10 properties. This method filters and updates "activeAssociationList" instance property. None. This method updates "activeAssociationList" instance property. class to manage the selection of a desired view type and manage state associated to the selected view Prepares a given view for remote object processing ie., lets the view display (or not) ComputerName property. This will query the object to check if ComputerName property is present. If present, this will prepare the view. Helper method to process Unknown error message. It helps is creating appropriate error message to be displayed to the user. Error context. Uses supplied view name. Source object. Types info database. Requested format shape. the view generator that produced data for a selected shape class to manage the selection of a desired view type for out of band objects Helper class to manage the logging of errors resulting from evaluations of MshExpression instances Depending on settings, it queues the failing MshExpressionResult instances and generates a list of out-of-band FormatEntryData objects to be sent to the output pipeline log a failed evaluation of an MshExpression MshExpressionResult containing the failed evaluation data object used to evaluate the MshExpression log a failed formatting operation string format error object provide a list of ErrorRecord entries to be written to the error pipeline and clear the list of pending errors list of ErrorRecord objects Conversion between an error internal representation and ErrorRecord internal error object corresponding ErrorRecord instance current list of failed MsExpression evaluations Helper class for writing formatting directives to XML Writes a collection of format view definitions to XML file collection of PSTypeDefinition path to XML file cmdlet from which this si used true - to force write the file true - to export scripblocks true - do not overwrite the file true - bypass wildcard expansion on the file name It holds the command line parameter values It unifies the data structures across the various formatting command (e.g. table, wide and list) MshParameter collection, as specified by metadata the list can be empty of no data is specified name of the group by property, it can be null name of a view from format.ps1xml, it can be null flag to force a shape even on out of band objects autosize formatting flag. If true, the output command is instructed to get the "best fit" for the device screen errors are shown as out of band messages errors are shown in the formatted output expand IEnumerable flag. extension mechanism for shape specific parameters class to derive from to pass shepe specific data max depth of recursion on sub objects options for class info display on objects specialized class for the "expression" property definitions for hash table keys Base class defining the formatting context and the formatting context manager (stack based) implementation class to be called by the outer command In order to properly work, the callbacks have to be properly set by the outer command inner version of CommandBase.BeginProcessing() inner version of CommandBase.ProcessRecord() inner version of CommandBase.EndProcessing() inner version of CommandBase.StopProcessing() retrieve the current input pipeline object write an object to the pipeline object to write to the pipeline get a hold of the Monad outer Cmdlet callback to get to the outer command-let callback to read object callback to write object default implementation just delegates to internal helper This method calls GC.SuppressFinalize Do-nothing implementation: derived classes will override as see fit delegate definition to get to the outer command-let delegate definition to get to the current pipeline input object delegate definition to write object constructor to set up the formatting context context manager: stack to keep track in which context the formatter is it provides context for the formatting engine construct an instance by passing the initial state of the context state to set the context to current state of the context enum listing the possible states the context is in core inner implementation for format/xxx commands constructor to glue to the CRO execution entry point execute formatting on a single object object to process compute the group transition, given an input object object receoved from the input pipeline GroupTransition enumeration write a payplad object by properly wrapping it into a FormatEntry object object to process inject the start group information and push group context on stack current pipeline object that is starting the group inject the end group information and pop group context out of stack the formatting shape this formatter emits group transitions: none: stay in the same group enter: start a new group exit: exit from the current group base class for the command-let's we expose it contains a reference to the implementation class it wraps hook up the calls from the implementation object and then call the implementation's Begin() call the implementation call the implementation call the implementation callback for the implementation to obtain a reference to the Cmdlet object Cmdlet reference callback for the implementation to get the current pipeline object current object from the pipeline callback for the implementation to write objects object to be written reference to the implementation command that this class is wrapping default implementation just delegates to internal helper This method calls GC.SuppressFinalize Dispose pattern implementation Do-nothing implementation: derived classes will override as see fit This parameter specifies the current pipeline object it reads the command line switches and collects them into a FormattingCommandLineParameters instance, ready to pass to the inner format command parameters collected in unified manner optional, non positional parameter to specify the group by property optional, non positional parameter optional, non positional parameter optional, non positional parameter optional, non positional parameter optional, non positional parameter Positional parameter for properties, property sets and table sets specified on the command line. The paramater is optional, since the defaults will be determined using property sets, etc. optional, non positional parameter optional, non positional parameter optional, non positional parameter implementation for the format-default command constructor to set the inner command class providing an algorithm for automatic resizing of table columns class providing an algorithm for automatic resizing overall width of the table in characters minimum usable column width number of separator characters calculate the widths by applying some heuristics to get them to fit on the allotted table width. It first assigns widths to the columns that do not have a specified width, then it checks if the total width exceeds the screen widths. If so, it proceeds with column elimination, starting from the right most column array of column widths to appropriately size do not remove columns, just assign widths to columns that have a zero width (meaning unassigned) columns to process true if there was a fit, false if there is need for trimming trim columns if the total column width is too much for the screen. column widths to trim computes the total table width from the column width array column widths array get the last visible column (i.e. with a width >= 0) column widths array index of the last visible column, -1 if none class to deserialize property bags into formatting objects by using ERS functionality expansion of TAB character to the following string given a raw object out of the pipeline, it deserializes it accordingly to its type. If the object is not one of the well known ones (i.e. derived from FormatInfoData) it just returns the object unchanged object to deserialize deserialized object or null Deserialization of string without TAB expansion (RAW) object whose the property belogs to name of the string property string out of the MsObject Deserialization of string performing TAB expansion object whose the property belogs to name of the string property string out of the MsObject base class from which all the formatting objects will derive from. It provides the mechanism to preserve type information. length of a classId string (a GUID with no {} or - name of the "get" property that allows access to CLSID information. This is needed by the ERS API's called by derived classes to set class information string containing a GUID string containing a GUID, to be set by each derived class "get" property to get CLSID information. It is named with a GUID like name to avoid potential collisions with properties of payload objects null by default, present only if grouping specified it needs to be either on FormatStartData or GroupStartData but not both or neither. number of objects to compute the best fit. Zero: all the objects a positive number N: use the first N sequence start: the very first message sent optional optional autosize formatting directive. If present, the output command is instructed to get the autosize "best fit" for the device screen according to the flags this object contains. generic entry containing payload data and related formatting info mandatory, but depending on the shape we send in it must match what got sent in the format start message Helper method to set the WriteStreamType proeprty based on note properties of a PSObject object. PSObject desired number of columns on the screen. Advisory, the outputter can decide otherwise A zero value signifies let the outputter get the best fit on the screen (possibily blocking until the end) width of the column: == 0 -> let the outputter decide > 0 -> user provided value optional information of frame data (indentation, etc.) queue to provide sliding window capabilities for auto size functionality It provides caching capabilities (either the first N objects in a group or all the objects in a group) create a grouping cache notification callback to be called when the desired number of objects is reached max number of objects to be cached add an object to the cache object to add objects the cache needs to return. It can be null remove a single object from the queue object retrieved, null if queue is empty queue to store the currently cached objects number of objects to compute the best fit. Zero: all the objects a positive number N: use the first N notification callback to be called when we have accumulated enough data to compute a hint reference kept to be used during notification state flag to signal we are queuing current object count facade class managing the front end and the autosize cache decide right away if we need a front end cache (e.g. printing) if true, create a front end cache object if needed, add a back end autosize (grouping) cache notification callback to be called when the desired number of objects is reached max number of objects to be cached add an object to the cache. the behavior depends on the object added, the objects already in the cache and the cache settings object to add list of objects the cache is flushing remove all the objects from the cache all the objects that were in the cache front end queue (if present, cache ALL, if not, bypass) back end grouping queue delegate to allow notifications when the autosize queue is about to be drained current Fs control message enumeration of PacketInfoData objects class to write object properties in list form by using the host screen interfaces minimum width for the property label field minimum width for the property value field labels already padded with blanks, separator characters, etc. display length of the property labels in the array (all the same length) column width of the screen names of the properties to display column width of the screen instance of the DisplayCells helper object write the values of the properties of an object array with the values in form of formatted strings LineOutput interface to write to helper, writing a single property to the screen. It wraps the value of the property if it is tool long to fit index of property to write string value of the property to write LineOutput interface to write to internal helper to split a line that is too long to fit and pad it to the left with a given string string to add to the left line to print LineOuput to write to set to true when the width of the screen is too small to do anything useful Initalize the table specifying the width of each column left margin indentation number of character columns on the screen array of specified column widths array of alignment flags if true, suppress header printing Information about each column boudaries Class containing information about the tabular layout INTERNAL IMPLEMENTATION CLASS It manages the finite state machine for the sequence of formatting messages. It achieves this by maintaning a stack of OutputContext-derived objects. A predefined set of events allows the host of this class to process the information as it comes trough the finite state machine (push model) IMPORTANT: The code using this class will have to provide ALL the callabacks. process an object from an input stream. It manages the context stack and calls back on the specified event delegates object to process internal stack to manage context access the active context (top of the stack). It can be null. The current output context, as determined by the sequence of formatting messages in the object stream parent context in the stack, it can be null the outer context: the context object pushed onto the stack before the current one. For the first object pushed onto the stack it will be null accessor for the parent context field OutCommand base implementation it manages the formatting protocol and it writes to a generic screen host execution entry point override we assume that a LineOutput interface instance already has been acquired IMPORTANT: it assumes the presence of a pre-processing formatting command toggle to signal if we are in a formatting sequence instance of a command wrapper to execute the default formatter when needed test if an object coming from the pipeline needs to be preprocessed by the default formatter object to examine for formatting whether the object needs to be shunted to preprocessing shunt object to the formatting pipeline for preprocessing object to be preprocessed array of objects returned by the preprocessing step class factory for output context parent context in the stack fromat info data received from the pipeline callback for Fs processing the context containing the Fs entry callback for Fe processing Fe notification message current context, with Fs in it callback for Gs processing the context containing the Gs entry callback for Ge processing Ge notification message current context, with Gs in it process the current payload object FormatEntryData to process currently active context the screen host associated with this outputter context manager instance to guide the message traversal handler for processing the caching notification and responsible for setting the value of the formatting hint variable holding the autosize hint (set by the caching code and reset by the hint consumer helper for consuming the formatting hint helper to return what shape we have to use to format the output retrieve the active FormatOutputContext on the stack by walking up to the top of the stack enum describing the state for the output finite state machine we are in the clear state: no formatting in process we received a Format Start message, but we are not inside a group we are inside a group because we received a Group Start enumeration to drive the preprocessing stage base class for all the formatting hints hint for format-table hint for format-wide context for the outer scope of the format sequence construct a context to push on the stack parent context in the stack format data to put in the context the active formatting message, as obtained from the stream retrieve the format data in the context context for the currently active group construct a context to push on the stack called at creation time, overrides will initialize here, e.g. column widths, etc. called when a group of data is started, overrided will do things such as headers, etc... called when the end of a group is reached, overrides will do things such as group footers called when there is an entry to process, overrides will do things such as writing a row in a table FormatEntryData to process OutCommandInner reference, for accessing context data the active formatting message, as obtained from the stream retrieve the format data in the context construct a context to push on the stack reference to the OutCommandInner instance who owns this instance parent context in the stack format data to put in the context helper class to properly write a table using text output Get the table writer for this context construct a context to push on the stack reference to the OutCommandInner instance who owns this instance parent context in the stack format data to put in the context initialize column widths write the headers write a row into the table FormatEntryData to process construct a context to push on the stack reference to the OutCommandInner instance who owns this instance parent context in the stack format data to put in the context initialize column widths write the headers write a row into the list FormatEntryData to process property list currently active writer to do the actual formatting construct a context to push on the stack reference to the OutCommandInner instance who owns this instance parent context in the stack format data to put in the context initialize column widths write the headers called when the end of a group is reached, flush the write buffer write a row into the table FormatEntryData to process helper class to accumulate the display values so that when the end of a line is reached, a full line can be composed construct the buffer number of entries to cache add an item to the buffer string to add reset the buffer get the size of the buffer get the current number of entries in the buffer check if the buffer is full check if the buffer is empty indexer to access the k-th item in the buffer construct a context to push on the stack reference to the OutCommandInner instance who owns this instance parent context in the stack format data to put in the context write a row into the list FormatEntryData to process implementation for the out-lineoutput command it provides a wrapper for the OutCommandInner class, which is the general purpose output command set inner command command line switch for ILineOutput comunication channel sequence end: the very last message sent group start: message marking the beginning of a group group end: message marking the end of a group writer class to handle Complex Object formatting initalization method to be called before any other operation LineOutput interfaces to write to number of columns used to write out Writes a string it interprets a list of format value tokens and outputs it list of FormatValue tokens to interpret operate on a single entry entry to process current depth of recursion add a string to the current buffer, waiting for a FlushBuffer() string to add to buffer write to the output interface helper object to manage the frame-based indentation and margins buffer to accumulate partially constructed text interface to write to nomber of columns for the output device Result of GetWords collection of helper functions for string formatting Breaks a string into a collection of words TODO: we might be able to improve this function in the future so that we do not break paths etc. input string a collection of words split a multiline string into an array of strings by honoring both \n and \r\n string to split string array with the values Base class providing support for string manipulation. This class is a tear off class provided by the LineOutput class Assumptions (in addition to the assumptions made for LineOutput): - characters map to one or more character cells NOTE: we provide a base class that is valid for devices that have a 1:1 mapping between a UNICODE character and a display cell Given a string and a number of display cells, it computes how many characters would fit starting from the beginning or end of the string string to be displayed offset inside the string number of display cells if true compute from the head (i.e. k++) else from the tail (i.e. k--) number of characters that would fit Specifies special stream write processing. Base class providing information about the screen device capabilities and used to write the output strings to the text output device. Each device supported will have to derive from it. Examples of supported devices are: * Screen Layout: it layers on top of Console and RawConsole * File: it layers on top of a TextWriter * In Memory text stream: it layers on top of an in memory buffer * Printer: it layers on top of a memory buffer then sent to a printer device Assumptions: - Fixed pitch font: layout done in terms of character cells - character cell layout not affected by bold, reverse screen, color, etc. - returned values might change from call to call if the specific underlying implementation allows window resizing if RequiresBuffering = true, this call will be made to start the playback Write a line to the output device. string to be written to the device handle the stop processing signal. Set a flag that will be checked during operations singleton used for the default implementation. NOTE: derived classes may chose to provide a different implementation by overriding whether the device requres full buffering of formatting objects before any processing The number of columns the current device has The number of rows the current device has return an instance of the display helper tear off delegate the implementor of ExecuteBufferPlayBack should call to cause the playback to happen when ready to execute helper class to provide line breaking (based on device width) and embedded newline processing It needs to be provided with two callabacks for line processing instance of the delegate previously defined for line that has EXACTLY this.ncols characters instance of the delegate previously defined for generic line, less that this.ncols characters construct an instance, given the two callbacks NOTE: if the underlying device treats the two cases as the same, the same delegate can be passed twice true if we require line wrapping delegate for WriteLine(), must ben non null delegate for Write(), if null, use the first parameter helper object for manipulating strings main entry point to process a line string to process width of the device internal helper, needed because it might make recursive calls to itself string to process width of the device delegate definition string to write Implementation of the ILineOutput interface accepting an instance of a TextWriter abstract class write a line by delegating to the writer underneath initialization of the object. It must be called before attempting any operation TextWriter to write to max columns widths for the text get the columns on the screen for files, it is settable at creation time get the # of rows on the screen: for files we return -1, meaning infinite TextWriter to generate data for the Monad pipeline in a streaming fashion: the provided callback will be called each time a line is written create an instance by passing a delegate delegate to write to culture for this TextWriter instance of the delegate previously defined delegate definition string to write inner command class used to manage the sub pipelines it determines which command should process the incoming objects based on the object type This class is the implementation class for out-console and out-file handler for processing each object coming through the pipeline it forwards the call to the pipeline manager object handler for processing shut down. It forwards the call to the pipeline manager object make sure we dispose of the sub pipeline manager instance of the pipeline manager object True if the cmdlet has been stopped Lock object object managing the sub-pipelines that execute different output commands (or different instances of the default one) Initialize the pipeline manager before any object is processed LineOutput to pass to the child pipelines ExecutionContext to pass to the child pipelines hard wired registration helper for specialized types ExecutionContext to pass to the child pipeline register the default output command ExecutionContext to pass to the child pipeline name of the command to execute Type of the command to execute process an incoming parent pipeline object pipeline object to process shut down the child pipelines it selects the applicable out command (it can be the default one) to process the current pipeline object pipeline object to be processed applicable command entry list of command entries, each with a set of applicable types default command entry to be executed when all type matches fail entry defining a command to be run in a separate pipeline instance of pipeline wrapper object ETS type name of the object to process true if there is a match just dispose of the inner command wrapper ordered list of ETS type names this object is handling facade class to provide context information to process exceptions helper class to invoke a command in a secondary pipeline. NOTE: this implementation does not return any error messages that invoked pipelines might generate Initialize the command before executing ExecutionContext used to create sub pipeline name of the command to run Type of the command to run add a parameter to the command invocation. It needs to be called before any execution takes place name of the parameter value of the parameter send an object to the pipeline object to process Array of objects out of the success pipeline shut down the pipeline Array of objects out of the success pipeline just dispose the pipeline processor Tear off class Implementation of the LineOutput interface on top of Console and RawConsole write a line to the output device line to write constructor for the ConsoleLineOutput PSHostUserInterface to wrap true if we require prompting for page breaks true if we require line wrapping error context to throw exceptions callback to be called when ILineOutput.WriteLine() is called by WriteLineHelper string to write callback to be called when ILineOutput.Write() is called by WriteLineHelper This is called when the WriteLineHelper needs to write a line whose length is the same as the width of the screen buffer string to write called when a line was written to console flag to force new lines in CMD.EXE by limiting the usable width to N-1 (e.g. 80-1) and forcing a call to WriteLine() use this if IRawConsole is null; use this if IRawConsole is null; handler to prompt the user for page breaks if this handler is not null, we have promting conter for the # of lines written when prompting is on flag to avoid renetrancy on promting refecence to the PSHostUserInterface interface we use Msh host specific string manipulation helper reference to error context to throw Msh exceptions the # of columns is just the width of the screen buffer (not the width of the window) the # of rows is the # of rows visible in the window (and not the # of rows in the screen buffer) check if we need to put out a prompt true if we need to promp object to manage prompting prompt handler with the given prompt prompt string to be used the Cmdlet using this prompt handler detemine how many rows the prompt should take. current number of colums on the screen string manipupation helper do the actual prompting PSHostUserInterface instance to prompt to cached string(s) valid during a sequence of ComputePromptLines()/PromptUser() prompt string as passed at initialization The cmdlet that uses this prompt helper options returned by the PromptUser() call Null sink to absorb pipeline output input PSObject Do nothing This parameter specifies the current pipeline object implementation for the out-default command this command it impicitely inject by the powershell.exe host at the end of the pipeline as the default sink (display to console screen) set inner command just hook up the LineOutput interface implementation for the out-host command non positional parameter to specify paging constructor of OutHostCommand just hook up the LineOutput interface optional, non positional parameter to specify paging FALSE: names only TRUE: full info GetValue is only called for pre/post increment/decrement or for read/modify/write assignment operators (+=, -=, etc.) It returns the expressions that holds the value of the ast. It may append the exprs or temps lists if the return value relies on temps and other expressions. SetValue is called to set the result of an assignment (=) or to write back the result of a pre/post increment/decrement. It needs to use potentially cached temps if GetValue was called first. The abstract base class for all PowerShell abstract syntax tree nodes. Initialize the common fields of an ast. The extent of the expression. If is null. Visit the Ast using a visitor that can choose how the tree traversal is performed. This visit method is for advanced uses of the visitor pattern where an is insufficient. The visitor Returns the value returned by the visitor. Visit each node in the Ast, calling the methods in for each node in the ast. The visitor Traverse the entire Ast, returning all nodes in the tree for which returns true. The predicate function. Search nested functions and script block expressions. A possibly empty collection of matching Ast nodes. Traverse the entire Ast, returning the first node in the tree for which returns true. The predicate Search nested functions and script block expressions. The first matching node, or null if there is no match. Formats the ast and returns a string. The extent in the source this ast represents. The parent tree for this node. A placeholder statement used when there are syntactic errors in the source script. An abstract base class for statements that include command invocations, pipelines, expressions, and assignements. Any statement that does not begin with a keyword is derives from PipelineBastAst. An abstract base class for any statement like an if statement or while statement. Initialize the common fields of a statement. The extent of the statement. If is null. Initialize the common parts of a PipelineBaseAst. The extent of the statement. If is null. If the pipeline represents a pure expression, the expression is returned, otherwise null is returned. Indicate the kind of the ErrorStatement. e.g. Kind == Switch means that this error statment is generated when parsing a switch statement. The flags specifid and their value. The value is null if it's not specified. e.g. switch -regex -file c:\demo.txt ---> regex -- null file -- { c:\demo.txt } TODO, Changing this to an IDictionary because ReadOnlyDictionary is available only in .NET 4.5 This is a temporary workaround and will be fixed later. Tracked by Win8: 354135 The conditions specified. The bodies specified. Sometimes a valid ast is parsed successfully within the extent that this error statement represents. Those asts are contained in this collection. This collection may contain other error asts. This collection may be null when no asts were successfully constructed within the extent of this error ast. A placeholder expression used when there are syntactic errors in the source script. An abstract base class that represents all PowerShell expressions. An abstract base class for the components of a . Initialize the common fields of a comment element. The extent of the command element. If is null. Initialize the fields common to all expressions. The extent of the expression. If is null. By default, the static type of an expression is unknown and hence we assume typeof(object). Sometimes a valid ast is parsed successfully within the extent that this error expression represents. Those asts are contained in this collection. This collection may contain other error asts. This collection may be null when no asts were successfully constructed within the extent of this error ast. The application id this script requires, specified like: #requires -Shellid Shell If no application id has been specified, this property is null. The PowerShell version this script requires, specified like: #requires -Version 3 If no version has been specified, this property is null. The modules this script requires, specified like: #requires -Module NetAdapter #requires -Module @{Name="NetAdapter"; Version="1.0.0.0"} If no modules are required, this property is an empty collection. The snapins this script requires, specified like: #requires -PSSnapin Snapin #requires -PSSnapin Snapin -Version 2 If no snapins are required, this property is an empty collection. The aseemblies this script requires, specified like: #requires -Assembly path\to\foo.dll #requires -Assembly "System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" If no assemblies are required, this property is an empty collection. A ScriptBlockAst is the root ast node for a complete script. Construct a ScriptBlockAst that uses explicitly named begin/process/end blocks. The extent of the script block. The ast for the param block, may be null. The ast for the begin block, may be null. The ast for the process block, may be null. The ast for the end block, may be null. The ast for the dynamicparam block, may be null. If is null. Construct a ScriptBlockAst that does not use explicitly named blocks. The extent of the script block. The ast for the param block, may be null. The statements that go in the end block if is false, or the process block if is true. True if the script block is a filter, false if it is a function or workflow. If or is null. Return the help content, if any, for the script block. Convert the ast into a script block that can be invoked. The compiled script block. Thrown if there are any semantic errors in the ast. The ast representing the parameters for a script block, or null if no param block was specified. The ast representing the begin block for a script block, or null if no begin block was specified. The ast representing the process block for a script block, or null if no process block was specified. The ast representing the end block for a script block, or null if no end block was specified. The ast representing the dynamicparam block for a script block, or null if no dynamicparam block was specified. All of the parsed information from any #requires in the script, or null if #requires was not used. This property is only set for the top level script block (where ) is null. The ast representing the param statement in a script block. Construct the ast for a param statement of a script block. The extent of the param statement, from any possible attributes to the closing paren. The attributes (such as [cmdletbinding()]) specified on the param statement. May be null. The parameters to the script block. May be null. If is null. The asts for attributes (such as [cmdletbinding()]) used before the param keyword. The asts for the parameters of the param statement. The ast representing a begin, process, end, or dynamicparam block in a scriptblock. This ast is used even when the block is unnamed, in which case the block is either an end block (for functions) or process block (for filters). Construct the ast for a begin, process, end, or dynamic param block. The extent of the block. If is false, the extent includes the keyword through the closing curly, otherwise the extent is the as the extent of . The kind of block, must be one of: The ast for the statements in this named block. True if the block was not explicitly named. If or is null. If is not one of the valid kinds for a named block, or if is true and is neither nor . For a function/filter that did not explicitly name the end/process block (which is quite common), this property will return true. The kind of block, always one of: The asts for all of the statements represented by this statement block. This property is never null. The asts for all of the trap statements specified by this statement block, or null if no trap statements were specified in this block. The ast representing a named attribute argument. For example, in [Parameter(Mandatory=$true)], this ast represents Mandatory=$true. Construct the ast for a named attribute argument. The extent of the named attribute argument, starting with the name, ending with the expression, or if the expression is omitted from the source, then ending at the end of the name. The name of the argument specified. May not be null or empty. The argument expression. May not be null even if the expression is omitted from the source. True when an explicit argument is not provided in the source, e.g. [Parameter(Mandatory)]. In this case, an ast for the argument expression must still be provided. If , , or is null, or if is an empty string. The named argument specified by this ast, is never null or empty. The ast of the value of the argument specified by this ast. This property is never null. If the source omitted an expression, this returns true, otherwise false. This allows a caller to distinguish the difference between [Parameter(Mandatory)] and [Parameter(Mandatory=$true)] An abstract base class representing attributes that accept optional arguments, e.g. [Parameter()], as well as type constraints, such as [int]. Initiale the common fields for an attribute. The extent of the attribute, from the opening '[' to the closing ']'. The type named by the attribute. If or is null. The type name for the attribute. This property is never null. The ast representing an attribute with optional positional and named arguments. Construct an attribute ast. The extent of the attribute from opening '[' to closing ']'. The named arguments, may be null. The positional arguments, may be null. The attribute name. If or is null. The asts for the attribute arguments specified positionally. The asts for the named attribute arguments. The ast representing a type constraint, which is simply a typename with no arguments. Construct a type constraint from a possibly not yet resolved typename. The extent of the constraint, from the opening '[' to the closing ']'. The type for the constraint. If or is null. Construct a type constraint from a . The extent of the constraint, from the opening '[' to the closing ']'. The type for the constraint. If or is null. The ast representing a parameter to a script. Parameters may appear in one of 2 places, either just after the name of the function, e.g. function foo($a){} or in a param statement, e.g. param($a). Construct a parameter ast from the name, attributes, and default value. The extent of the parameter, including the attributes and default if specified. The name of the variable. The attributes, or null if no attributes were specified. The default value of the parameter, or null if no default value was specified. If or is null. The asts for any attributes or type constraints specified on the parameter. The variable path for the parameter. This property is never null. The ast for the default value of the parameter, or null if no default value was specified. Returns the type of the parameter. If the parameter is constrained to be a specific type, that type is returned, otherwise typeof(object) is returned. The ast representing a block of statements. The block of statements could be part of a script block or some other statement such as an if statement or while statement. Construct a statement block. The extent of the statement block. If curly braces are part of the statement block (and not some other ast like in a script block), then the curly braces are included in the extent, otherwise the extent runs from the first statement or trap to the last statement or trap. The (possibly empty, but not null) collection of statements. The (possibly null) collection of trap statements. If or is null. The asts for all of the statements represented by this statement block. This property is never null. The asts for all of the trap statements specified by this statement block, or null if no trap statements were specified in this block. The ast that represents a function or filter definition. The function is always named. Construct a function definition. The extent of the function definition, starting with the function or filter keyword, ending at the closing curly. True if the filter keyword was used. True if the workflow keyword was used. The name of the function. The parameters specified after the function name. This does not include parameters specified with a param statement. The body of the function/filter. If , , or is null, or if is an empty string. Return the help content, if any, for the function. If true, the filter keyword was used. If true, the workflow keyword was used. The name of the function or filter. This property is never null or empty. The parameters specified immediately after the function name, or null if no parameters were specified. It is possible that this property may have a value and to also have a value. Normally this is not allowed in a valid script, but in one rare case it is allowed: function foo() { param($a) } In this example, the parameters specified after the function name must be empty or the script is not valid. The body of the function. This property is never null. The ast that represents an if statement. Construct an if statement. The extent of the statement, starting with the if keyword, ending at the closing curly of the last clause. A non-empty collection of pairs of condition expressions and statement blocks. The else clause, or null if no clause was specified. If is null. If is null or empty. The asts representing a pair of (condition,statements) that are tested, in sequence until the first condition tests true, in which case it's statements are executed, otherwise the , if any, is executed. This property is never null and always has at least 1 value. The ast for the else clause, or null if no else clause is specified. The ast representing the data statement. Construct a data statement. The extent of the data statement, extending from the data keyword to the closing curly brace. The name of the variable, if specified, otherwise null. The list of commands allowed in the data statement, if specified, otherwise null. The body of the data statement. If or is null. The name of the variable this data statement sets, or null if no variable name was specified. The asts naming the commands allowed to execute in this data statement. The ast for the body of the data statement. This property is never null. An abstract base class for statements that have labels such as a while statement or a switch statement. Initialize the properties commmon to labeled statements. The extent of the statement. The optionally null label for the statement. The optionally null pipeline for the condition test of the statement. If is null. The label name if specified, otherwise null. The ast for the condition that is tested on each iteration of the loop, or the condition tested on a switch. This property may be null if the statement is a , otherwise it is never null. An abstract base class for looping statements including a the do/while statement, the do/until statement, the foreach statement, the for statement, and the while statement. Initialize the properties common to all loop statements. The extent of the statement. The optionally null label for the statement. The optionally null pipeline for the condition test of the statement. The body of the statement. If or is null. The body of a loop statement. This property is never null. Flags that are specified on a foreach statement. Values may be or'ed together, not all invalid combinations of flags are detected. No flags specified. The -parallel flag. The ast representing the foreach statement. Construct a foreach statement. The extent of the statement, starting from the optional label or the foreach keyword and ending at the closing curly brace. The optionally null label. Any flags that affect how the foreach statement is processed. The variable set on each iteration of the loop. The pipeline generating values to iterate through. The body to execute for each element written from pipeline. If , , or is null. The name of the variable set for each item as the loop iterates. This property is never null. The flags, if any specified on the foreach statement. The ast for a for statement. Construct a for statement. The extent of the statement, from the label or for keyword to the closing curly. The optionally null label. The optionally null initialization expression executed before the loop. The optionally null condition expression tested on each iteration of the loop. The optionally null iteration expression executed after each iteration of the loop. The body executed on each iteration of the loop. If is null. The ast for the initialization expression of a for statement, or null if none was specified. The ast for the iteration experssion of a for statement, or null if none was specified. The ast that represents the do/while statement. Construct a do/while statement. The extent of the do/while statment from the label or do keyword to the closing curly brace. The optionally null label. The condition tested on each iteration of the loop. The body executed on each iteration of the loop. If or is null. The ast that represents a do/until statement. Construct a do/until statement. The extent of the statement, from the label or do keyword to the closing curly brace. The optionally null label. The condition tested on each iteration of the loop. The body executed on each iteration of the loop. If or is null. The ast for a while statement. Construct a while statement. The extent of the statement, from the label or while keyword to the closing curly brace. The optionally null label. The condition tested on each iteration of the loop. The body executed on each iteration of the loop. If or is null. Flags that are specified on a switch statement. Values may be or'ed together, not all invalid combinations of flags are detected. No flags specified. The -file flag. The -regex flag. The -wildcard flag. The -exact flag. The -casesensitive flag. The -parallel flag. The ast that represents a switch statement. Construct a switch statement. The extent of the statement, from the label or switch keyword to the closing curly. The optionally null label. The expression being switched upon. Any flags that affect how the is tested. A possibly null or empty collection of conditions and block of statements to execute if the condition matches. The default clause to execute if no clauses match. If is null. If and are both null or empty. The flags, if any specified on the switch statement. A possibly empty collection of conditions and statement blocks representing the cases of the switch statement. If the colleciton is empty, the default clause is not null. The ast for the default of the switch statement, or null if no default block was specified. The ast that represents a single catch as part of a try statement. Construct a catch clause. The extent of the catch, from the catch keyword to the closing curly brace. The collection of types caught by this catch clause, may be null if all types are caught. The body of the catch clause. If or is null. A possibly empty collection of types caught by this catch block. If the collection is empty, the catch handler catches all exceptions. Returns true if this handler handles any kind of exception. The body of the catch block. This property is never null. The ast that represents a try statement. Construct a try statement ast. The extent of the try statement, from the try keyword to the closing curly of the last catch or finally. The region of guarded code. The list of catch clauses, may be null. The finally clause, may be null. If or is null. If is null or is an empty collection and is also null, then an exception is also raised as the try block must have a finally or at least one catch. The body of the try statement. This property is never null. A collection of catch clauses, which is empty if there are no catches. The ast for the finally block, or null if no finally block was specified, in which case is a non-null, non-empty collection. The ast that represents the trap statement. Construct a trap statement. The extent of the trap statement, starting with the trap keyword and ending with the closing curly of the body. The type handled by the trap statement, may be null if all exceptions are trapped. The handler for the error. If or is null. The ast for the type trapped by this trap block, or null if no type was specified. The body for the trap block. This property is never null. The ast representing the break statement. Construct a break statement ast. The extent of the statement, including the break keyword and the optional label. The optional label expression. If is null. The expression or label to break to, or null if no label was specified. The ast representing the continue statement. Construct a continue statement. The extent of the statement including the optional label. The optional label expression. If is null. The expression or label to continue to, or null if no label was specified. The ast representing the return statement. Construct a return statement. The extent of the statement including the optional return value. The optional return value. If is null. The pipeline specified in the return statement, or null if none was specified. The ast representing the exit statement. Construct an exit statement. The extent of the exit statement including the optional exit value. The optional exit value. If is null. The pipeline specified in the exit statement, or null if none was specified. The ast representing the throw statement. Construct a throw statement. The extent of the throw statement, including the optional value to throw. The optional value to throw. If is null. The pipeline specified in the throw statement, or null if none was specified. If the throw statement is a rethrow. In PowerShell, a throw statement need not throw anything. Such a throw statement throws a new exception if it does not appear lexically withing a catch, otherwise it rethrows the caught exception. Examples: if ($true) { throw } # not a rethrow try { foo } catch { throw } # rethrow try { foo } catch { . { throw } } # rethrow try { foo } catch { function foo { throw } } # rethrow try { foo } finally { throw } # not a rethrow The ast that repesents a PowerShell pipeline, e.g. gci -re . *.cs | select-string Foo or 65..90 | % { [char]$_ }. A pipeline must have at least 1 command. The first command may be an expression or a command invocation. Construct a pipeline from a collection of commands. The extent of the pipeline. The collection of commands representing the pipeline. If is null. If is null or is an empty collection. Construct a pipeline from a single command. The extent of the pipeline (which should be the extent of the command). The command for the pipeline. If or is null. If the pipeline represents a pure expression, the expression is returned, otherwise null is returned. A non-null, non-empty collection of commands that represent the pipeline. The ast that represents a parameter to a command, e.g. dir -Path a*, this class represent '-Path', and in dir -Path:a*, this class represents '-Path:a*'. In the first case, the argument 'a*' is not represented by this class because the parser can't know until runtime if the argument is positional or if -Path accepts an argument. In the later case, the argument 'a*' always belongs to the parameter -Path. Construct a command parameter. The extent of the parameter, starting from the dash character, ending at the end of the parameter name, or else at the end of the optional argument. The parameter name, without the leading dash and without the trailing colon, if a colon was used. If the parameter includes an argument with the syntax like -Path:a*, then the expression for 'a*' is passed as the argument. An argument is not required. The extent to use for error reporting when parameter binding fails with this parameter. If is null, this extent is the same as , otherwise it is the extent of the parameter token itself. If or is null, or if is an empty string. The name of the parameter. This value does not include a leading dash, and in the case that an argument is specified, no trailing colon is included either. This property is never null or empty. The ast for the argument if specified (e.g. -Path:-abc, then the argument is the ast for '-ast'), otherwise null if no argument was specified. The error position to use when parameter binding fails. This extent does not include the argument if one was specified, which means this extent is often the same as . An abstract base class for a command and an expression wrapper that allows an expression as a command in a pipeline. Initialize the common fields of a command. The extent of the command. The redirections for the command, may be null. If is null. The possibly empty collection of redirections for this command. The ast for a command invocation, e.g. dir *.ps1. Construct a command invocation. The extent of the command, starting with either the optional invocation operator '&' or '.' or the command name and ending with the last command element. The elements of the command (command name, parameters and expressions.) The invocation operator that was used, if any. The redirections for the command, may be null. If is null. If is null or is an empty collection. Returns the name of the command invoked by this ast. This command name may not be known statically, in which case null is returned. For example, if the command name is in a variable: & $foo, then the parser cannot know which command is executed. Similarly, if the command is being invoked in a module: & (gmo SomeModule) Bar, then the parser does not know the command name is Bar because the parser can't determine that the expression (gmo SomeModule) returns a module instead of a string. The command name, if known, null otherwise. A non-empty collection of command elements. This property is never null. The invocation operator (either or ) if one was specified, otherwise the value is . The ast representing an expression when the expression is used as the first command of a pipeline. Construct a command that wraps an expression. The extent of the expression. The expression being wrapped. The redirections for the command, may be null. If or is null. The ast for the expression that is or starts a pipeline. This property is never null. An abstract base class representing both file redirections and merging redirections. Initialize the common fields in a redirection. The extent of the redirection. The stream to read from. The stream to read objects from. Objects are either merged with another stream, or written to a file. The stream number that is redirected. All streams, used when the redirection token uses '*' as the stream number. The normal output stream. The error stream. The warning stream. The verbose stream. The debug stream. The host stream. The ast representing a redirection that merges 2 streams, e.g. dir 2>&1 Construct a merging redirection. The extent of the redirection. The stream to read from. The stream to write to - must always be If is null. The stream that results will be written to. The ast representing a redirection to a file, e.g. dir > out.txt, the '> out.txt' is represented by this ast. Construct a redirection to a file. The extent of the redirection, starting with the redirection operator and including the file. The stream being redirected. The optional location to redirect to. Merging operators may not specify a file, the other redirection operators must specify a location. True if the file is being appended, false otherwise. If is null. If is null. The ast for the location to redirect to. True if the file is appended, false otherwise. The ast that represents an assignment statement, e.g. $x = 42. Construct an assignement statement. The extent of the assignment statement. The value being assigned. The assignment operator, e.g. '=' or '+='. The value to assign. The position to report an error if an error occurs at runtime. If , , , or is null. The ast for the location being assigned. This property is never null. The operator for token assignment (such as =, +=, -=, etc.). The value is always some assignment operator. The ast for the value to assign. This property is never null. The position to report at runtime if there is an error during assignment. This property is never null. The ast representing a binary expression, e.g. $a + $b. Construct a binary expression. The extent of the expression. The left hand operand. The binary operator. The right hand operand. The position to report if an error occurs at runtime while evaluating the binary operation. If is not a valid binary operator. If , , , or is null. The operator token kind. The value returned is always a binary operator. The ast for the left hand side of the binary expression. The property is never null. The ast for the right hand side of the binary expression. The property is never null. The position to report an error if an error occurs at runtime. The property is never null. The result type of the operation. For most binary operators, the type is unknown until runtime, but xor always results in typeof(bool). The ast representing an expression with a unary operator. Construct a unary expression. The extent of the expression, including the operator (which may be prefix or postfix.) The unary operator token kind for the operation. The expression that the unary operator is applied to. If or is null. If is not a valid unary operator. The operator token for the unary expression. The value returned is always a unary operator. The child expression the unary operator is applied to. The property is never null. Returns typeof(bool) if the unary operator is a logical negation, otherwise returns typeof(object). The ast that represents a scriptblock with a keyword name. This is normally allowed only for script workflow. e.g. parallel { ... } or sequence { ... }. Construct a keyword block expression The scriptblockexpression that has a keyword applied to it. This property is nerver null. The keyword name The ast that represents an expression with an attribute. This is normally allowed only on parameters or variables being assigned, e.g. [Parameter()]$PassThru or [ValidateScript({$true})$abc = 42. Construct an attributed expression. The extent of the expression, starting with the attribute and ending after the expression being attributed. The attribute being applied to . The expression being attributed by . If , , or is null. The expression that has an attribute or type constraint applied to it. This property is never null. The attribute or type constraint for this expression. This property is never null. The ast that represents a cast expression, e.g. [wmiclass]"Win32_Process". Construct a cast expression. The extent of the expression, starting with the type literal and ending after the expression being converted. The type to convert to. The expression being converted. If , , or is null. The type to convert to. The static type produced after the cast is normally the type named by , but in some cases it may not be, in which, is assumed. The ast that represents accessing a member as a property, e.g. $x.Length or [int]::MaxValue. Most often this is a simple property access, but methods can also be access in this manner, returning an object that supports invoking that member. Construct an ast to reference a property. The extent of the expression, starting with the expression before the operator '.' or '::' and ending after membername or expression naming the member. The expression before the member access operator '.' or '::'. The name or expression naming the member to access. True if the '::' operator was used, false if '.' is used. True if the member access is for a static member, using '::', false if accessing a member on an instace using '.'. If , , or is null. The expression that produces the value to retrieve the member from. This property is never null. The name of the member to retrieve. This property is never null. True if the member to return is static, false if the member is an instance member. The ast that represents the invocation of a method, e.g. $sb.Append('abc') or [math]::Sign($i). Construct an instance of a method invocation expression. The extent of the expression, starting with the expression before the invocation operator and ending with the closing paren after the arguments. The expression before the invocation operator ('.' or '::'). The method to invoke. The arguments to pass to the method. True if the invocation is for a static method, using '::', false if invoking a method on an instace using '.'. If is null. The non-empty collection of arguments to pass when invoking the method, or null if no arguments were specified. The name and attributes of a type. Returns the that this typename represents, if such a type exists, null otherwise. Assuming the typename is an attribute, returns the that this typename represents. By convention, the typename may omit the suffix "Attribute". Lookup will attempt to resolve the type as is, and if that fails, the suffix "Attribute" will be appended. The full name of the type, including any namespace and assembly name. The name of the type, including any namespace, but not including the assembly name. The name of the assembly, if specified, otherwise null. Returns true if the type names an array, false otherwise. Returns true if the type names a closed generic type (has generic type arguments), false otherwise. The extent of the typename. A simple type that is not an array or does not have generic arguments. Construct a simple typename. The extent of the typename. The name of the type. If is null or the empty string. If contains characters that are only allowed in a generic or array typename. Construct a typename with an assembly specification. The extent of the typename. The name of the type. The assembly the type belongs to. If is null or if or is null or the empty string. If contains characters that are only allowed in a generic or array typename. Get the from a typename. The if possible, null otherwise. Null may be returned for valid typenames if the assembly containing the type has not been loaded. Returns the this type represents, assuming the type is an attribute. The suffix "Attribute" may be appended, if necessary, to resolve the type. The if possible, null otherwise. Null may be returned for valid typenames if the assembly containing the type has not been loaded. Simply return the of the type. Returns the full name of the type. Returns the name of the type, w/o any assembly name if one was specified. The name of the assembly, if specified, otherwise null. Always returns false, array typenames are instances of . Always returns false, generic typenames are instances of . The extent of the typename. Represent a close generic type including it's arguments. Construct a generic type name. The extent of the generic typename. The name of the generic class. The name does not need to include the backtick and number of expected arguments, (e.g. System.Collections.Generic.Dictionary`2, but the backtick and number be included. The list of typenames that represent the arguments to the generic type named by . If is null. If is null or if is an empty collection. Returns the that this typename represents, if such a type exists, null otherwise. Get the actual generic type if it's necessary Returns the this type represents, assuming the type is an attribute. The suffix "Attribute" may be appended, if necessary, to resolve the type. The if possible, null otherwise. Null may be returned for valid typenames if the assembly containing the type has not been loaded. Simply return the of the type. Return the typename, using PowerShell syntax for generic type arguments. The name of the type, including any namespace, but not including the assembly name, using PowerShell syntax for generic type arguments. The name of the assembly, if specified, otherwise null. Always returns false because this class does not represent arrays. Always returns true because this class represents generics. The typename that specifies the generic class. The generic arguments for this typename. The extent of the typename. Represents the name of an array type including the dimensions. Construct an ArrayTypeName. The extent of the array typename. The name of the element type. The number of dimensions in the array. If or is null. If is 0 or negative. Returns the that this typename represents, if such a type exists, null otherwise. Always return null, arrays can never be an attribute. Simply return the of the type. Return the typename, using PowerShell syntax for the array dimensions. The name of the type, including any namespace, but not including the assembly name, using PowerShell syntax for the array dimensions. The name of the assembly, if specified, otherwise null. Returns true always as this class represents arrays. Returns false always as this class never represents generics. The element type of the array. The rank of the array. The extent of the typename. A class that allows a to be used directly in the PowerShell ast. Construct a typename from a . The type to wrap. If is null. Returns the for this typename. Never returns null. Assuming the typename is an attribute, returns the that this typename represents. Simply return the of the type. Returns the typename in PowerShell syntax. Returns the typename in PowerShell syntax. The name of the assembly. Returns true if the type is an array, false otherwise. Returns true if the type is a generic, false otherwise. The extent of the typename. The ast that represents a type literal expression, e.g. [int]. Construct a type literal expression. The extent of the typename, including the opening and closing square braces. The typename for the constructed ast. If or is null. The name of the type. This property is never null. The static type of a type literal is always typeof(Type). The ast representing a variable reference, either normal references, e.g. $true, or splatted references @PSBoundParameters. Construct a variable reference. The extent of the variable. The name of the variable. A leading '$' or '@' is not removed, those characters are assumed to be part of the variable name. True if splatting, like @PSBoundParameters, false otherwise, like $false. If or is null, or if is an empty string. Construct a variable reference from a token. Used from the parser. Construct a variable reference with an exising VariablePath (rather than construct a new one.) If or is null. Check if the variable is one of $true, $false and $null True if it is a constant variable The name of the variable. This property is never null. True if splatting syntax was used, false otherwise. The ast representing constant values, such as numbers. Constant values mean truly constant, as in, the value is always the same. Expandable strings with variable references (e.g. "$val") or sub-expressions (e.g. "$(1)") are not considered constant. Construct a constant expression. The extent of the constant. The value of the constant. If is null. The value of the constant. This property is null only if the expression represents the null constant. The static type of a constant is whatever type the value is, or if null, then assume it's typeof(object). The kind of string constant. A string enclosed in single quotes, e.g. 'some text'. A here string enclosed in single quotes, e.g. @' a here string '@ A string enclosed in double quotes, e.g. "some text". A here string enclosed in double quotes, e.g. @" a here string "@ A string like token not enclosed in any quotes. This usually includes a command name or command argument. The ast that represents a constant string expression that is always constant. This includes both single and double quoted strings, but the double quoted strings will not be scanned for variable references and sub-expressions. If expansion of the string is required, use . Construct a string constant expression. The extent of the string constant, including quotes. The value of the string. The type of string. If or is null. The type of string. The value of the string, not including the quotes used. The type of a StringConstantExpressionAst is always typeof(string). The ast that repesents a double quoted string (here string or normal string) and can have nested variable references or sub-expressions, e.g. "Name: $name`nAge: $([DateTime]::Now.Year - $dob.Year)". Construct an expandable string. The value is scanned for nested variable references and expressions which are evaluated at runtime when this ast is compiled. The extent of the string. The unexpanded value of the string. The kind of string, must be one of If or is null. Construct an expandable string expression from a string token. Used from the parser after parsing the nested tokens. This method is internal mainly so we can avoid validating . The value of string, not including the quote characters and without any variables replaced. This property is never null. The type of string. A non-empty collection of expressions contained within the string. The nested expressions are always either instances of or . The type of a StringConstantExpressionAst is always typeof(string). The format expression needed to execute this ast. It is generated by the scanner, it is not provided by clients. The ast that represents an anonymous script block expression, e.g. { dir }. Construct a script block expression. The extent of the script block, from the opening curly brace to the closing curly brace. The script block. If or is null. The ast for the scriptblock that this ast represent. This property is never null. The result of a is always typeof(). The ast that represents an array literal expression, e.g. 1,2,3. An array expression, e.g. @(dir), is represented by . An array literal expression can be constructed from a single element, as happens with the unary comma operator, e.g. ,4. Construct an array literal expression. The extent of all of the elements. The collection of asts that represent the array literal. If is null. If is null or is an empty collection. The non-empty collection of asts of the elements of the array, or null if no elements were specified (e.g. @()). The result of an is always typeof(object[]). The ast that represents a hash literal, e.g. @{a = 1}. Construct a hash literal ast. The extent of the literal, from '@{' to the closing '}'. The optionally null or empty list of key/value pairs. If is null. The pairs of key names and asts for values used to construct the hash table. The result type of a is always typeof(). The ast that represents an array expression, e.g. @(1). The array literal (e.g. 1,2,3) is represented by . Construct an expression that forces the result to be an array. The extent of the expression, including the opening '@(' and closing ')'. The statements executed as part of the expression. If or is null. The expression/statements represented by this sub-expression. The result of an ArrayExpressionAst is always typeof(object[]). The ast that represents an expression (or pipeline) that is enclosed in parentheses, e.g. (1) or (dir) Construct a parenthesized expression. The extent of the expression, including the opening and closing parentheses. The pipeline (or expression) enclosed in parentheses. If or is null. The pipeline (which is frequently but not always an expression) for this parenthesized expression. This property is never null. The ast that represents a subexpression, e.g. $(1). Construct a subexpression. The extent of the expression. If or is null. The expression/statements represented by this sub-expression. This property is never null. The ast that represents a "using" expression, e.g. $using:pshome Construct a using expression. The extent of the using expression. The sub-expression of the using expression. If or is null. Get the underlying "using variable" from a UsingExpressionAst A UsingExpressionAst The underlying VariableExpressionAst of the UsingExpression A UsingExpressionAst must contains a VariableExpressionAst The expression represented by this using expression. This property is never null. The ast that represents an index expression, e.g. $a[0]. Construct an ast for an index expression. The extent of the expression. The expression being indexed. The index expression. If , , or is null. Return the ast for the expression being indexed. This value is never null. Return the ast for the index expression. This value is never null. The help content specified via help comments for a given script or script function. Returns the help info as a comment block. The help content of the .SYNOPSIS section, if specified, otherwise null. The help content of the .DESCRIPTION section, if specified, otherwise null. The help content of the .NOTES section, if specified, otherwise null. The help content for each parameter where help content is specified. The key is the parameter name, the value is the help content. TODO, Changing this to an IDictionary because ReadOnlyDictionary is available only in .NET 4.5 This is a temporary workaround and will be fixed later. Tracked by Win8: 354135 The help content from all of the specified .LINK sections. The help content from all of the specified .EXAMPLE sections. The help content from all of the specified .INPUT sections. The help content from all of the specified .OUTPUT sections. The help content of the .COMPONENT section, if specified, otherwise null. The help content of the .ROLE section, if specified, otherwise null. The help content of the .FUNCTIONALITY section, if specified, otherwise null. The help content of the .FORWARDHELPTARGETNAME section, if specified, otherwise null. The help content of the .FORWARDHELPCATEGORY section, if specified, otherwise null. The help content of the .REMOTEHELPRUNSPACE section, if specified, otherwise null. The help content of the .MAMLHELPFILE section, if specified, otherwise null. Internal interface used for workflow compilation. Searches an AST, using the evaluation function provided by either of the constructors The parser that parses PowerShell script and returns a , tokens, and error messages if the script cannot be parsed successfullly. Parse input from the specified file. The name of the file to parse. Returns the tokens from parsing the script. Returns errors, if any, discovered while parsing the script. The that represents the input script file. Parse input that does not come from a file. The input to parse Returns the tokens from parsing the script. Returns errors, if any, discovered while parsing the script. The that represents the input script file. Parse a single statement. A statement ast. Never returns null, always returns PipelineAst.EmptyPipeline if there was no statement. Handle the InlineScript syntax in the script workflow true -- InlineScript parsing successful false -- InlineScript parsing unsuccessful Parse a catch block. Set to the last thing scanned that is definitely part of the catch, but only set after issuing an error. If there are any errors and CatchBlockRule is returning null, this list is used to return back any asts consumed here (essentially the type constraints.) A catch clause, or null there is no catch or there was some error. Creates a new parse error. The IScriptExtent that represents the location of the error. The error ID to associate with the error. The message of the error. Represents a single point in a script. The script may come from a file or interactive input. The complete script that this position is included in. The name of the file, or if the script did not come from a file, then null. The line number of the position, with the value 1 being the first line. The column number of the position, with the value 1 being the first column. The offset from the beginning of the script. The complete text of the line that this position is included on. Represents the a span of text in a script. The filename the extent includes, or null if the extent is not included in any file. The starting position of the extent. The end position of the extent. This position is actually 1 character past the end of the extent. The line number at the beginning of the extent, with the value 1 being the first line. The column number at the beginning of the extent, with the value 1 being the first column. The line number at the end of the extent, with the value 1 being the first line. The column number at the end of the extent, with the value 1 being the first column. The script text that the extent includes. The starting offset of the extent The ending offset of the extent A few utilty functions for script positions. Return a message that looks like: At {filename}:{line} char:{column} + $x + @y + ~ Return a message that looks like: 12+ $x + <<<< $b Return a unique position representing an empty or missing position. Return a unique extent repesenting an empty or missing extent. Represents a single point in a script. The script may come from a file or interactive input. Creates a new script position, which represents a point in a script The name of the file, or if the script did not come from a file, then null. The line number of the position, with the value 1 being the first line. The column number of the position, with the value 1 being the first column. The complete text of the line that this position is included on. The complete script that this position is included in. The name of the file, or if the script did not come from a file, then null. The line number of the position, with the value 1 being the first line. The column number of the position, with the value 1 being the first column. The offset from the beginning of the script, always return 0. The complete text of the line that this position is included on. A script extent used to customize the display of error location information Creates a new ScriptExtent class. The name of the file, or if the script did not come from a file, then null. The starting position of the extent. The end position of the extent. This position is actually 1 character past the end of the extent. The line number at the beginning of the extent, with the value 1 being the first line. The column number at the beginning of the extent, with the value 1 being the first column. The line number at the end of the extent, with the value 1 being the first line. The column number at the end of the extent, with the value 1 being the first column. The start offset (always returns 0) The end offset (always returns 0) The script text that the extent includes. Each Visit* method in returns one of these values to control how visiting nodes in the AST should proceed. Continue visiting all nodes the ast. Skip visiting child nodes of currently visited node, but continue visiting other nodes. Stop visiting all nodes. Check if the ast is a valid target for assignment. If not, the action reportError is called. The target of an assignment. True if the operator '=' is used, false otherwise (e.g. false on '+=' or '++'.) The action called to report any errors. The specific kind of token. An unknown token, signifies an error condition. A variable token, always begins with '$' and followed by the variable name, possibly enclose in curly braces. Tokens with this kind are always instances of . A splatted variable token, always begins with '@' and followed by the variable name. Tokens with this kind are always instances of . A parameter to a command, always begins with a dash ('-'), followed by the parameter name. Tokens with this kind are always instances of . Any numerical literal token. Tokens with this kind are always instances of . A label token - always begins with ':', followed by the label name. Tokens with this kind are always instances of . A simple identifier, always begins with a letter or '_', and is followed by letters, numbers, or '_'. A token that is only valid as a command name or command argument - it may contain characters not allowed in identifiers. Tokens with this kind are always instances of or if the token contains variable references or subexpressions. A newline (one of '\n', '\r', or '\r\n'). A line continuation (backtick followed by newline). A single line comment, or a delimited comment. Marks the end of the input script or file. A single quoted string literal. Tokens with this kind are always instances of . A double quoted string literal. Tokens with this kind are always instances of . A single quoted here string literal. Tokens with this kind are always instances of . A double quoted here string literal. Tokens with this kind are always instances of . The opening parenthesis token '('. The closing parenthesis token ')'. The opening curly brace token '{'. The closing curly brace token '}'. The opening square brace token '['. The closing square brace token ']'. The opening token of an array expression '@('. The opening token of a hash expression '@{'. The opening token of a sub-expression '$('. The statement terminator ';'. The (unimplemented) operator '&&'. The (unimplemented) operator '||'. The invocation operator '&'. The pipe operator '|'. The unary or binary array operator ','. The pre-decrement operator '--'. The pre-increment operator '++'. The range operator '..'. The static member access operator '::'. The instance member access operator '.'. The logical not operator '!'. The multiplication operator '*'. The division operator '/'. The modulo division (remainder) operator '%'. The addition operator '+'. The substraction operator '-'. The assignment operator '='. The addition assignment operator '+='. The subtraction assignment operator '-='. The multiplcation assignment operator '*='. The division assignment operator '/='. The modulo division (remainder) assignment operator '%='. A redirection operator such as '2>&1' or '>>'. The (unimplemented) stdin redirection operator '<'. The string format operator '-f'. The logical not operator '-not'. The bitwise not operator '-bnot'. The logical and operator '-and'. The logical or operator '-or'. The logical exclusive or operator '-xor'. The bitwise and operator '-band'. The bitwise or operator '-bor'. The bitwise exclusive or operator '-xor'. The join operator '-join'. The case insensitive equal operator '-ieq' or '-eq'. The case insensitive not equal operator '-ine' or '-ne'. The case insensitive greater than or equal operator '-ige' or '-ge'. The case insensitive greater than operator '-igt' or '-gt'. The case insensitive less than operator '-ilt' or '-lt'. The case insensitive less than or equal operator '-ile' or '-le'. The case insensitive like operator '-ilike' or '-like'. The case insensitive not like operator '-inotlike' or '-notlike'. The case insensitive match operator '-imatch' or '-match'. The case insensitive not match operator '-inotmatch' or '-notmatch'. The case insensitive replace operator '-ireplace' or '-replace'. The case insensitive contains operator '-icontains' or '-contains'. The case insensitive notcontains operator '-inotcontains' or '-notcontains'. The case insensitive in operator '-iin' or '-in'. The case insensitive notin operator '-inotin' or '-notin' The case insensitive split operator '-isplit' or '-split'. The case sensitive equal operator '-ceq'. The case sensitive not equal operator '-cne'. The case sensitive greater than or equal operator '-cge'. The case sensitive greater than operator '-cgt'. The case sensitive less than operator '-clt'. The case sensitive less than or equal operator '-cle'. The case sensitive like operator '-clike'. The case sensitive notlike operator '-cnotlike'. The case sensitive match operator '-cmatch'. The case sensitive not match operator '-cnotmatch'. The case sensitive replace operator '-creplace'. The case sensitive contains operator '-ccontains'. The case sensitive not contains operator '-cnotcontains'. The case sensitive in operator '-cin'. The case sensitive not in operator '-notin'. The case sensitive split operator '-csplit'. The type test operator '-is'. The type test operator '-isnot'. The type conversion operator '-as'. The post-increment operator '++'. The post-decrement operator '--'. The shift left operator. The shift right operator. The 'begin' keyword. The 'break' keyword. The 'catch' keyword. The (unimplemented) 'class' keyword. The 'continue' keyword. The 'data' keyword. The (unimplemented) 'define' keyword. The 'do' keyword. The 'dynamicparam' keyword. The 'else' keyword. The 'elseif' keyword. The 'end' keyword. The 'exit' keyword. The 'filter' keyword. The 'finally' keyword. The 'for' keyword. The 'foreach' keyword. The (unimplemented) 'from' keyword. The 'function' keyword. The 'if' keyword. The 'in' keyword. The 'param' keyword. The 'process' keyword. The 'return' keyword. The 'switch' keyword. The 'throw' keyword. The 'trap' keyword. The 'try' keyword. The 'until' keyword. The (unimplemented) 'using' keyword. The (unimplemented) 'var' keyword. The 'while' keyword. The 'workflow' keyword. The 'parallel' keyword. The 'sequence' keyword. The 'InlineScript' keyword Flags that specify additional information about a given token. The token has no flags. The precedence of the logical operators '-and', '-or', and '-xor'. The precedence of the bitwise operators '-band', '-bor', and '-bxor' The precedence of comparison operators including: '-eq', '-ne', '-ge', '-gt', '-lt', '-le', '-like', '-notlike', '-match', '-notmatch', '-replace', '-containts', '-notcontains', '-in', '-notin', '-split', '-join', '-is', '-isnot', '-as', and all of the case sensitive variants of these operators, if they exists. The precedence of the binary operators '+' and '-'. The precedence of the operators '*', '/', and '%'. The precedence of the '-f' operator. The precedence of the '..' operator. A bitmask to get the precedence of binary operators. The token is a keyword. The token one of the keywords that is a part of a script block: 'begin', 'process', 'end', or 'dynamicparam'. The token is a binary operator. The token is a unary operator. The token is a case sensitive operator such as '-ceq' or '-ccontains'. The operators '&', '|', and the member access operators ':' and '::'. The token is one of the assignment operators: '=', '+=', '-=', '*=', '/=', or '%=' The token is scanned identically in expression mode or command mode. The token has some error associated with it. For example, it may be a string missing it's terminator. The operator is not allowed in restricted language mode or in the data language. The token is either a prefix or postfix '++' or '--'. The token names a command in a pipeline. The token names a member of a class. The token names a type. The token names an attribute. The token is a valid operator to use when doing constant folding. A utility class to get statically known traits and invariant traits about PowerShell tokens. Return all the flags for a given TokenKind. Return true if the TokenKind has the given trait. Return the text for a given TokenKind. Represents many of the various PowerShell tokens, and is the base class for all PowerShell tokens. Return the text of the token as it appeared in the script. Return the text of the token as it appeared in the script. Return the flags for the token. Return the kind of token. Returns true if the token is in error somehow, such as missing a closing quote. Return the extent in the script of the token. A constant number token. The value may be any numeric type including int, long, double, or decimal. The numeric value of this token. A parameter to a cmdlet (always starts with a dash, like -Path). The parameter name without the leading dash. It is never null or an empty string. When passing an parameter with argument in the form: dir -Path:* The colon is part of the ParameterToken. This property returns true when this form is used, false otherwise. A variable token - either a regular variable, such as $_, or a splatted variable like @PSBoundParameters. The simple name of the variable, without any scope or drive qualification. The full details of the variable path. The base class for any string token, including single quoted string, double quoted strings, and here strings. The string value without quotes or leading newlines in the case of a here string. A single quoted string, or a single quoted here string. A double quoted string, or a double quoted here string. This collection holds any tokens from variable references and sub-expressions within the string. For example: "In $([DateTime]::Now.Year - $age), $name was born" has a nested expression with a sequence of tokens, plus the variable reference $name. An abstract base class for merging and file redirections. The (currently unimplemented) input redirection. A merging redirection. The stream being redirected. The stream being written to. A file redirection. The stream being redirected. True if the redirection should append the file rather than create a new file. Returns a script block that corresponds to the version deserialized The streaming context for this instance A script block that corresponds to the version deserialized Implements the ISerializable contract for serializing a scriptblock Serialization information for this instance The streaming context for this instance IDisposable implementation When the command is complete, release the associated scope and other members Converts a ScriptBlock to a PowerShell object by traversing the given Ast. Sets the value at the given index for a tuple of the given size. This set supports walking through nested tuples to get the correct final index. Gets the value at the given index for a tuple of the given size. This get supports walking through nested tuples to get the correct final index. Gets the unbound generic Tuple type which has at lease size slots or null if a large enough tuple is not available. Creates a generic tuple with the specified types. If the number of slots fits within the maximum tuple size then we simply create a single tuple. If it's greater then we create nested tuples (e.g. a Tuple`2 which contains a Tuple`128 and a Tuple`8 if we had a size of 136). Gets the number of usable slots in the provided Tuple type including slots available in nested tuples. Creates a new instance of tupleType with the specified args. If the tuple is a nested tuple the values are added in their nested forms. Gets the values from a tuple including unpacking nested values. Gets the series of properties that needs to be accessed to access a logical item in a potentially nested tuple. Gets the series of properties that needs to be accessed to access a logical item in a potentially nested tuple. Provides an expression for creating a tuple with the specified values. Extension methods for DynamicMetaObject. Some of these extensions help handle PSObject, both in terms of getting the type or value from a DynamicMetaObject, but also help to generate binding restrictions that account for values that are optionally wrapped in PSObject. Some classes that implement IEnumerable are not considered as enumerable from the perspective of pipelines, this binder implements those semantics. The standard interop ConvertBinder is used to allow third party dynamic objects to get the first chance at the conversion in case they do support enumeration, but do not implement IEnumerable directly. Check if the statically known type is potentially enumerable. We can avoid some dynamic sites if we know the type is never enumerable. This binder is used for the @() operator. This binder creates the collection we use to do multi-assignments, e.g.: $x,$y = $z $x,$y,$z = 1,2,3,4,5 The target in this binder is the RHS, the result expression is an IList where the Count matches the number of values assigned (_elements) on the left hand side of the assign. This binder is used to convert objects to string in specific circumstances, including: * The LHS of a format expression. The arguments (the RHS objects) of the format expression are not converted to string here, that is defered to String.Format which may have some custom formatting to apply. * The objects passed to the format expression as part of an expandable string. In this case, the format string is generated by the parser, so we know that there is no custom formatting to consider. This binder is used to optimize the conversion of the result This binder is used to copy mutable value types when assigning to variables, otherwise just assigning the target object directly. The binder for common binary operators. PowerShell specific binary operators are handled elsewhere. Use the tokenzier to scan a number and convert it to a number of any type. The expression that refers to a string to be converted to a number of any type. Primarily used as part of an error message. If the string is not a number, we want to raise an exception saying the string can't be converted to this type. Note that if the string is a valid number, it need not be this type. The binder for unary operators like !, -, or +. The binder for converting a value, e.g. [int]"42" The binder to get the value of an indexable object, e.g. $x[1] The binder for setting the value of an indexable element, like $x[1] = 5. The binder for getting a member of a class, like $foo.bar or [foo]::bar Get the actual value, as an expression, of the object represented by target. This will get the base object if it's a psobject, plus correctly handle Nullable. Return the binding result when no property exists. Return the binding restriction that tests that an instance member does not exist, used when the binder knows instance members might exist (because the name was added to some instance), but the object we're currently binding does not have an instance member with the given member name. Resolve the alias, throwing an exception if a cycle is detected while resolving the alias. The binder for setting a member, like $foo.bar = 1 or [foo]::bar = 1 Efficiently multiplies collection by integer collection to multiply number of times the collection is to be multiplied/copied collection multiplied by integer Determine if we should continue or not after and error or exception.... The RuntimeException which was reported The message to display The execution context The preference the user selected Error action is decided by error action preference. If preferenc is inquire, we will prompt user for their preference. This is a helper function for prompting for user preference. The execution context This method will allow user to enter suspend mode. Set error variables like $error and $stacktrace The execution context the output pipe of the statement Report error into error pipe. The runtime error to report The execution context True if it was able to report the error A routine used to advance an enumerator and catch errors that might occur performing the operation The execution context used to see if the pipeline is stopping THe enumerator to advance. An error occurred moving to the next element in the enumeration True if the move succeeded Wrapper caller for enumerator.Current - handles and republishes errors... The enumerator to read from Creates a new ReflectedCaller which can be used to quickly invoke the provided MethodInfo. Gets the next type or null if no more types are available. Uses reflection to create new instance of the appropriate ReflectedCaller Fast creation works if we have a known primitive types for the entire method siganture. If we have any non-primitive types then FastCreate falls back to SlowCreate which works for all types. Fast creation is fast because it avoids using reflection (MakeGenericType and Activator.CreateInstance) to create the types. It does this through calling a series of generic methods picking up each strong type of the signature along the way. When it runs out of types it news up the appropriate CallInstruction with the strong-types that have been built up. One relaxation is that for return types which are non-primitive types we can fallback to object due to relaxed delegates. The number of arguments including "this" for instance methods. This instruction implements a goto expression that can jump out of any expression. It pops values (arguments) from the evaluation stack that the expression tree nodes in between the goto expression and the target label node pushed and not consumed yet. A goto expression can jump into a node that evaluates arguments only if it carries a value and jumps right after the first argument (the carried value will be used as the first argument). Goto can jump into an arbitrary child of a BlockExpression since the block doesn�t accumulate values on evaluation stack as its child expressions are being evaluated. Goto needs to execute any finally blocks on the way to the target label. { f(1, 2, try { g(3, 4, try { goto L } finally { ... }, 6) } finally { ... }, 7, 8) L: ... } The goto expression here jumps to label L while having 4 items on evaluation stack (1, 2, 3 and 4). The jump needs to execute both finally blocks, the first one on stack level 4 the second one on stack level 2. So, it needs to jump the first finally block, pop 2 items from the stack, run second finally block and pop another 2 items from the stack and set instruction pointer to label L. Goto also needs to rethrow ThreadAbortException iff it jumps out of a catch handler and the current thread is in "abort requested" state. The first instruction of finally block. The last instruction of finally block. The last instruction of a catch exception handler. The last instruction of a fault exception handler. Implements dynamic call site with many arguments. Wraps the arguments into . Attaches a cookie to the last emitted instruction. A single interpreted frame might be represented by multiple subsequent Interpreter.Run CLR frames. This method filters out the duplicate CLR frames. Get called from the LeaveFinallyInstruction A simple forth-style stack machine for executing Expression trees without the need to compile to IL and then invoke the JIT. This trades off much faster compilation time for a slower execution performance. For code that is only run a small number of times this can be a sweet spot. The core loop in the interpreter is the RunInstructions method. Runs instructions within the given frame. Interpreted stack frames are linked via Parent reference so that each CLR frame of this method corresponds to an interpreted stack frame in the chain. It is therefore possible to combine CLR stack traces with interpreted stack traces by aligning interpreted frames to the frames of this method. Each group of subsequent frames of Run method corresponds to a single interpreted frame. To get to the current AbortReason object on Thread.CurrentThread we need to use ExceptionState property of any ThreadAbortException instance. If the target that 'Goto' jumps to is inside the current catch block or the subsequent finally block, we delay the call to 'Abort' method, because we want to finish the catch/finally blocks Contains compiler state corresponding to a LabelTarget See also LabelScopeInfo. Returns true if we can jump into this node No finally block No catch blocks Generic constructor Goto the index of the first instruction of the suitable catch block The re-throw instrcution will throw this exception Manages creation of interpreted delegates. These delegates will get compiled if they are executed often enough. Used by LightLambda to get the compiled delegate. Create a compiled delegate for the LightLambda, and saves it so future calls to Run will execute the compiled code instead of interpreting. true if the compiled delegate has the same type as the lambda; false if the type was changed for interpretation. Provides notification that the LightLambda has been compiled. Visits a LambdaExpression, replacing the constants with direct accesses to their StrongBox fields. This is very similar to what ExpressionQuoter does for LambdaCompiler. Also inserts debug information tracking similar to what the interpreter would do. Local variable mapping. The variable that holds onto the StrongBox{object}[] closure from the interpreter A stack of variables that are defined in nested scopes. We search this first when resolving a variable in case a nested scope shadows one of our variable instances. Walks the lambda and produces a higher order function, which can be used to bind the lambda to a closure array from the interpreter. The lambda to bind. Variables which are being accessed defined in the outer scope. A delegate that can be called to produce a delegate bound to the passed in closure array. Provides a list of variables, supporing read/write of the values Gets a copy of the local variables which are defined in the current scope. Checks to see if the given variable is defined within the current local scope. Gets the variables which are defined in an outer scope and available within the current scope. Tracks where a variable is defined and what range of instructions it's used in Wraps all arguments passed to a dynamic site with more arguments than can be accepted by a Func/Action delegate. The binder generating a rule for such a site should unwrap the arguments first and then perform a binding to them. Updates an exception before it's getting re-thrown so we can present a reasonable stack trace to the user. Returns all the stack traces associates with an exception A hybrid dictionary which compares based upon object identity. Provides a dictionary-like object used for caches which holds onto a maximum number of elements specified at construction time. This class is not thread safe. Creates a dictionary-like object used for caches. The maximum number of elements to store. Tries to get the value associated with 'key', returning true if it's found and false if it's not present. Adds a new element to the cache, replacing and moving it to the front if the element is already present. Returns the value associated with the given key, or throws KeyNotFoundException if the key is not present. True if the caller will guarantee that all cleanup happens as the thread unwinds. This is typically used in a case where the thread local is surrounded by a try/finally block. The try block pushes some state, the finally block restores the previous state. Therefore when the thread exits the thread local is back to it's original state. This allows the ThreadLocal object to not check the current owning thread on retrieval. Gets the current value if its not == null or calls the provided function to create a new value. Calls the provided update function with the current value and replaces the current value with the result of the function. Replaces the current value with a new one and returns the old value. Gets the StorageInfo for the current thread. Called when the fast path storage lookup fails. if we encountered the Empty storage during the initial fast check then spin until we hit non-empty storage and try the fast path again. Creates the StorageInfo for the thread when one isn't already present. Gets or sets the value for the current thread. Helper class for storing the value. We need to track if a ManagedThreadId has been re-used so we also store the thread which owns the value. This is a singleton object that is used to indicate a void return result. It's a singleton class. Sealed to prevent subclassing. Any operation that returns no actual value should return this object AutomationNull.Value. Anything that evaluates an MSH expression should be prepared to deal with receiving this result and discarding it. When received in an evaluation where a value is required, it should be replaced with null. Returns the singleton instance of this object. Corresponds to -OutputVariable, -ErrorVariable, and -WarningVariable. Pipe provides a way to stitch two commands. The Pipe class is not thread-safe, so methods such as AddItems and Retrieve should not be called simultaneously. ExternalReader and ExternalWriter can provide thread-safe buffering. for diagnostic purposes If non-null, output written to the pipe are also added to this list. If non-null, errors written to the pipe are also added to this list. If non-null, warnings written to the pipe are also added to this list. Default constructor - Creates the object queue The initial Queue capacity is 1, but it will grow automatically. This overload causes output to be written onto an ArrayList This pipe writes into another pipeline processor allowing pipelines to be chained together... The execution context object for this engine instance The pipeline to write into... Read from an enumerator instead of a pipeline reader... The enumerator to process... Writes an object to the pipe. This could recursively call to the downstream cmdlet, or write the object to the external output. The object to add to the pipe AutomationNull.Value is ignored a terminating error occurred, or the pipeline was otherwise stopped The ExternalWriter stream is closed Writes a set of objects to the pipe. This could recursively call to the downstream cmdlet, or write the objects to the external output. Each of the objects are added to the pipe The pipeline has already been stopped, or a terminating error occurred in a downstream cmdlet. The ExternalWriter stream is closed Returns an object from the pipe. If pipe is empty returns null. This will try the ExternalReader if there are no queued objects. object that is retrieved, or AutomationNull.Value if none Removes all the objects from the Pipe. Returns the currently queued items in the pipe. Note that this will not block on ExternalInput, and it does not modify the contents of the pipe. possibly empty array of objects, but not null This is the downstream cmdlet in the "streamlet model" which is invoked during each call to Add/AddItems. This is the upstream external object source. If this is set, Retrieve() will attempt to read objects from the upstream source before indicating that the pipe is empty. It is improper to change this once the pipeline has started executing, although the checks for this are in the PipelineProcessor class and not here. This is the downstream object recipient. If this is set, Add() and AddItems() write to this recipient instead of to the internal queue. This also disables the DownstreamCmdlet. It is improper to change this once the pipeline has started executing, although the checks for this are in the PipelineProcessor class and not here. OutBufferCount configures the number of objects to buffer before calling the downstream Cmdlet If true, then all input added to this pipe will simply be discarded... A queue that is shared between commands on either side of the pipe to transfer objects. True if there are items in this pipe that need processing... This does not take into account the presence of ExternalInput; it only indicates whether there is currently any data queued up or if there is data in the enumerator... Is true if there is someone consuming this pipe already, either through a Pipe object that processes it's output or there is downstream cmdlet... Loads InternalCommand objects and executes them. The PipelineProcessor class is not thread-safe, so methods such as AddCommand and SynchronousExecute should not be called simultaneously. While SynchronousExecute is running, it may access ExternalInput, ExternalSuccessOutput and ExternalErrorOutput, and those objects are thread-safe. When the command is complete, PipelineProcessor will be disposed. This is only public because it implements an interface method. The class itself is internal. We use the standard IDispose pattern. Finalizer for class PipelineProcessor Add a single InternalCommand to the end of the pipeline Results from last pipeline stage see AddCommand Execute the accumulated commands and clear the pipeline. Results from last pipeline stage see SynchronousExecute Execute the accumulated commands and clear the pipeline. Array of input objects for first stage. If this is null, the first cmdlet is the beginning of the pipeline. Results from last pipeline stage see SynchronousExecute Add a command to the pipeline reference number of command from which to read, 0 for none read from error queue of command readFromCommand reference number of this command for use in readFromCommand FirstCommandCannotHaveInput: must be zero for the first command in the pipe InvalidCommandNumber: there is no command numbered A command can only read from earlier commands; this prevents circular queues ExecutionAlreadyStarted: pipeline has already started or completed PipeAlreadyTaken: the downstream pipe of command is already taken Execute the accumulated commands and clear the pipeline. SynchronousExecute does not return until all commands have completed. There is no asynchronous variant; instead, once the pipeline is set up, the caller can spawn a thread and call SynchronousExecute from that thread. This does not mean that PipelineProcessor is thread-safe; once SynchronousExecute is running, PipelineProcessor should not be accessed through any other means. Array of input objects for first stage. If this is null, the first cmdlet is the beginning of the pipeline. arrays containing contents of all unclaimed and nonempty error queues, indexed on command ID. This will be empty if ExternalErrorOutput is set. These errors will not include errors which occurred during previous calls to Step. Results from last pipeline stage. This will be empty if ExternalSuccessOutput is set. ExecutionAlreadyStarted: pipeline has already started or completed PipelineExecuteRequiresAtLeastOneCommand A cmdlet encountered a terminating error The pipeline was stopped asynchronously The ActionPreference.Stop or ActionPreference.Inquire policy triggered a terminating error. If any parameters fail to bind, or If any mandatory parameters are missing. If there is an error generating the metadata for dynamic parameters. An error occurred clearing the error variable. HaltCommandException will cause the command to stop, but should not be reported as an error. Execute the accumulated commands and clear the pipeline. SynchronousExecute does not return until all commands have completed. There is no asynchronous variant; instead, once the pipeline is set up, the caller can spawn a thread and call SynchronousExecute from that thread. This does not mean that PipelineProcessor is thread-safe; once SynchronousExecute is running, PipelineProcessor should not be accessed through any other means. This variant of the routine looks at it's input object to see if it's enumerable or not. Input objects for first stage. If this is AutomationNull.Value, the first cmdlet is the beginning of the pipeline. arrays containing contents of all unclaimed and nonempty error queues, indexed on command ID. This will be empty if ExternalErrorOutput is set. These errors will not include errors which occurred during previous calls to Step. If true, unravel the input, Pass as a single object otherwise Results from last pipeline stage. This will be empty if ExternalSuccessOutput is set. ExecutionAlreadyStarted: pipeline has already started or completed PipelineExecuteRequiresAtLeastOneCommand A cmdlet encountered a terminating error The pipeline was stopped asynchronously The ActionPreference.Stop or ActionPreference.Inquire policy triggered a terminating error. If any parameters fail to bind, or If any mandatory parameters are missing. If there is an error generating the metadata for dynamic parameters. An error occurred clearing the error variable. HaltCommandException will cause the command to stop, but should not be reported as an error. Implements DoComplete as a stand-alone function for completing the execution of a steppable pipeline. The results of the execution This routine starts the stepping process. It is optional to call this but can be useful if you want the begin clauses of the pipeline to be run even when there may not be any input to process as is the case for I/O redirection into a file. We still want the file opened, even if there was nothing to write to it. True if you want to write to this pipeline Partially execute the pipeline, and retrieve the output after the input objects have been entered into the pipe. This variant ignores error output, which is discarded. This variant injects a single object. input object for first stage Results from last pipeline stage. This will be empty if ExternalSuccessOutput is set. see DoStepItems Partially execute the pipeline, and retrieve the output after the input objects have been entered into the pipe. This variant injects a single object. input object for first stage arrays containing contents of all unclaimed and nonempty error queues, indexed on command ID. This will be empty if ExternalErrorOutput is set. These error results will not be returned in subsequent Step or SynchronousExecute calls. Results from last pipeline stage. This will be empty if ExternalSuccessOutput is set. see DoStepItems Partially execute the pipeline, and retrieve the output after the input objects have been entered into the pipe. This variant ignores error output, which is discarded. Array of input objects for first stage Results from last pipeline stage. This will be empty if ExternalSuccessOutput is set. see DoStepItems Partially execute the pipeline, and retrieve the output after the input objects have been entered into the pipe. Array of input objects for first stage arrays containing contents of all unclaimed and nonempty error queues, indexed on command ID. This will be empty if ExternalErrorOutput is set. These error results will not be returned in subsequent Step or SynchronousExecute calls. Results from last pipeline stage. This will be empty if ExternalSuccessOutput is set. see DoStepItems Request that the pipeline execution should stop. Unlike other methods of PipelineProcessor, this method can be called asynchronously. Partially execute the pipeline, and retrieve the output after the input objects have been entered into the pipe. Array of input objects for first stage arrays containing contents of all unclaimed and nonempty error queues, indexed on command ID. This will be empty if ExternalErrorOutput is set. These error results will not be returned in subsequent Step or SynchronousExecute calls. If true, unravel the argument. Pass as a single item otherwise. Results from last pipeline stage. This will be empty if ExternalSuccessOutput is set. PipelineExecuteRequiresAtLeastOneCommand The pipeline has already been stopped, or a cmdlet encountered a terminating error If any parameters fail to bind, or If any mandatory parameters are missing. If there is an error generating the metadata for dynamic parameters. The pipeline has already been stopped, or a terminating error occurred. An error occurred clearing the error variable. Prepares the pipeline for execution. Input objects are expected, so do not close the first command. This will prevent the one default call to ProcessRecord on the first command. Start must always be called in a context where terminating errors will be caught and result in DisposeCommands. PipelineExecuteRequiresAtLeastOneCommand If any parameters fail to bind, or If any mandatory parameters are missing. If there is an error generating the metadata for dynamic parameters. The pipeline has already been stopped, or a terminating error occurred in a downstream cmdlet. An error occurred clearing the error variable. Add ExternalErrorOutput to all commands whose error output is not yet claimed Clear ErrorVariable as appropriate Partially execute the pipeline. The output remains in the pipes. Array of input objects for first stage If true, unravel the input otherwise pass as one object Exception if any cmdlet throws a [terminating] exception Inject must always be called in a context where terminating errors will be caught and result in DisposeCommands. PipelineExecuteRequiresAtLeastOneCommand The pipeline has already been stopped, or a cmdlet encountered a terminating error The ExternalWriter stream is closed Retrieve results from the pipeline. arrays containing contents of all unclaimed and nonempty error queues, indexed on command ID. This will be empty if ExternalErrorOutput is set. Results from last pipeline stage. This will be empty if ExternalSuccessOutput is set or if this pipeline has been linked. Links this pipeline to a pre-existing Pipe object. This allows nested pipes to write into the parent pipeline. It does this by resetting the terminal pipeline object. The pipeline to write success objects to When the command is complete, Command should be disposed. This enables cmdlets to reliably release file handles etc. without waiting for garbage collection. Exceptions occurring while disposing commands are recorded but not passed through. Makes an internal note of the exception, but only if this is the first error. error which terminated the pipeline command against which to log SecondFailure true iff the pipeline was not already stopped Sometimes we shouldn't be rethrow the exception we previously caught, such as when the exception is handled by a trap. ExternalInput allows the caller to specify an asynchronous source for the input to the first command in the pipeline. Note that if ExternalInput is specified, SynchronousExecute will not return until the ExternalInput is closed. It is the responsibility of the caller to ensure that the object reader is closed, usually by another thread. ExecutionAlreadyStarted: pipeline has already started or completed ExternalSuccessOutput provides asynchronous access to the success output of the last command in the pipeline. Note that if ExternalSuccessOutput is specified, the result array return value to SynchronousExecute will always be empty. PipelineProcessor will close ExternalSuccessOutput when the pipeline is finished. ExecutionAlreadyStarted: pipeline has already started or completed ExternalErrorOutput provides asynchronous access to the combined error output of all commands in the pipeline except what is routed to other commands in the pipeline. Note that if ExternalErrorOutput is specified, the errorResults return parameter to SynchronousExecute will always be empty. PipelineProcessor will close ExternalErrorOutput when the pipeline is finished. ExecutionAlreadyStarted: pipeline has already started or completed Indicates whether this PipelineProcessor has already started. If so, some properties can no longer be changed. Indicates whether stop has been requested on this PipelineProcessor. The scope the pipeline should execute in. This provider is the data accessor for shell aliases. It uses the SessionStateProviderBase as the base class to produce a view on session state data. This is the base class for all the providers that produce a view on session state data (Variables, Aliases, and Functions) An instance of the PSTraceSource class used for trace output Derived classes must override to get items from session state The name of the item to get. The item of the given name in the appropriate session state table. Sets a session state item in the appropriate session state table. Derived classes must override this method to set the item in the proper table. The name of the item to set. The new value for the item. If true, the item that was set should be written to WriteItemObject. Removes a session state item from the appropriate session state table. Derived classes must override this method to remove items from the proper table. The name of the item to remove. Gets all the items in the appropriate session state table. An IDictionary representing the items in the session state table. The key is the name of the item and the value is the value. Since items are often more than their value, this method should be overridden to provide the value for an item The item to extract the value from. The value of the specified item. The default implementation will get the Value property of a DictionaryEntry Determines if the item can be renamed. Derived classes that need to perform a check should override this method. The item to verify if it can be renamed. true if the item can be renamed or false otherwise. Gets an item from session state. Name of the item to get. The item instance is written to the WriteObject method. Sets a session state item to a given value Name of the item to set The value to which to set the item Nothing. The item that was set is written to the WriteObject method. Gets the item(s) at the given path The name of the item to retrieve, or all if empty or null. Ignored. Gets the name(s) of the item(s) at the given path The name of the item to retrieve, or all if empty or null. Ignored. Determines if there are any items The container to check to see if there are any children. True if path is empty or null, false otherwise. Determines if the specified item exists The path to the item to check. If this is null or empty, the item container is used (and always exists). True if the item exists, false otherwise. Determines if the specified path is syntactically and semantically valid. The path to validate. True if the path is valid, or false otherwise. The path may not contain the following characters: . ( ) : Removes the item at the specified path. The name of the item to be removed. Ignored. Creates a new item if one of the same name doesn't already exist. The name of the item to create. Ignored. The value of the new item. Copies the specified item. The name of the item to copy. The name of the item to create. Ignored. Copies the specified item. The name of the item to copy. The new name of the item. Gets an instance of the content reader for this provider for the specified path. The path to get the content reader for. An instance of an IContentReader for the given path. Gets an instance of the content writer for this provider for the specified path. The path to get the content writer for. An instance of an IContentWriter for the given path. Always throws a NotSupportedException ignored. This exception is always thrown. Always returns null null Always returns null null Always returns null null Gets the name of the provider The constructor for the provider that exposes variables to the user as drives. Initializes the alias drive An array of a single PSDriveInfo object representing the alias drive. Gets the dynamic parameters for the NewItem cmdlet Ignored. Ignored. Ignored. An instance of AliasProviderDynamicParameters which is the dynamic parameters for NewItem. Gets the dynamic parameters for the NewItem cmdlet Ignored. Ignored. An instance of AliasProviderDynamicParameters which is the dynamic parameters for SetItem. Gets a alias from session state The name of the alias to retrieve. A DictionaryEntry that represents the value of the alias. Since items are often more than their value, this method should be overridden to provide the value for an item The item to extract the value from. The value of the specified item. The default implementation will get the Value property of a DictionaryEntry Sets the alias of the specified name to the specified value The name of the alias to set. The new value for the alias. If true, the item that was set should be written to WriteItemObject. Removes the specified alias from session state. The name of the alias to remove from session state. Gets a flattened view of the alias in session state An IDictionary representing the flattened view of the aliases in session state. Determines if the item can be renamed. Derived classes that need to perform a check should override this method. The item to verify if it can be renamed. true if the item can be renamed or false otherwise. The dynamic parameter object for the AliasProvider SetItem and NewItem commands Gets or sets the option parameter for the alias Determines if the Options parameter was set. This provider is the data accessor for environment variables. It uses the SessionStateProviderBase as the base class to produce a view on session state data. Gets the name of the provider The constructor for the provider that exposes environment variables to the user as drives. Initializes the alias drive An array of a single PSDriveInfo object representing the alias drive. Gets a environment variable from session state The name of the environment variable to retrieve. A DictionaryEntry that represents the value of the environment variable. Sets the environment variable of the specified name to the specified value The name of the environment variable to set. The new value for the environment variable. If true, the item that was set should be written to WriteItemObject. Removes the specified environment variable from session state. The name of the environment variable to remove from session state. Gets a flattened view of the environment variables in session state An IDictionary representing the flattened view of the environment variables in session state. Gets the Value property of the DictionaryEntry item The item to get the value from. The value of the item. The content stream class for the file system provider. It implements both the IContentReader and IContentWriter interfaces. Note, this class does no specific error handling. All errors are allowed to propogate to the caller so that they can be written to the error pipeline if necessary. An instance of the PSTraceSource class used for trace output using "FileSystemContentStream" as the category. Constructor for the content stream The path to the file to get the content from. The file mode to open the file with. The file access requested in the file. The file share to open the file with The encoding of the file to be read or written. If true, bytes will be read from the file. If false, the specified encoding will be used to read the file. If true, we will perform blocking reads on the file, waiting for new content to be appended The CmdletProvider invoking this stream Indicates raw stream. Constructor for the content stream The path to the file to get the content from. The name of the Alternate Data Stream to get the content from. If null or empty, returns the file's primary content. The file mode to open the file with. The file access requested in the file. The file share to open the file with The encoding of the file to be read or written. If true, bytes will be read from the file. If false, the specified encoding will be used to read the file. If true, we will perform blocking reads on the file, waiting for new content to be appended The CmdletProvider invoking this stream Indicates raw stream. Constructor for the content stream The path to the file to get the content from. The file mode to open the file with. The file access requested in the file. The file share to open the file with The delimiter to use when reading strings. Each time read is called, all contents up to an including the delimiter is read. The encoding of the file to be read or written. If true, we will perform blocking reads on the file, waiting for new content to be appended The CmdletProvider invoking this stream Indicates raw stream. Constructor for the content stream The path to the file to get the content from. The name of the Alternate Data Stream to get the content from. If null or empty, returns the file's primary content. The file mode to open the file with. The file access requested in the file. The file share to open the file with The delimiter to use when reading strings. Each time read is called, all contents up to an including the delimiter is read. The encoding of the file to be read or written. If true, we will perform blocking reads on the file, waiting for new content to be appended The CmdletProvider invoking this stream Indicates raw stream. Reads the specified number of characters or a lines from the file. If less than 1, then the entire file is read at once. If 1 or greater, then readCount is used to determine how many items (ie: lines, bytes, delimited tokens) to read per call. An array of strings representing the character(s) or line(s) read from the file. Read the content regardless of the 'waitForChanges' flag Move the pointer of the stream to the position where there are 'backCount' number of items (depends on what we are using: delimiter? line? byts?) to the end of the file. Waits for changes to the specified file. To do this, it closes the file and then monitors for changes. Once a change appears, it reopens the streams and seeks to the last read position. The path of the file to read / monitor The FileMode of the file (ie: Open / Append) The access properties of the file (ie: Read / Write) The sharing properties of the file (ie: Read / ReadWrite) The encoding of the file Moves the current stream position in the file The offset from the origin to move the position to. The origin from which the offset is calculated. Closes the file. Writes the specified object to the file The objects to write to the file The objects written to the file. Closes the file stream If the given encoding is OEM or Default, check to see if the code page is SBCS(single byte character set). We don't support this method because it is not used by the ReadBackward method in FileStreamContentReaderWriter We don't support this method because it is not used by the ReadBackward method in FileStreamContentReaderWriter Reset the internal character buffer. Use it only when the position of the internal buffer and the base stream do not match. These positions can become mismatch when the user read the data into the buffer and then seek a new position in the underlying stream. Return the current actual stream position Get the number of bytes the delimiter will be encoded to Peek the next character Return -1 if we reach the head of the file Read the next character Return -1 if we reach the head of the file Read a specific maximum of characters from the current stream into a buffer Return the number of characters read, or -1 if we reach the head of the file Read a line from the current stream Return null if we reach the head of the file Refill the internal character buffer Refill the internal byte buffer The exception that indicates the encoding is not supported when reading backward Get the encoding name Defines the implementation of a File System Provider. This provider allows for stateless namespace navigation of the file system. The FileSystemProvider provides stateless namespace navigation of the file system. Gets the name of the provider An instance of the PSTraceSource class used for trace output using "FileSystemProvider" as the category. Initializes a new instance of the FileSystemProvider class. Since this object needs to be stateless, the constructor does nothing. Converts all / in the path to \ The path to normalize. The path with all / normalized to \ Checks if the item exist at the specified path. if it exists then creates appropriate directoryinfo or fileinfo object. refers to the item for which we are checking for existence and creating filesysteminfo object. return true if path points to a directory else returns false. overrides the method of CmdletProvider, considering the additional dynamic parameters of FileSystemProvider whether the filter or attribute filter is set. Gets the dynamic parameters for get-childnames on the FileSystemProvider. We currently only support one dynamic parameter, "Attributes" that returns an enum evaluator for the given expression. If the path was specified on the command line, this is the path to the item for which to get the dynamic parameters. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. Gets the dynamic parameters for get-childitems on the FileSystemProvider. We currently only support one dynamic parameter, "Attributes" that returns an enum evaluator for the given expression. If the path was specified on the command line, this is the path to the item for which to get the dynamic parameters. Ignored. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. Implementation of ICmdletProviderSupportsHelp interface. Gets provider-specific help content for the corresponding cmdlet Name of command that the help is requested for. Not used here. The MAML help XML that should be presented to the user. Starts the File System provider. This method sets the Home for the provider to providerInfo.Home if specified, and %HOMEDRIVE%%HOMEPATH% otherwise. The ProviderInfo object that holds the provider's configuration. The updated ProviderInfo object that holds the provider's configuration. Determines if the specified drive can be mounted. The drive that is going to be mounted. The same drive that was passed in, if the drive can be mounted. null if the drive cannot be mounted. drive is null. drive root is null or empty. MapNetworkDrive facilitates to map the newly created PS Drive to a network share. The PSDrive infor that would be used to create a new PS drive. ShouldMapNetworkDrive is a helper function used to detect if the requested PSDrive to be created has to be mapped to a network drive. RemoveDrive facilitates to remove network mapped persisted PSDrvie. PSDrive info. PSDrive info. IsSupportedDriveForPersistence is a helper method used to check if the psdrive can be persisted or not. PS Drive Info. True if the drive can be persisted or else false. Return the UNC path for a given network drive using the Windows API Returns a collection of all logical drives in the system. A collection of PSDriveInfo objects, one for each logical drive returned from System.Environment.GetLogicalDrives(). Retrieves the dynamic parameters required for the Get-Item cmdlet The path of the file to process An instance of the FileSystemProviderGetItemDynamicParameters class that represents the dynamic parameters. Determines if the specified path is syntactically and semantically valid. An example path looks like this C:\WINNT\Media\chimes.wav The fully qualified path to validate. True if the path is valid, false otherwise. Gets the item at the specified path. A fully qualified path representing a file or directory in the file system. Nothing. FileInfo and DirectoryInfo objects are written to the context's pipeline. path is null or empty. Invokes the item at the path using ShellExecute semantics. The item to invoke. path is null or empty. Gets the child items of a given directory. The full path of the directory to enumerate. If true, recursively enumerates the child items as well. Nothing. FileInfo and DirectoryInfo objects that match the filter are written to the context's pipeline. path is null or empty. Gets the path names for all children of the specified directory that match the given filter. The full path of the directory to enumerate. Determines if all containers should be returned or only those containers that match the filter(s). Nothing. Child names are written to the context's pipeline. path is null or empty. Gets a new provider-specific path and filter (if any) that corresponds to the given path. The path to the item. Unlike most other provider APIs, this path is likely to contain PowerShell wildcards. The provider-specific filter currently applied. The new path to the item. The new filter. True if the path or filter were altered. False otherwise. Makes no attempt to filter if the user has already specified a filter, or if the path contains directory separators. Those are not supported by the FileSystem filter. Create an enum expression evaluator for user-specified attribute filtering switch paramters. If any attribute filtering switch parameters are set, returns an evaluator that evaluates these parameters. Otherwise, returns NULL Provides a mode property for FileSystemInfo instance of PSObject wrapping a FileSystemInfo Renames a file or directory. The current full path to the file or directory. The new full path to the file or directory. Nothing. The renamed DirectoryInfo or FileInfo object is written to the context's pipeline. path is null or empty. newName is null or empty Creates a file or directory with the given path. The path of the file or directory to create. Specify "file" to create a file. Specify "directory" or "container" to create a directory. If is "file" then this parameter becomes the content of the file to be created. Nothing. The new DirectoryInfo or FileInfo object is written to the context's pipeline. path is null or empty. type is null or empty. For Filesystem Provider NewItem, Type is a mandatory parameter. This is not declared mandatory in the parameter attribute. if the type is not specified then use the host interface to prompt for type. string type that corresponds to the type of item the user wants Creates a directory at the specified path The path of the directory to create Determines if the directory should be streamed out after being created. Removes the specified file or directory. The full path to the file or directory to be removed. Specifies if the operation should also remove child items. path is null or empty. Retrieves the dynamic parameters required for the Remove-Item cmdlet The path of the file to process Whether to recurse into containers An instance of the FileSystemProviderRemoveItemDynamicParameters class that represents the dynamic parameters. Removes a directory from the file system. The DirectoryInfo object representing the directory to be removed. If true, ShouldProcess will be called for each item in the subtree. If false, ShouldProcess will only be called for the directory item. If true, attempts to modify the file attributes in case of a failure so that the file can be removed. True if the DirectoryInfo being passed in is the root of the tree being removed. ShouldProcess will be called if this is true or if recurse is true. Removes a file from the file system. The FileInfo object representing the file to be removed. If true, attempts to modify the file attributes in case of a failure so that the file can be removed. Removes the file system object from the file system. The FileSystemInfo object representing the file or directory to be removed. If true, the readonly and hidden attributes will be masked off in the case of an error, and the removal will be attempted again. If false, exceptions are written to the error pipeline. Determines if a file or directory exists at the specified path. The path of the item to check. True if a file or directory exists at the specified path, false otherwise. path is null or empty. Implementation of ItemExists for the provider. This implementation allows the caller to decide if it wants to WriteError or not based on the returned ErrorRecord The path of the object to check An error record is returned in this parameter if there was an error. True if an object exists at the specified path, false otherwise. path is null or empty. Adds -OlderThan, -NewerThan dynamic properties. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. Overrides of this method should return an object that has properties and fields decorated with parsing attributes similar to a cmdlet class or a . The default implemenation returns null. (no additional parameters) Determines if the given path is a directory, and has children. The full path to the directory. True if the path refers to a directory that contains other directories or files. False otherwise. path is null or empty. Copies an item at the specified path to the given destination. The path of the item to copy. The path of the destination. Specifies if the operation should also copy child items. path is null or empty. destination path is null or empty. Nothing. Copied items are written to the context's pipeline. Gets the parent of the given path. The path of which to get the parent. The root of the drive. The parent of the given path. Determines if the specified path is a root of a UNC share by counting the path separators "\" following "\\". If only one path separator is found we know the path is in the form "\\server\share" and is a valid UNC root. The path to check to see if its a UNC root. True if the path is a UNC root, or false otherwise. Determines if the specified path is either a drive root or a UNC root The path True if the path is either a drive root or a UNC root, or false otherwise. Normalizes the path that was passed in and returns it as a normalized path relative to the given basePath. A fully qualifiedpath to an item. The item must exist, or the provider writes out an error. The path that the normalized path should be relative to. A normalized path, relative to the given basePath. path is null or empty. Normalizes the path that was passed in and returns the normalized path as a relative path to the basePath that was passed. A fully qualified provider specific path to an item. The item should exist or the provider should write out an error. The path that the return value should be relative to. A normalized path that is relative to the basePath that was passed. The provider should parse the path parameter, normalize the path, and then return the normalized path relative to the basePath. This method does not have to be purely syntactical parsing of the path. It is encouraged that the provider actually use the path to lookup in its store and create a relative path that matches the casing, and standardized path syntax. Note, the base class implemenation uses GetParentPath, GetChildName, and MakePath to normalize the path and then make it relative to basePath. All string comparisons are done using StringComparison.InvariantCultureIngoreCase. Get the common base path of two paths One path Another path Tokenizes the specified path onto a stack The path to tokenize. The base part of the path that should not be tokenized. A stack containing the tokenized path with leaf elements on the bottom of the stack and the most ancestoral parent at the top. Given the tokenized path, the relative pathing elements are removed. String containing basepath for which we are trying to find the relative path. A stack containing path elements where the leaf most element is at the bottom of the stack and the most ancestoral parent is on the top. Generally this stack comes from TokenizePathToStack(). A stack in reverse order with the path elements normalized and all relative pathing tokens removed. Pops each leaf element of the stack and uses MakePath to generate the relative path The stack containing the leaf elements of the path. A path that is made up of the leaf elements on the given stack. The elements on the stack start from the leaf element followed by its parent followed by its parent, etc. Each following element on the stack is the parent of the one before it. Gets the name of the leaf element of the specified path. The fully qualified path to the item. The leaf element of the specified path. path is null or empty. Determines if the item at the specified path is a directory. The path to the file or directory to check. True if the item at the specified path is a directory. False otherwise. path is null or empty. Moves an item at the specified path to the given destination. The path of the item to move. The path of the destination. Nothing. Moved items are written to the context's pipeline. path is null or empty. destination is null or empty. Gets a property for the given item. The fully qualified path to the item. The list of properties to get. Examples include "Attributes", "LastAccessTime," and other properties defined by and Gets the dynamic propery parameters required by the get-itemproperty cmdlet. This feature is not required by the File System provider. If the path was specified on the command line, this is the path to the item for which to get the dynamic parameters. A list of properties that should be retrieved. If this parameter is null or empty, all properties should be retrieved. Null. This feature is not required by the File System provider. Sets the specified properties on the item at the given path. The path of the item on which to set the properties. A PSObject which contains a collection of the names and values of the properties to be set. The File System provider supports setting only the "Attributes" property. path is null or empty. propertyToSet is null. Gets the dynamic propery parameters required by the set-itemproperty cmdlet. This feature is not required by the File System provider. If the path was specified on the command line, this is the path to the item for which to set the dynamic parameters. A PSObject which contains a collection of the name, type, value of the properties to be set. Null. This feature is not required by the File System provider. Clears the specified properties on the item at the given path. The File System provider supports only the "Attributes" property. The path of the item on which to clear the properties. A collection of the names of the properties to clear. The File System provider supports clearing only the "Attributes" property. Path is null or empty. propertiesToClear is null or count is zero. Gets the dynamic propery parameters required by the clear-itemproperty cmdlet. This feature is not required by the File System provider. If the path was specified on the command line, this is the path to the item for which to set the dynamic parameters. A collection of the names of the properties to clear. Null. This feature is not required by the File System provider. Creates an instance of the FileSystemContentStream class, opens the specified file for reading, and returns the IContentReader interface to it. The path of the file to be opened for reading. An IContentReader for the specified file. path is null or empty. Gets the dynamic propery parameters required by the get-content cmdlet. If the path was specified on the command line, this is the path to the item for which to get the dynamic parameters. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. Creates an instance of the FileSystemContentStream class, opens the specified file for writing, and returns the IContentReader interface to it. The path of the file to be opened for writing. An IContentWriter for the specified file. path is null or empty. Gets the dynamic propery parameters required by the set-content and add-content cmdlets. If the path was specified on the command line, this is the path to the item for which to get the dynamic parameters. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. Clears the content of the specified file. The path to the file of which to clear the contents. path is null or empty. Gets the dynamic propery parameters required by the clear-content cmdlet. If the path was specified on the command line, this is the path to the item for which to get the dynamic parameters. A FileSystemClearContentDynamicParameters that provides access to the -Stream dynamic parameter. -raw is not allowed when -first,-last or -wait is specified this call will validate that and throws. Gets the SecurityDescriptor at the specified path, including only the specified AccessControlSections. The path of the item to retrieve. It may be a drive or provider-qualified path and may include. glob characters. The sections of the security descriptor to include. Nothing. An object that represents the security descriptor for the item specified by path is written to the context's pipeline. path is null or empty. path doesn't exist sections is not valid. Sets the SecurityDescriptor at the specified path. The path of the item to set the security descriptor on. It may be a drive or provider-qualified path and may include. glob characters. The new security descriptor for the item. path is null or empty. securitydescriptor is null. Creates a new empty security descriptor of the same type as the item specified by the path. If "path" points to a file system directory, then the descriptor returned will be of type DirectorySecurity. Path of the item to use to determine the type of resulting SecurityDescriptor. The sections of the security descriptor to create. A new ObjectSecurity object of the same type as the item specified by the path. Creates a new empty security descriptor of the specified type. The type of Security Descriptor to create. Valid types are "file", "directory," and "container." The sections of the security descriptor to create. A new ObjectSecurity object of the specified type. WNetAddConnection2 API makes a connection to a network resource and can redirect a local device to the network resource. This API simulates the "new Use" funcationality used to connect to network resource. The The netResource structure contains information about a network resource. The passward used to get connected to network resource. The username used to get connected to network resource. The flags paramter is used to indicate if the created network resource has to be persisted or not. If connection is established to the network resource then success is returned or else the error code describing the type of failure that occured while establishing the connection is returned. WNetCancelConnection2 function cancels an existing network connection. PSDrive Name. Connection Type. Specifies whether the disconnection should occur if there are open files or jobs on the connection. If this parameter is FALSE, the function fails if there are open files or jobs. If connection is removed then success is returned or else the error code describing the type of failure that occured while trying to remove the connection is returned. WNetGetConnection function retrieves the name of the network resource associated with a local device. Local name of the PSDrive. The remote name to which the PSDrive is getting mapped to. length of the remote name of the created PSDrive. Facilitates to validate if the supplied path exists locally or on the network share. Path of the file being executed. True if the path is a network path or else returns false. Managed equivalent of NETRESOURCE structure of WNet API Defines the values that can be supplied as the encoding parameter in the FileSystemContentDynamicParametersBase class. No encoding. Unicode encoding. Unicode encoding. Byte encoding. Big Endian Unicode encoding. UTF8 encoding. UTF7 encoding. UTF32 encoding. ASCII encoding. Default encoding. OEM encoding. Defines the container cmdlet dynamic providers Gets or sets the attribute filtering enum evaluator Gets or sets the filter directory flag Gets or sets the filter file flag Gets or sets the filter hidden flag Gets or sets the filter readonly flag Gets or sets the filter system flag Defines the dynamic parameters used by both the content reader and writer. Default to getting a unicode string Converts the stream type string into an Encoding This is a string representation of the encoding. It can be "string", "unicode", "bigendianunicode", "ascii", "utf7", or "utf8" Note, a ToLowerInvariant is done to the type before comparison is made. The encoding that was represented by the string ArgumentException if type is null, empty, or does not represent one of the known encoding types. Gets or sets the encoding method used when reading data from the file. A parameter to return a stream of an item. Gets the encoding from the specified StreamType parameter. Gets the Byte Encoding status of the StreamType parameter. Returns true if the stream was opened with "Byte" encoding, false otherwise. Gets the status of the StreamType parameter. Returns true if the stream was opened with a user-specified encoding, false otherwise. Defines the dynamic parameters used by the Clear-Content cmdlet. A parameter to return a stream of an item. Defines the dynamic parameters used by the set-content and add-content cmdlets. Defines the dynamic parameters used by the get-content cmdlet. Gets or sets the delimiter to use when reading the file. Custom delimiters may not be used when the file is opened with a "Byte" encoding. Gets or sets the Wait flag. The wait flag determines if we want the read-content call to poll (and wait) for changes to the file, rather than exit after the content has been read. When the –Raw switch is present, we don’t do any breaks on newlines, and only emit one object to the pipeline: all of the content. Gets the status of the delimiter parameter. Returns true if the delimiter was explicitly specified by the user, false otherwise. Provides the dynamic parameters for test-path on the file system. A parameter to test if a file is older than a certain time or date. A parameter to test if a file is newer than a certain time or date Provides the dynamic parameters for Get-Item on the file system. A parameter to return the streams of an item. Provides the dynamic parameters for Remove-Item on the file system. A parameter to return the streams of an item. Represents alternate stream data retrieved from a file. The name of the file that holds this stream. The name of this stream. The length of this stream. Provides access to alternate data streams on a file List all of the streams on a file The fully-qualified path to the file. The list of streams (and their size) in the file. Creates a file stream on a file The fully-qualified path to the file. The name of the alternate data stream to open. The FileMode of the file. The FileAccess of the file. The FileShare of the file. A FileStream that can be used to interact with the file. Removes an alternate data stream. The path to the file. The name of the alternate data stream to delete. Represents alternate stream data retrieved from a file. The length of this stream. The name of this stream. This provider is the data accessor for shell functions. It uses the SessionStateProviderBase as the base class to produce a view on session state data. Gets the name of the provider The constructor for the provider that exposes variables to the user as drives. Initializes the function drive An array of a single PSDriveInfo object representing the functions drive. Gets the dynamic parameters for the NewItem cmdlet Ignored. Ignored. Ignored. An instance of FunctionProviderDynamicParameters which is the dynamic parameters for NewItem. Gets the dynamic parameters for the NewItem cmdlet Ignored. Ignored. An instance of FunctionProviderDynamicParameters which is the dynamic parameters for SetItem. Gets a function from session state The name of the function to retrieve. A ScriptBlock that represents the function. Sets the function of the specified name to the specified value The name of the function to set. The new value for the function. If true, the item that was set should be written to WriteItemObject. Removes the specified function from session state. The name of the function to remove from session state. Since items are often more than their value, this method should be overridden to provide the value for an item The item to extract the value from. The value of the specified item. The default implementation will get the Value property of a DictionaryEntry Gets a flattened view of the functions in session state An IDictionary representing the flattened view of the functions in session state. Determines if the item can be renamed. Derived classes that need to perform a check should override this method. The item to verify if it can be renamed. true if the item can be renamed or false otherwise. The dynamic parameter object for the FunctionProvider SetItem and NewItem commands Gets or sets the option parameter for the function Determines if the Options parameter was set. Provider that provides access to Registry through cmdlets. This provider implements , , , interfaces. Provider that provides access to Registry through cmdlets. This provider implements , , , interfaces. Gets the name of the provider An instance of the PSTraceSource class used for trace output using "ProviderProvider" as the category. Verifies that the new drive has a valid root. A PSDriveInfo object. Creates HKEY_LOCAL_MACHINE and HKEY_CURRENT_USER registry drives during provider initialization. After the Start method is called on a provider, the InitializeDefaultDrives method is called. This is an opportunity for the provider to mount drives that are important to it. For instance, the Active Directory provider might mount a drive for the defaultNamingContext if the machine is joined to a domain. The FileSystem mounts all drives then available. Determines if the specified is syntactically and semantically valid. The path to validate. True if the path is valid, or False otherwise. Gets the RegistryKey item at the specified and writes it to the pipeline using the WriteObject method. Any non-terminating exceptions are written to the WriteError method. The path to the key to retrieve. Sets registry values at to the specified. The path to the item that is to be set. Only registry values can be set using this method. The new value for the registry value. Gets the dynamic parameters for the SetItem method. Ignored. Ignored. An instance of the class which contains a parameter for the Type. Clears the item at the specified . The path to the item that is to be cleared. Only registry values can be cleared using this method. The registry provider implements this by removing all the values for the specified key. The item that is cleared is written to the WriteObject method. If the path is to a value, then an ArgumentException is written. Gets all the child keys and values of the key at the specified . The path to the key to get the child keys of. / Determines if the call should be recursive. If true, all subkeys of the key at the specified path will be written. If false, only the immediate children of the key at the specified path will be written. Gets all the child key and value names of the key at the specified . The path to the key to get the child names from. Ignored since the registry provider does not implement filtering. Normally, if this parameter is ReturnAllContainers then all subkeys should be returned. If it is false, then only those subkeys that match the filter should be returned. Escapes the characters in the registry key path that are used by globbing and path. The path to escape. The escaped path. This method handles surrogate pairs. Please see msdn documentation Escapes the characters in the registry key name that are used by globbing and path. The name to escape. The escaped name. This method handles surrogate pairs. Please see msdn documentation Renames the key at the specified to . The path to the key to rename. The new name of the key. Creates a new registry key or value at the specified . The path to the new key to create. The type is ignored because this provider only creates registry keys. The newItem is ignored because the provider creates the key based on the path. Removes the specified registry key and all sub-keys The path to the key to remove. Ignored. All removes are recursive becuase the registry provider does not support filters. Determines if the key at the specified path exists. The path to the key to determine if it exists. True if the key at the specified path exists, false otherwise. Determines if the specified key has subkeys. The path to the key to determine if it has sub keys. True if the specified key has subkeys, false otherwise. Copies the specified registry key to the specified . The path of the registry key to copy. The path to copy the key to. If true all subkeys should be copied. If false, only the specified key should be copied. Determines if the key at the specified is a container. The path to a key. Since all registry keys are containers this method just checks to see if the key exists and returns true if it is does or false otherwise. Moves the specified key. The path of the key to move. The path to move the key to. Gets the properties of the item specified by the . The path to the item to retrieve properties from. A list of properties that should be retrieved. If this parameter is null or empty, all properties should be retrieved. Nothing. An instance of PSObject representing the properties that were retrieved should be passed to the WriteObject() method. Sets the specified properties of the item at the specified . The path to the item to set the properties on. A PSObject which contains a collection of the name, type, value of the properties to be set. Nothing. An instance of PSObject representing the properties that were set should be passed to the WriteObject() method. Gives the provider a chance to attach additional parameters to the get-itemproperty cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. A PSObject which contains a collection of the name, type, value of the properties to be set. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. Clears a property of the item at the specified . The path to the item on which to clear the property. The name of the property to clear. Gives the provider a chance to attach additional parameters to the get-itemproperty cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. A list of properties that should be retrieved. If this parameter is null or empty, all properties should be retrieved. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. Gives the provider a chance to attach additional parameters to the clear-itemproperty cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. The name of the property to clear. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. Creates a new property on the specified item The path to the item on which the new property should be created. The name of the property that should be created. The type of the property that should be created. The new value of the property that should be created. Nothing. A PSObject representing the property that was created should be passed to the WriteObject() method. Removes a property on the item specified by the path. The path to the item on which the property should be removed. The name of the property to be removed. Implement this method when you are providing access to a data store that allows dynamic removal of properties. Renames a property of the item at the specified . The path to the item on which to rename the property. The property to rename. The new name of the property. Nothing. A PSObject that represents the property that was renamed should be passed to the WriteObject() method. Copies a property of the item at the specified to a new property on the destination . The path to the item on which to copy the property. The name of the property to copy. The path to the item on which to copy the property to. The destination property to copy to. Nothing. A PSObject that represents the property that was copied should be passed to the WriteObject() method. Moves a property on an item specified by . The path to the item on which to move the property. The name of the property to move. The path to the item on which to move the property to. The destination property to move to. Nothing. A PSObject that represents the property that was moved should be passed to the WriteObject() method. Gets the parent path of the given . The path to get the parent of. The root of the drive. The parent path of the given path. Since the base class implementation of GetParentPath of HKLM:\foo would return HKLM: we must add the \ back on. Gets the child name for the given . The path to get the leaf element of. The leaf element of the given path. Since the base class implementation of GetChildName will return normalized paths (with \), we must change them to forward slashes.. Gives the provider a chance to attach additional parameters to the new-itemproperty cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. The name of the property that should be created. The type of the property that should be created. The new value of the property that should be created. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. Gives the provider a chance to attach additional parameters to the remove-itemproperty cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. The name of the property that should be removed. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. Gives the provider a chance to attach additional parameters to the rename-itemproperty cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. The property to rename. The new name of the property. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. Gives the provider a chance to attach additional parameters to the copy-itemproperty cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. The name of the property to copy. The path to the item on which to copy the property to. The destination property to copy to. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. Gives the provider a chance to attach additional parameters to the move-itemproperty cmdlet. If the path was specified on the command line, this is the path to the item to get the dynamic parameters for. The name of the property to copy. The path to the item on which to copy the property to. The destination property to copy to. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. Converts all / in the path to \ The path to normalize. The path with all / normalized to \ IT resets the a registry key value to its default Key whose value has to be reset name of the value to reset default value the key was set to checks if the given path is the top container path (the one containing the hives) path to check true if the path is empty, a \ or a /, else false checks the container. if the container is the hive container (Registry::\) it throws an exception path to check false if the operation is not allowed checks the container. if the container is the hive container (Registry::\) it throws an exception source path to check destination path to check Gets the appropriate hive root name for the specified path. The path to get the hive root name from. A registry key for the hive root specified by the path. Creates the parent for the keypath specified by . RegistryKey path True if key is created or already exist,False otherwise. This method wont call ShouldProcess. Callers should do this before calling this method. A private helper method that retrieves a RegistryKey for the specified path and if an exception is thrown retrieving the key, an error is written and null is returned. The path to the registry key to retrieve. If write access is required the key then this should be true. If false, the key will be opened with read access only. The RegistryKey associated with the specified path. A private helper method that retrieves a RegistryKey for the specified path. The path to the registry key to retrieve. If write access is required the key then this should be true. If false, the key will be opened with read access only. The RegistryKey associated with the specified path. Sets or creates a registry value on a key. The key to set or create the value on. The name of the value to set or create. The new data for the value. The RegistryValueKind of the value. The path to the key that the value is being set on. Sets or creates a registry value on a key. The key to set or create the value on. The name of the value to set or create. The new data for the value. The RegistryValueKind of the value. The path to the key that the value is being set on. If true, the value that is set will be written out. helper to wrap property values when sent to the pipeline into an PSObject; it adds the name of the property as a note. The property to be written Name of the property being written The path of the item being written Uses LanguagePrimitives.ConvertTo to convert the value to the type that is appropriate for the specified RegistryValueKind The value to convert. The RegistryValueKind type to convert the value to. The converted value. helper to infer the RegistryValueKind from an object object whose RegistryValueKind has to be determined corresponding RegistryValueKind Helper to get RegistryValueKind for a Property RegistryKey containing property Property for which RegistryValueKind is requested RegistryValueKind of the property. If the property does not exit,returns RegsitryValueKind.Unknown helper to read back an existing registry key value key to read the value from name of the value to read value of the key, null if it could not retrieve it because known exceptions were thrown, else an exception is percolated up Wraps a registry item in a PSObject and sets the TreatAs to Microsoft.Win32.RegistryKey. This way values will be presented in the same format as keys The registry key to be written out. The path to the item being written out. Takes a string and tries to parse it into a RegistryValueKind enum type. If the conversion fails, WriteError() is called The type as specified by the user that should be parsed into a RegistryValueKind enum. output for the RegistryValueKind for the string true if the conversion succeded Gets the default value name token from the resource. In English that token is "(default)" without the quotes. A string containing the default value name. Converts an empty or null userEnteredPropertyName to the localized string for the default property name. The property name to convert. If userEnteredPropertyName is null or empty, the localized default property name is returned, else the userEnteredPropertyName is returned. Gets the security descriptor for the item specified by . The path to the item. Specifies the parts of a security descriptor to retrieve. Nothing. An object that represents the security descriptor for the item specified by path is written to the WriteSecurityDescriptorObject method. Sets the security descriptor for the item specified by The path to the item to set the security descriptor on. The new security descriptor for the item. Creates a new empty security descriptor. The path to the item whose type is to be used when creating a new descriptor. Specifies the parts of a security descriptor to create. An instance of object. and are not used by this method. Creates a new empty security descriptor. The type of item associated with this security descriptor Specifies the parts of a security descriptor to create. An instance of object. Defines dynamic parameters for the registry provider Gets or sets the Type parameter as a dynamic parameter for the registry provider's SetItem method The only acceptable values for this parameter are those found in the RegistryValueKind enum The content reader/writer for all providers deriving from SessionStateProviderBase Constructs a content reader/writer for the specified provider using the specified path to read or write the content The path to the session state item which the content will be read or written. The SessionStateProviderBase derived provider that the content will be read or written from/to. if is null or empty. If is null. Reads the content from the item The number of "blocks" of data to be read from the item. An array of the blocks of data read from the item. A "block" of content is provider specific. For the file system a "block" may be considered a byte, a character, or delimited string. Writes content to the item. An array of content "blocks" to be written to the item. The blocks of content that were successfully written to the item. A "block" of content is provider specific. For the file system a "block" may be considered a byte, a character, or delimited string. None of the derived providers supports seeking for V1 so this always throws a NotSupportedException ignored ignored This exception is always thrown. Closes the reader. None of the derived providers need to close their reader so do nothing. Closes the reader. None of the derived providers need to close their reader so do nothing. This provider is the data accessor for shell variables. It uses the HashtableProvider as the base class to get a hashtable as a data store. Gets the name of the provider The constructor for the provider that exposes variables to the user as drives. Initializes the variables drive An array of a single PSDriveInfo object representing the variables drive. Gets a variable from session state The name of the variable to retrieve. A PSVariable that represents the variable. Sets the variable of the specified name to the specified value The name of the variable to set. The new value for the variable. If true, the item that was set should be written to WriteItemObject. Removes the specified variable from session state. The name of the variable to remove from session state. Gets a flattened view of the variables in session state An IDictionary representing the flattened view of the variables in session state. Gets the value of the item that is returned from GetItem by extracting the PSVariable value. The item to extract the value from. The value of the specified item. Determines if the item can be renamed. Derived classes that need to perform a check should override this method. The item to verify if it can be renamed. true if the item can be renamed or false otherwise. Registry encapsulation. Contains members representing all top level system keys. @security(checkClassLinking=on) Current User Key. This key should be used as the root for all user specific settings. TransactedRegistry.CurrentUser This static method returns a TransactedRegistryKey object that represents the base key HKEY_CURRENT_USER. Because it is a base key, there is no transaction associated with the returned TransactedRegistryKey. This means that values modified using the returned TransactedRegistryKey are NOT modified within a transaction. However, if the returned TransactedRegistryKey is used to create, open, or delete subkeys, there must be a Transaction.Current and the resulting TransactedRegistryKey from those operations ARE associated with the transaction. Local Machine Key. This key should be used as the root for all machine specific settings. TransactedRegistry.LocalMachine This static method returns a TransactedRegistryKey object that represents the base key HKEY_LOCAL_MACHINE. Because it is a base key, there is no transaction associated with the returned TransactedRegistryKey. This means that values modified using the returned TransactedRegistryKey are NOT modified within a transaction. However, if the returned TransactedRegistryKey is used to create, open, or delete subkeys, there must be a Transaction.Current and the resulting TransactedRegistryKey from those operations ARE associated with the transaction. Classes Root Key. This is the root key of class information. TransactedRegistry.ClassesRoot This static method returns a TransactedRegistryKey object that represents the base key HKEY_CLASSES_ROOT. Because it is a base key, there is no transaction associated with the returned TransactedRegistryKey. This means that values modified using the returned TransactedRegistryKey are NOT modified within a transaction. However, if the returned TransactedRegistryKey is used to create, open, or delete subkeys, there must be a Transaction.Current and the resulting TransactedRegistryKey from those operations ARE associated with the transaction. Users Root Key. This is the root of users. TransactedRegistry.Users This static method returns a TransactedRegistryKey object that represents the base key HKEY_USERS. Because it is a base key, there is no transaction associated with the returned TransactedRegistryKey. This means that values modified using the returned TransactedRegistryKey are NOT modified within a transaction. However, if the returned TransactedRegistryKey is used to create, open, or delete subkeys, there must be a Transaction.Current and the resulting TransactedRegistryKey from those operations ARE associated with the transaction. Current Config Root Key. This is where current configuration information is stored. TransactedRegistry.CurrentConfig This static method returns a TransactedRegistryKey object that represents the base key HKEY_CURRENT_CONFIG. Because it is a base key, there is no transaction associated with the returned TransactedRegistryKey. This means that values modified using the returned TransactedRegistryKey are NOT modified within a transaction. However, if the returned TransactedRegistryKey is used to create, open, or delete subkeys, there must be a Transaction.Current and the resulting TransactedRegistryKey from those operations ARE associated with the transaction. Registry encapsulation. To get an instance of a TransactedRegistryKey use the Registry class's static members then call OpenSubKey. @see Registry @security(checkDllCalls=off) @security(checkClassLinking=on) Creates a TransactedRegistryKey. This key is bound to hkey, if writable is false then no write operations will be allowed. If systemkey is set then the hkey won't be released when the object is GC'ed. TransactedRegistryKey.Close Closes this key, flushes it to disk if the contents have been modified. Utilizes Transaction.Current for its transaction. TransactedRegistryKey.Flush Flushes this key. Utilizes Transaction.Current for its transaction. TransactedRegistryKey.Dispose Disposes this key. Utilizes Transaction.Current for its transaction. Creates a new subkey, or opens an existing one. Utilizes Transaction.Current for its transaction. Name or path to subkey to create or open. Cannot be null or an empty string, otherwise an ArgumentException is thrown. A TransactedRegistryKey object for the subkey, which is associated with Transaction.Current. returns null if the operation failed. Creates a new subkey, or opens an existing one. Utilizes Transaction.Current for its transaction. Name or path to subkey to create or open. Cannot be null or an empty string, otherwise an ArgumentException is thrown. One of the Microsoft.Win32.RegistryKeyPermissionCheck values that specifies whether the key is opened for read or read/write access. A TransactedRegistryKey object for the subkey, which is associated with Transaction.Current. returns null if the operation failed. Creates a new subkey, or opens an existing one. Utilizes Transaction.Current for its transaction. Name or path to subkey to create or open. Cannot be null or an empty string, otherwise an ArgumentException is thrown. One of the Microsoft.Win32.RegistryKeyPermissionCheck values that specifies whether the key is opened for read or read/write access. A TransactedRegistrySecurity object that specifies the access control security for the new key. A TransactedRegistryKey object for the subkey, which is associated with Transaction.Current. returns null if the operation failed. Deletes the specified subkey. Will throw an exception if the subkey has subkeys. To delete a tree of subkeys use, DeleteSubKeyTree. Utilizes Transaction.Current for its transaction. The subkey to delete. Thrown if the subkey as child subkeys. Deletes the specified subkey. Will throw an exception if the subkey has subkeys. To delete a tree of subkeys use, DeleteSubKeyTree. Utilizes Transaction.Current for its transaction. The subkey to delete. Specify true if an ArgumentException should be thrown if the specified subkey does not exist. If false is specified, a missing subkey does not throw an exception. Thrown if the subkey as child subkeys. Thrown if true is specified for throwOnMissingSubKey and the specified subkey does not exist. Recursively deletes a subkey and any child subkeys. Utilizes Transaction.Current for its transaction. The subkey to delete. Deletes the specified value from this key. Utilizes Transaction.Current for its transaction. Name of the value to delete. Deletes the specified value from this key. Utilizes Transaction.Current for its transaction. Name of the value to delete. Specify true if an ArgumentException should be thrown if the specified value does not exist. If false is specified, a missing value does not throw an exception. Retrieves a new TransactedRegistryKey that represents the requested key. Valid values are: HKEY_CLASSES_ROOT, HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE, HKEY_USERS, HKEY_PERFORMANCE_DATA, HKEY_CURRENT_CONFIG, HKEY_DYN_DATA. @param hKey HKEY_* to open. @return the TransactedRegistryKey requested. Retrieves a subkey. If readonly is true, then the subkey is opened with read-only access. Utilizes Transaction.Current for its transaction. Name or path of the subkey to open. Set to true of you only need readonly access. The subkey requested or null if the operation failed. Retrieves a subkey. Utilizes Transaction.Current for its transaction. Name or path of the subkey to open. One of the Microsoft.Win32.RegistryKeyPermissionCheck values that specifies whether the key is opened for read or read/write access. The subkey requested or null if the operation failed. Retrieves a subkey. Utilizes Transaction.Current for its transaction. Name or path of the subkey to open. One of the Microsoft.Win32.RegistryKeyPermissionCheck values that specifies whether the key is opened for read or read/write access. A bitwise combination of Microsoft.Win32.RegistryRights values that specifies the desired security access. The subkey requested or null if the operation failed. Retrieves a subkey for readonly access. Utilizes Transaction.Current for its transaction. Name or path of the subkey to open. The subkey requested or null if the operation failed. Retrieves an array of strings containing all the subkey names. Utilizes Transaction.Current for its transaction. A string array containing all the subkey names. Retrieves an array of strings containing all the value names. Utilizes Transaction.Current for its transaction. All the value names. Retrieves the specified value. null is returned if the value doesn't exist. Utilizes Transaction.Current for its transaction. Note that name can be null or "", at which point the unnamed or default value of this Registry key is returned, if any. Name of value to retrieve. The data associated with the value. Retrieves the specified value. null is returned if the value doesn't exist. Utilizes Transaction.Current for its transaction. Note that name can be null or "", at which point the unnamed or default value of this Registry key is returned, if any. Name of value to retrieve. Value to return if name doesn't exist. The data associated with the value. Retrieves the specified value. null is returned if the value doesn't exist. Utilizes Transaction.Current for its transaction. Note that name can be null or "", at which point the unnamed or default value of this Registry key is returned, if any. Name of value to retrieve. Value to return if name doesn't exist. One of the Microsoft.Win32.RegistryValueOptions values that specifies optional processing of the retrieved value. The data associated with the value. Retrieves the registry data type of the value associated with the specified name. Utilizes Transaction.Current for its transaction. The value name whose data type is to be retrieved. A RegistryValueKind value representing the registry data type of the value associated with name. Retrieves the current state of the dirty property. A key is marked as dirty if any operation has occured that modifies the contents of the key. @return true if the key has been modified. Sets the specified value. Utilizes Transaction.Current for its transaction. Name of value to store data in. Data to store. Sets the specified value. Utilizes Transaction.Current for its transaction. Name of value to store data in. Data to store. The registry data type to use when storing the data. Retrieves a string representation of this key. @return a string representing the key. Retrieves a string representation of this key. A string representing the key. Returns the access control security for the current registry key. Utilizes Transaction.Current for its transaction. A TransactedRegistrySecurity object that describes the access control permissions on the registry key represented by the current TransactedRegistryKey. Returns the access control security for the current registry key. Utilizes Transaction.Current for its transaction. A bitwise combination of AccessControlSections values that specifies the type of security information to get. A TransactedRegistrySecurity object that describes the access control permissions on the registry key represented by the current TransactedRegistryKey. Applies Windows access control security to an existing registry key. Utilizes Transaction.Current for its transaction. A TransactedRegistrySecurity object that specifies the access control security to apply to the current subkey. After calling GetLastWin32Error(), it clears the last error field, so you must save the HResult and pass it to this method. This method will determine the appropriate exception to throw dependent on your error, and depending on the error, insert a string into the message gotten from the ResourceManager. Retrieves the count of subkeys. Utilizes Transaction.Current for its transaction. The count of subkeys. Retrieves the count of values. Utilizes Transaction.Current for its transaction. A count of values. Retrieves the name of the key. The name of the key. Win32 encapsulation for MSCORLIB. Get information on a named code page Retrieves the current process token. process handle token access process token The current process token. The LookupPrivilegeValue function retrieves the locally unique identifier (LUID) used on a specified system to locally represent the specified privilege name. The PrivilegeCheck function determines whether a specified privilege is enabled in an access token. The AdjustTokenPrivileges function enables or disables privileges in the specified access token. Enabling or disabling privileges in an access token requires TOKEN_ADJUST_PRIVILEGES access. The TOKEN_ADJUST_PRIVILEGES and TOKEN_QUERY accesses are gained when calling the OpenProcessToken function. Get the pseudo handler of the current process Represents a set of access rights allowed or denied for a user or group. This class cannot be inherited. Initializes a new instance of the RegistryAccessRule class, specifying the user or group the rule applies to, the access rights, and whether the specified access rights are allowed or denied. The user or group the rule applies to. Must be of type SecurityIdentifier or a type such as NTAccount that can be converted to type SecurityIdentifier. A bitwise combination of Microsoft.Win32.RegistryRights values indicating the rights allowed or denied. One of the AccessControlType values indicating whether the rights are allowed or denied. Initializes a new instance of the RegistryAccessRule class, specifying the user or group the rule applies to, the access rights, and whether the specified access rights are allowed or denied. The name of the user or group the rule applies to. A bitwise combination of Microsoft.Win32.RegistryRights values indicating the rights allowed or denied. One of the AccessControlType values indicating whether the rights are allowed or denied. Initializes a new instance of the RegistryAccessRule class, specifying the user or group the rule applies to, the access rights, and whether the specified access rights are allowed or denied. The user or group the rule applies to. Must be of type SecurityIdentifier or a type such as NTAccount that can be converted to type SecurityIdentifier. A bitwise combination of Microsoft.Win32.RegistryRights values indicating the rights allowed or denied. A bitwise combination of InheritanceFlags flags specifying how access rights are inherited from other objects. A bitwise combination of PropagationFlags flags specifying how access rights are propagated to other objects. One of the AccessControlType values indicating whether the rights are allowed or denied. Initializes a new instance of the RegistryAccessRule class, specifying the user or group the rule applies to, the access rights, and whether the specified access rights are allowed or denied. The name of the user or group the rule applies to. A bitwise combination of Microsoft.Win32.RegistryRights values indicating the rights allowed or denied. A bitwise combination of InheritanceFlags flags specifying how access rights are inherited from other objects. A bitwise combination of PropagationFlags flags specifying how access rights are propagated to other objects. One of the AccessControlType values indicating whether the rights are allowed or denied. Gets the rights allowed or denied by the access rule. Represents a set of access rights to be audited for a user or group. This class cannot be inherited. Initializes a new instance of the RegistryAuditRule class, specifying the user or group to audit, the rights to audit, whether to take inheritance into account, and whether to audit success, failure, or both. The user or group the rule applies to. Must be of type SecurityIdentifier or a type such as NTAccount that can be converted to type SecurityIdentifier. A bitwise combination of RegistryRights values specifying the kinds of access to audit. A bitwise combination of InheritanceFlags values specifying whether the audit rule applies to subkeys of the current key. A bitwise combination of PropagationFlags values that affect the way an inherited audit rule is propagated to subkeys of the current key. A bitwise combination of AuditFlags values specifying whether to audit success, failure, or both. Initializes a new instance of the RegistryAuditRule class, specifying the user or group to audit, the rights to audit, whether to take inheritance into account, and whether to audit success, failure, or both. The name of the user or group the rule applies to. A bitwise combination of RegistryRights values specifying the kinds of access to audit. A bitwise combination of InheritanceFlags values specifying whether the audit rule applies to subkeys of the current key. A bitwise combination of PropagationFlags values that affect the way an inherited audit rule is propagated to subkeys of the current key. A bitwise combination of AuditFlags values specifying whether to audit success, failure, or both. Gets the access rights affected by the audit rule. Represents the Windows access control security for a registry key. This class cannot be inherited. This class is specifically to be used with TransactedRegistryKey. Initializes a new instance of the TransactedRegistrySecurity class with default values. Creates a new access control rule for the specified user, with the specified access rights, access control, and flags. An IdentityReference that identifies the user or group the rule applies to. A bitwise combination of RegistryRights values specifying the access rights to allow or deny, cast to an integer. A Boolean value specifying whether the rule is inherited. A bitwise combination of InheritanceFlags values specifying how the rule is inherited by subkeys. A bitwise combination of PropagationFlags values that modify the way the rule is inherited by subkeys. Meaningless if the value of inheritanceFlags is InheritanceFlags.None. One of the AccessControlType values specifying whether the rights are allowed or denied. A TransactedRegistryAccessRule object representing the specified rights for the specified user. Creates a new audit rule, specifying the user the rule applies to, the access rights to audit, the inheritance and propagation of the rule, and the outcome that triggers the rule. An IdentityReference that identifies the user or group the rule applies to. A bitwise combination of RegistryRights values specifying the access rights to audit, cast to an integer. A Boolean value specifying whether the rule is inherited. A bitwise combination of InheritanceFlags values specifying how the rule is inherited by subkeys. A bitwise combination of PropagationFlags values that modify the way the rule is inherited by subkeys. Meaningless if the value of inheritanceFlags is InheritanceFlags.None. A bitwise combination of AuditFlags values specifying whether to audit successful access, failed access, or both. A TransactedRegistryAuditRule object representing the specified audit rule for the specified user, with the specified flags. The return type of the method is the base class, AuditRule, but the return value can be cast safely to the derived class. Searches for a matching access control with which the new rule can be merged. If none are found, adds the new rule. The access control rule to add. Removes all access control rules with the same user and AccessControlType (allow or deny) as the specified rule, and then adds the specified rule. The TransactedRegistryAccessRule to add. The user and AccessControlType of this rule determine the rules to remove before this rule is added. Removes all access control rules with the same user as the specified rule, regardless of AccessControlType, and then adds the specified rule. The TransactedRegistryAccessRule to add. The user specified by this rule determines the rules to remove before this rule is added. Searches for an access control rule with the same user and AccessControlType (allow or deny) as the specified access rule, and with compatible inheritance and propagation flags; if such a rule is found, the rights contained in the specified access rule are removed from it. A TransactedRegistryAccessRule that specifies the user and AccessControlType to search for, and a set of inheritance and propagation flags that a matching rule, if found, must be compatible with. Specifies the rights to remove from the compatible rule, if found. Searches for all access control rules with the same user and AccessControlType (allow or deny) as the specified rule and, if found, removes them. A TransactedRegistryAccessRule that specifies the user and AccessControlType to search for. Any rights, inheritance flags, or propagation flags specified by this rule are ignored. Searches for an access control rule that exactly matches the specified rule and, if found, removes it. The TransactedRegistryAccessRule to remove. Searches for an audit rule with which the new rule can be merged. If none are found, adds the new rule. The audit rule to add. The user specified by this rule determines the search. Removes all audit rules with the same user as the specified rule, regardless of the AuditFlags value, and then adds the specified rule. The TransactedRegistryAuditRule to add. The user specified by this rule determines the rules to remove before this rule is added. Searches for an audit control rule with the same user as the specified rule, and with compatible inheritance and propagation flags; if a compatible rule is found, the rights contained in the specified rule are removed from it. A TransactedRegistryAuditRule that specifies the user to search for, and a set of inheritance and propagation flags that a matching rule, if found, must be compatible with. Specifies the rights to remove from the compatible rule, if found. Searches for all audit rules with the same user as the specified rule and, if found, removes them. A TransactedRegistryAuditRule that specifies the user to search for. Any rights, inheritance flags, or propagation flags specified by this rule are ignored. Searches for an audit rule that exactly matches the specified rule and, if found, removes it. The TransactedRegistryAuditRule to be removed. Gets the enumeration type that the TransactedRegistrySecurity class uses to represent access rights. A Type object representing the RegistryRights enumeration. Gets the type that the TransactedRegistrySecurity class uses to represent access rules. A Type object representing the TransactedRegistryAccessRule class. Gets the type that the TransactedRegistrySecurity class uses to represent audit rules. A Type object representing the TransactedRegistryAuditRule class. Defines the valid types of MSH credentials. Used by PromptForCredential calls. Generic credentials. Credentials valid for a domain. Default credentials. Defines the options available when prompting for credentials. Used by PromptForCredential calls. Validates the username, but not its existence or correctness. Performs no validation. Validates the username, but not its existence. or correctness Always prompt, even if a persisted credential was available. Username is read-only, and the user may not modify it. Declare a delegate which returns the encryption key and initialization vector for symmetric encryption algorithem. The streaming context, which contains the searilization context. Symmetric encryption key. symmetric encryption initialization vector. Offers a centralized way to manage usernames, passwords, and credentials. GetObjectData PSCredential Initializes a new instance of the PSCredential class with a username and password. User's name. User's password. Initializes a new instance of the PSCredential class. Returns an equivalent NetworkCredential object for this PSCredential. A null is returned if -- current object has not been initialized -- current creds are not compatible with NetworkCredential (such as smart card creds or cert creds) null if the current object has not been initialized. null if the current credentials are incompatible with a NetworkCredential -- such as smart card credentials. the appropriate network credential for this PSCredential otherwise. Provides an explicit cast to get a NetworkCredential from this PSCredential. PSCredential to convert. null if the current object has not been initialized. null if the current credentials are incompatible with a NetworkCredential -- such as smart card credentials. the appropriate network credential for this PSCredential otherwise. Parse a string that represents a fully qualified username to verify that it is syntactically valid. We only support two formats: -- domain\user -- user@domain for any other format, we simply treat the entire string as user name and set domain name to "". Split a given string into its user and domain components. Supported formats are: -- domain\user -- user@domain With any other format, the entire input is treated as user name and domain is set to "". In any case, the function does not check if the split string are really valid as user or domain names. Gets or sets a delegate which returns the encryption key and initialization vector for symmetric encryption algorithm. User's name. User's password. Gets an empty PSCredential. This is an PSCredential with both UserName and Password initialized to null. This is a wrapper for exception class SecurityException Recommended constructor for class PSSecurityException constructed object Serialization constructor for class PSSecurityException serialization information streaming context constructed object Constructor for class PSSecurityException constructed object Constructor for class PSSecurityException constructed object Gets the ErrorRecord information for this exception. Exception.Message is get-only, but you can effectively set it in a subclass by overriding this virtual property. Provides the *-SecurityDescriptor noun for the cmdlet providers. Hide the default constructor since we always require an instance of SessionState. Initializes a new instance of the SecurityDescriptorCmdletProviderIntrinsics class, using the Cmdlet parameter to obtain access to the SessionState APIs. An instance of the cmdlet. Initializes a new instance of the SecurityDescriptorCmdletProviderIntrinsics class, using the sessionState parameter to obtain access to the SessionState APIs. An instance of the real session state class. Gets the SecurityDescriptor at the specified path, including only the specified AccessControlSections. The path of the item to retrieve. It may be a drive or provider-qualified path and may include. glob characters. The sections of the security descriptor to include. The SecurityDescriptor(s) at the specified path. Gets the SecurityDescriptor at the specified path, including only the specified AccessControlSections, using the provided Context. The path of the item to retrieve. It may be a drive or provider-qualified path and may include glob characters. The sections of the security descriptor to include. The context under which the command is running. Nothing. The object(s) at the specified path are written to the context. Sets the provided SecurityDescriptor at the specified path. The path of the item to set. It may be a drive or provider-qualified path and may include glob characters. The new security descriptor to set. The SecurityDescriptor(s) set at the specified path. Sets the SecurityDescriptor at the specified path, using the provided Context. The path of the item to set. It may be a drive or provider-qualified path and may include glob characters. The new security descriptor to set. The context under which the command is running. Nothing. The object(s) set at the specified path are written to the context. Creates a new SecurityDescriptor from the item at the specified path, including only the specified AccessControlSections. The path of the item to retrieve. It may be a drive or provider-qualified path and may include glob characters. The sections of the security descriptor to include. The SecurityDescriptor(s) at the specified path. Creates a new SecurityDescriptor from the specified provider and of the given type, including only the specified AccessControlSections. The name of the provider. The type of the item which corresponds to the security descriptor that we want to create. The sections of the security descriptor to include. A new SecurityDescriptor of the specified type. This enum defines the dispatch origin of a command. The command was submitted via a runspace. The command was dispatched by the msh engine as a result of a dispatch request from an already running command. Defines the base class for an authorization manager of a Runspace. An authorization manager helps a host control and restrict the execution of commands. For each of the command types listed in the enumeration, the engine requests permission from the AuthorizationManager to run the command. Extending this class requires that you override the ShouldRun method with the logic specific to your needs. The base class gives permission to run every command. The default Microsoft.PowerShell.PSAuthorizationManager provides a customized and much more complete authorization policy. Creates an instance of authorization manager using specified shellID determine if we should run the specified file info on entity to be run the dispatch origin of a command allows access to the host. This method throws SecurityException in case running is not allowed. If the derived security manager threw an exception or returned false with a reason. Determines if the host should run the command a specified by the CommandInfo parameter. The default implementation gives permission to run every command. Information about the command to be run The origin of the command The host running the command The reason for preventing execution, if applicable True if the host should run the command. False otherwise Get the shell ID from the authorization manager... Holds the state of a Monad Shell session Holds the state of a Monad Shell session Holds the state of a Monad Shell session Holds the state of a Monad Shell session Holds the state of a Monad Shell session Holds the state of a Monad Shell session Holds the state of a Monad Shell session Holds the state of a Monad Shell session Holds the state of a Monad Shell session Holds the state of a Monad Shell session Holds the state of a Monad Shell session Holds the state of a Monad Shell session Holds the state of a Monad Shell session Holds the state of a PowerShell session Holds the state of a Monad Shell session Holds the state of a Monad Shell session Gets an instance of an ISecurityDescriptorCmdletProvider given the provider ID. An instance of a CmdletProvider. An instance of a ISecurityDescriptorCmdletProvider for the specified provider ID. ArgumentNullException if providerId is null. NotSupportedException if the providerId is not for a provider that is derived from ISecurityDescriptorCmdletProvider. Gets the security descriptor from the specified item. The path to the item to retrieve the security descriptor from. Specifies the parts of a security descriptor to retrieve. The security descriptor for the item at the sepecified path. Gets the security descriptor from the specified item. The path to the item to retrieve the security descriptor from. Specifies the parts of a security descriptor to retrieve. The context which the core command is running. Nothing. The security descriptor for the item at the sepecified path is written to the context. If does not contain glob characters and could not be found. Sets the security descriptor on the specified item. The path to the item to set the security descriptor on. The security descriptor to set on the item at the specified path. The security descriptor that was set on the item at the sepecified path. Sets the security descriptor on the specified item. The path to the item to set the security descriptor on. The security descriptor to set on the item at the specified path. The context which the core command is running. Nothing. The security descriptor that was set on the item at the sepecified path is written to the context. If does not contain glob characters and could not be found. Gets the security descriptor from the specified item. The path to the item to retrieve the security descriptor from. Specifies the parts of a security descriptor to retrieve. Nothing. The security descriptor for the item at the sepecified path is written to the context. If does not contain glob characters and could not be found. Gets the security descriptor from the specified item. The type of the item which corresponds to the security descriptor that we want to create. The name of the provider. Specifies the parts of a security descriptor to retrieve. Nothing. The security descriptor for the item at the sepecified type is written to the context. Gets the security descriptor from the specified item. The type of the item which corresponds to the security descriptor that we want to create. The type of the item which corresponds to the security descriptor that we want to create. Specifies the parts of a security descriptor to retrieve. Nothing. The security descriptor for the item at the sepecified type is written to the context. An instance of the PSTraceSource class used for trace output using "SessionState" as the category. Constructor for session state object The context for the runspace to which this session state object belongs. if is null. Add any special variables to the session state variable table. This routine must be called at construction time or if the variable table is reset. See if a script is allowed to be run. Path to check true if script is allowed Add an new SessionState cmdlet entry to this session state object... The entry to add Add an new SessionState cmdlet entry to this session state object... The entry to add If local, add cmdlet to current scope. Else, add to module scope Add an new SessionState cmdlet entry to this session state object... The entry to add Add an new SessionState cmdlet entry to this session state object... The entry to add Add the variables that must always be present in a SessionState instance... Set the $Console variable in this session state instance... Add all of the default built-in functions to this session state instance... Add the built-in variables to this instance of session state... Add the built-in functions to this instance of session state... Add the built-in aliases to this instance of session state... Check to see if an application is allowed to be run. The path to the application to check True if application is permitted. Notification for SessionState to do cleanup before runspace is closed. Constructs a new instance of a ProviderInvocationException using the specified data The resource ID to use as the format message for the error. This is the message template string. The provider information used when formatting the error message. The path used when formatting the error message. The exception that was thrown by the provider. This will be set as the ProviderInvocationException's InnerException and the message will be used when formatting the error message. A new instance of a ProviderInvocationException. Wraps in a ProviderInvocationException and then throws it. Constructs a new instance of a ProviderInvocationException using the specified data The resource ID to use as the format message for the error. This is the message template string. The provider information used when formatting the error message. The path used when formatting the error message. The exception that was thrown by the provider. This will be set as the ProviderInvocationException's InnerException and the message will be used when formatting the error message. If true, the error record from the inner exception will be used if it contains one. If false, the error message specified by the resourceId will be used. A new instance of a ProviderInvocationException. Wraps in a ProviderInvocationException and then throws it. Add a new alias entry to this session state object... The entry to add Gets an IEnumerable for the alias table Gets an IEnumerable for the alias table for a given scope A scope identifier that is either one of the "special" scopes like "global", "script", "local", or "private, or a numeric ID of a relative scope to the current scope. If is less than zero, or not a number and not "script", "global", "local", or "private" If is less than zero or greater than the number of currently active scopes. Gets the value of the specified alias from the alias table. The name of the alias value to retrieve. The origin of the command calling this API. The AliasInfo representing the alias. Gets the value of the specified alias from the alias table. The name of the alias value to retrieve. The AliasInfo representing the alias. Gets the value of the specified alias from the alias table. The name of the alias value to retrieve. A scope identifier that is either one of the "special" scopes like "global", "script", "local", or "private, or a numeric ID of a relative scope to the current scope. The AliasInfo representing the alias. If is less than zero, or not a number and not "script", "global", "local", or "private" If is less than zero or greater than the number of currently active scopes. Sets the alias with specified name to the specified value in the current scope. The name of the alias to set. The value to set the alias to. If true, the value will be set even if the alias is ReadOnly. THe origin of the caller of this API The resulting AliasInfo for the alias that was set. If or is null or empty. If the alias is read-only or constant. If the maximum number of aliases has been reached for this scope. Sets the alias with specified name to the specified value in the current scope. BUGBUG: this overload only exists for the test suites. They should be cleaned up and this overload removed. The name of the alias to set. The value to set the alias to. If true, the value will be set even if the alias is ReadOnly. The resulting AliasInfo for the alias that was set. If or is null or empty. If the alias is read-only or constant. If the maximum number of aliases has been reached for this scope. Sets the alias with specified name to the specified value in the current scope. The name of the alias to set. The value to set the alias to. The options to set on the alias. If true, the value will be set even if the alias is ReadOnly. The origin of the caller of this API The resulting AliasInfo for the alias that was set. If or is null or empty. If the alias is read-only or constant. If the maximum number of aliases has been reached for this scope. Sets the alias with specified name to the specified value in the current scope. BUGBUG: this api only exists for the test suites. They should be fixed and it should be removed. The name of the alias to set. The value to set the alias to. The options to set on the alias. If true, the value will be set even if the alias is ReadOnly. The resulting AliasInfo for the alias that was set. If or is null or empty. If the alias is read-only or constant. If the maximum number of aliases has been reached for this scope. Sets the alias with specified name to the specified value in the current scope. The AliasInfo representing the alias. If true, the alias will be set even if there is an existing ReadOnly alias. Specifies the origin of the comannd setting the alias. The resulting AliasInfo for the alias that was set. If is null. If the alias is read-only or constant. If the maximum number of aliases has been reached for this scope. Sets the alias with specified name to the specified value in the current scope. The AliasInfo representing the alias. A scope identifier that is either one of the "special" scopes like "global", "script", "local", or "private, or a numeric ID of a relative scope to the current scope. If true, the alias will be set even if there is an existing ReadOnly alias. Specifies the command origin of the calling command. The resulting AliasInfo for the alias that was set. If is less than zero, or not a number and not "script", "global", "local", or "private" If is less than zero or greater than the number of currently active scopes. If is null. If the alias is read-only or constant. If the maximum number of aliases has been reached for this scope. Sets the alias with specified name to the specified value in the current scope. The AliasInfo representing the alias. A scope identifier that is either one of the "special" scopes like "global", "script", "local", or "private, or a numeric ID of a relative scope to the current scope. If true, the alias will be set even if there is an existing ReadOnly alias. The resulting AliasInfo for the alias that was set. If is less than zero, or not a number and not "script", "global", "local", or "private" If is less than zero or greater than the number of currently active scopes. If is null. If the alias is read-only or constant. If the maximum number of aliases has been reached for this scope. Removes the specified alias. The name of the alias to remove. If true the alias will be removed even if its ReadOnly. If is null or empty. If the alias is constant. Gets the alises by command name (used by metadata-driven help) Gets the value of the specified cmdlet from the cmdlet table. The name of the cmdlet value to retrieve. The CmdletInfo representing the cmdlet. Gets the value of the specified cmdlet from the cmdlet table. The name of the cmdlet value to retrieve. The origin of hte command trying to retrieve this cmdlet. The CmdletInfo representing the cmdlet. Gets the value of the specified cmdlet from the cmdlet table. The name of the cmdlet value to retrieve. A scope identifier that is either one of the "special" scopes like "global", "script", "local", or "private, or a numeric ID of a relative scope to the current scope. The CmdletInfo representing the cmdlet. If is less than zero, or not a number and not "script", "global", "local", or "private" If is less than zero or greater than the number of currently active scopes. Gets an IEnumerable for the cmdlet table Gets an IEnumerable for the cmdlet table for a given scope A scope identifier that is either one of the "special" scopes like "global", "script", "local", or "private, or a numeric ID of a relative scope to the current scope. If is less than zero, or not a number and not "script", "global", "local", or "private" If is less than zero or greater than the number of currently active scopes. Removes a cmdlet from the function table. The name of the cmdlet to remove. The name of the cmdlet to remove. THe origin of the caller of this API If true, the cmdlet is removed even if it is ReadOnly. If is null or empty. If the function is constant. Removes a cmdlet entry from the cmdlet table. The name of the cmdlet entry to remove. If true, the cmdlet is removed even if it is ReadOnly. If is null or empty. If the function is constant. Determines if the monad virtual namespace path exists. The path to the object to determine if it exists. Passed on to providers to force operations. If true, globbing is not done on paths. true if the object specified by path exists, false otherwise. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Determines if the monad virtual namespace path exists. The path to the object to determine if it exists. The context which the core command is running. true if the object specified by path exists, false otherwise. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Determines if the item at the specified path exists The provider instance to use. The path to the item if it was specified on the command line. The context which the core command is running. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Gets the dynamic parameters for the test-path cmdlet. The path to the item if it was specified on the command line. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If does not contain glob characters and could not be found. Gets the dynamic parameters for the test-path cmdlet. The path to the item if it was specified on the command line. The instance of the provider to use. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Determines if the MSH path is a syntactically and semantically valid path for the provider. The path to validate. true if the object specified by path is syntactically and semantically valid, false otherwise. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Determines if the MSH path is a syntactically and semantically valid path for the provider. The path to validate. The context which the core command is running. true if the object specified by path is syntactically and semantically valid, false otherwise. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Determines if the specified path is valid. The provider instance to use. The path to the item if it was specified on the command line. The context which the core command is running. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Determines if the monad virtual namespace path is a container. The path to the object to determine if it is a container. true if the object specified by path is a container, false otherwise. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Determines if the monad virtual namespace path is a container. The path to the object to determine if it is a container. The context which the core command is running. true if the object specified by path is a container, false otherwise. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Determines if the item at the specified path is a container. The provider instance to use. The path to the item if it was specified on the command line. The context which the core command is running. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Deletes the specified object A relative or absolute path to the object to be deleted. The delete should occur in all sub-containers of the specified path. Passed on to providers to force operations. If true, globbing is not done on paths. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Deletes the specified object A relative or absolute path to the object to be deleted. The delete should occur in all sub-containers of the specified path. The context which the core command is running. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If does not contain glob characters and could not be found. Internal remove item method that just calls the provider directly without globbing. The name of the provider to use. The path of the item to remove. True if all items should be removed recursively. The context under which the command is running. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Internal remove item method that just calls the provider directly without globbing. The instance of the provider to use. The path of the item to remove. True if all items should be removed recursively. The context under which the command is running. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the dynamic parameters for the remove-item cmdlet. The path to the item if it was specified on the command line. The delete should occur in all sub-containers of the specified path. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If does not contain glob characters and could not be found. Gets the dynamic parameters for the remove-item cmdlet. The path to the item if it was specified on the command line. If true, all items in the subtree should be removed. The instance of the provider to use. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Gets the children of the specified item. An array of relative or absolute paths to the object to get the children of. If true, gets all the children in all the sub-containers of the specified container. If false, only gets the immediate children of the specified container. Passed on to providers to force operations. If true, globbing is not done on paths. This method does not provider streaming of the results. If you want streaming then you must call the overload that takes a CmdletProviderContext. If or is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the children of the specified item. A relative or absolute path to the object to get the children of. If true, gets all the children in all the sub-containers of the specified container. If false, only gets the immediate children of the specified container. The context which the core command is running. If or is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If does not contain glob characters and could not be found. Gets the child items of the item at the specified path. The provider instance to use. The path to the item if it was specified on the command line. If true, all the child items in the subtree are returned. The context which the core command is running. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Since we can't do include and exclude filtering on items we have to do the recursion ourselves. We get each child name and see if it matches the include and exclude filters. If the child is a container we recurse into that container. The instance of the provider to use. The path to the item to get the children from. Recurse into sub-containers when getting children. The context under which the command is running. a hint used to skip IsItemContainer checks If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the dynamic parameters for the get-childitem cmdlet. The path to the item if it was specified on the command line. The delete should occur in all sub-containers of the specified path. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If does not contain glob characters and could not be found. Gets the dynamic parameters for the get-childitem cmdlet. The path to the item if it was specified on the command line. If true, all child items in the subtree should be returned. The instance of the provider to use. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Gets names of the children of the specified path. The paths to the items from which to retrieve the child names. Determines if all containers should be returned or only those containers that match the filter(s). If true, gets all the relative paths of all the children in all the sub-containers of the specified container. If false, only gets the immediate child names of the specified container. Passed on to providers to force operations. If true, globbing is not done on paths. An array of strings that contains the names of the children of the specified container. The child names are the leaf portion of the path. Example, for the file system the name for the path c:\windows\system32\foo.dll would be foo.dll or for the directory c:\windows\system32 would be system32. For Active Directory the child names would be RDN values of the child objects of the container. If or is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets names of the children of the specified path. The path to the item from which to retrieve the child names. Determines if all containers should be returned or only those containers that match the filter(s). If true, gets all the relative paths of all the children in all the sub-containers of the specified container. If false, only gets the immediate child names of the specified container. The context which the core command is running. Nothing is returned, but all names should be written to the context object. The child names are the leaf portion of the path. Example, for the file system the name for the path c:\windows\system32\foo.dll would be foo.dll or for the directory c:\windows\system32 would be system32. For Active Directory the child names would be RDN values of the child objects of the container. If or is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If does not contain glob characters and could not be found. Gets the child names of the item at the specified path by manually recursing through all the containers instead of allowing the provider to do the recursion. The provider instance to use. The path to the item if it was specified on the command line. The path the name is relative to. If true all names in the subtree should be returned. Determines if all containers should be returned or only those containers that match the filter(s). A set of filters that the names must match to be returned. A set of filters that the names cannot match to be returned. The context which the core command is running. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Gets the names of the children of the item at the specified path. The provider instance to use. The path to the item if it was specified on the command line. Determines if all containers should be returned or only those containers that match the filter(s). The context which the core command is running. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Gets the dynamic parameters for the get-childitem -name cmdlet. The path to the item if it was specified on the command line. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If does not contain glob characters and could not be found. Gets the dynamic parameters for the get-childitem -names cmdlet. The path to the item if it was specified on the command line. The instance of the provider to use. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Renames the item at the specified path to the new name provided. The path to the item to rename. The name to which the item should be renamed. This name should always be relative to the parent container. Passed on to providers to force operations. The item that was renamed at the specified path. If or is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Renames the item at the specified path to the new name provided. The path to the item to rename. The name to which the item should be renamed. This name should always be relative to the parent container. The context which the core command is running. Nothing. All items that are renamed are written into the context object. If or is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If does not contain glob characters and could not be found. Renames the item at the specified path. The provider instance to use. The path to the item if it was specified on the command line. The new name of the item. The context which the core command is running. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Gets the dynamic parameters for the rename-item cmdlet. The path to the item if it was specified on the command line. The name to which the item should be renamed. This name should always be relative to the parent container. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If does not contain glob characters and could not be found. Gets the dynamic parameters for the rename-item cmdlet. The path to the item if it was specified on the command line. The new name of the item. The instance of the provider to use. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Creates a new item at the specified path. The path(s) to the container(s) to create the item in. The name of the item to create. The provider specific type of the object to be created. The content of the new item to create. Passed on to providers to force operations. The item(s) that was created. If or is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Creates a new item at the specified path. The path(s) to the item(s) to create. The name of the item to create. The provider specific type of the item to be created. The content to create the new item with. The context which the core command is running. Nothing. The item created is written to the context object. If or is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If does not contain glob characters and could not be found. Creates a new item at the specified path. The provider instance to use. The path to the item if it was specified on the command line. The type of the item to create. The content of the item to create. The context which the core command is running. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Gets the dynamic parameters for the new-item cmdlet. The path to the item if it was specified on the command line. The provider specific type of the item to be created. The content to create the new item with. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If does not contain glob characters and could not be found. Gets the dynamic parameters for the new-item cmdlet. The path to the item if it was specified on the command line. The type of the new item. The value of the new item The instance of the provider to use. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Determines if the item at the specified path has children. The path to the item to see if it has children. Passed on to providers to force operations. If true, globbing is not done on paths. True if the item has children, false otherwise. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Determines if the item at the specified path has children. The path to the item to see if it has children. The context which the core command is running. True if the item has children, false otherwise. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If does not contain glob characters and could not be found. Determines if the item at the specified path has children. The provider to use. The path to the item if it was specified on the command line. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Determines if the item at the specified path has children. The provider to use. The path to the item if it was specified on the command line. The context under which the command is running. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Determines if the item at the specified path has children. The provider instance to use. The path to the item if it was specified on the command line. The context which the core command is running. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Copies an item at the specified path to an item at the . The path(s) of the item(s) to copy. The path of the item to copy to. Tells the provider to recurse sub-containers when copying. Determines how the source container is used in the copy operation. Passed on to providers to force operations. If true, globbing is not done on paths. The objects that were copied. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Copies an item at the specified path to an item at the . The path(s) of the item(s) to copy. The path of the item to copy to. Tells the provider to recurse sub-containers when copying. Determines how the source container is used in the copy operation. The context which the core command is running. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If does not contain glob characters and could not be found. Copies the specified item(s) to the specified destination The provider instance to use. The path to the item if it was specified on the command line. The path to copy the item(s) to. If true all sub-containers and their children should be copied. The context which the core command is running. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Recursively copies many items to a single container The provider instance to use. The path to the item if it was specified on the command line. The path to copy the item(s) to. The context which the core command is running. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Gets the dynamic parameters for the copy-item cmdlet. The path to the item if it was specified on the command line. The path of the item to copy to. Tells the provider to recurse sub-containers when copying. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If does not contain glob characters and could not be found. Gets the dynamic parameters for the copy-item cmdlet. The path to the item if it was specified on the command line. The path to copy the item to. If true, subcontainers and their children should be copied. The instance of the provider to use. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Gets the content reader for the specified item. The path(s) to the item(s) to get the content reader for. Passed on to providers to force operations. If true, globbing is not done on paths. The content readers for all items that the path resolves to. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the content reader for the specified item. The path(s) to the item(s) to get the content reader from. The context which the core command is running. The content readers for all items that the path resolves to. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If does not contain glob characters and could not be found. Gets the content reader for the item at the specified path. The provider instance to use. The path to the item if it was specified on the command line. The context which the core command is running. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Gets the dynamic parameters for the get-content cmdlet. The path to the item if it was specified on the command line. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If does not contain glob characters and could not be found. Gets the dynamic parameters for the get-content cmdlet. The path to the item if it was specified on the command line. The instance of the provider to use. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Gets the content writer for the specified item. The path(s) to the item(s) to get the content writer for. Passed on to providers to force operations. If true, globbing is not done on paths. The content writers for all items that the path resolves to. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the content writer for the specified item. The path(s) to the item(s) to get the content writer from. The context which the core command is running. The content writers for all items that the path resolves to. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If does not contain glob characters and could not be found. Gets the content writer for the item at the specified path. The provider instance to use. The path to the item if it was specified on the command line. The context which the core command is running. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Gets the dynamic parameters for the set-content and add-content cmdlet. The path to the item if it was specified on the command line. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If does not contain glob characters and could not be found. Gets the dynamic parameters for the set-content and add-content cmdlet. The path to the item if it was specified on the command line. The instance of the provider to use. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Clears all the content from the specified item. The path(s) to the item(s) to clear the content from. Passed on to providers to force operations. If true, globbing is not done on paths. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Clears all of the content from the specified item. The path to the item to clear the content from. The context which the core command is running. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If does not contain glob characters and could not be found. Clears the content from the item at the specified path. The provider instance to use. The path to the item if it was specified on the command line. The context which the core command is running. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Gets the dynamic parameters for the clear-content cmdlet. The path to the item if it was specified on the command line. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If does not contain glob characters and could not be found. Calls the provider to get the clear-content dynamic parameters The instance of the provider to call The path to pass to the provider. The context the command is executing under. The dynamic parameter object returned by the provider. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. The currently active drive. It determines the current working directory. Adds the specified drive to the current scope. The drive to be added to the current scope. The ID for the scope to add the drive to. The scope ID can be any of the "special" scope identifiers like "global", "local", or "private" or it can be a numeric identifier that is a count of the number of parent scopes up from the current scope to put the drive in. If this parameter is null or empty the drive will be placed in the current scope. The drive that was added, if any. If is null. If the drive already exists, or If .Name contains one or more invalid characters; ~ / \\ . : If the provider is not a DriveCmdletProvider. The provider for the could not be found. If the provider threw an exception or returned null. If creating the drive will overflow the MaximumDriveCount limit. Adds a drive to the PowerShell namespace. The new drive to be added. The ID for the scope to add the drive to. The scope ID can be any of the "special" scope identifiers like "global", "local", or "private" or it can be a numeric identifier that is a count of the number of parent scopes up from the current scope to put the drive in. If this parameter is null or empty the drive will be placed in the current scope. The context which the core command is running. If or is null. If the drive already exists or If .Name contains one or more invalid characters; ~ / \\ . : If is less than zero or greater than the number of currently active scopes. If the provider is not a DriveCmdletProvider. The provider for the could not be found. If the provider threw an exception or returned null. If creating the drive will overflow the MaximumDriveCount limit. Tries to resolve the drive root as an MSH path. If it successfully resolves to a single path then the resolved provider internal path is returned. If it does not resolve to a single MSH path the root is returned as it was passed. The root path of the drive to be resolved. The provider that should be used when resolving the path. The new root path of the drive. Gets an object that defines the additional parameters for the NewDrive implementation for a provider. The provider ID for the drive that is being created. The context under which this method is being called. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the is not a DriveCmdletProvider. If does not exist. Searches through the session state scopes to find a drive The name of a drive to find. The drive information if the drive is found. If is null. If there is no drive with . Searches through the session state scopes looking for a drive of the specified name. The name of the drive to return. The scope ID of the scope to look in for the drive. If this parameter is null or empty the drive will be found by searching the scopes using the dynamic scoping rules. The drive for the given name in the given scope or null if the drive was not found. If is null. If is less than zero, or not a number and not "script", "global", "local", or "private" If is less than zero or greater than the number of currently active scopes. Auto-mounts a built-in drive. The name of the drive to load Determines if the specified automounted drive still exists. If not, the drive is removed. The drive to validate or remove. The scope the drive is in. This will be used to remove the drive if necessary. True if the drive is still valid, false if the drive was removed. Gets all the drives for a specific provider The identifier for the provider to retrieve the drives for. An IEnumerable that contains the drives for the specified provider. Removes the drive with the specified name. The name of the drive to remove. Determines whether drive should be forcefully removed even if there was errors. The ID of the scope from which to remove the drive. If the scope ID is null or empty, the scope hierarchy will be searched starting at the current scope through all the parent scopes to the global scope until a drive of the given name is found to remove. Removes the drive with the specified name. The name of the drive to remove. Determines whether drive should be forcefully removed even if there was errors. The ID of the scope from which to remove the drive. If the scope ID is null or empty, the scope hierarchy will be searched starting at the current scope through all the parent scopes to the global scope until a drive of the given name is found to remove. The context of the command. Removes the specified drive. The drive to be removed. Determines whether drive should be forcefully removed even if there was errors. The ID of the scope from which to remove the drive. If the scope ID is null or empty, the scope hierarchy will be searched starting at the current scope through all the parent scopes to the global scope until a drive of the given name is found to remove. Removes the specified drive. The drive to be removed. Determines whether drive should be forcefully removed even if there was errors. The ID of the scope from which to remove the drive. If the scope ID is null or empty, the scope hierarchy will be searched starting at the current scope through all the parent scopes to the global scope until a drive of the given name is found to remove. The context which the core command is running. If is less than zero or greater than the number of currently active scopes. Determines if the drive can be removed by calling the provider for the drive. The drive to test for removal. The context under which the command is running. True if the drive can be removed, false otherwise. If or is null. If the provider threw an exception when RemoveDrive was called. Gets an enumerable list of the drives that are mounted in the specified scope. The scope to retrieve the drives from. If null or empty, all drives from all scopes will be retrieved. If is less than zero, or not a number and not "script", "global", "local", or "private" If is less than zero or greater than the number of currently active scopes. Creates a new property on the specified item The path(s) to the item(s) on which the new property should be created. The name of the property that should be created. The type of the property that should be created. The new value of the property that should be created. Passed on to providers to force operations. If true, globbing is not done on paths. A property table containing the properties and their values. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Creates a new property on the specified item The path(s) to the item(s) on which the new property should be created. The name of the property that should be created. The type of the property that should be created. The new value of the property that should be created. The context which the core command is running. Nothing. The property should be passed to the context as a PSObject. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If does not contain glob characters and could not be found. Creates a new property on the item at the specified path. The provider instance to use. The path to the item if it was specified on the command line. The name of the property to create. The type of the property to create. The value of the property to create. The context which the core command is running. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Gets the dynamic parameters for the new-itemproperty cmdlet. The path to the item if it was specified on the command line. The name of the property that should be created. The type of the property that should be created. The new value of the property that should be created. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If does not contain glob characters and could not be found. Gets the dynamic parameters for the new-itemproperty cmdlet. The path to the item if it was specified on the command line. The name of the property to create. The type of the property to create. The value of the property. The instance of the provider to use. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Removes the specified property from the specified item. The path(s) to the item(s) to remove the property from. The name of the property to remove Passed on to providers to force operations. If true, globbing is not done on paths. If or is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Removes the specified properties from the specified item. The path(s) to the item(s) to remove the properties from. The name of the property to remove The context which the core command is running. If or is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If does not contain glob characters and could not be found. Removes the property from the item at the specified path. The provider instance to use. The path to the item if it was specified on the command line. The name of the property to remove. The context which the core command is running. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Gets the dynamic parameters for the remove-itemproperty cmdlet. The path to the item if it was specified on the command line. The name of the property that should be created. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If does not contain glob characters and could not be found. Gets the dynamic parameters for the remove-itemproperty cmdlet. The path to the item if it was specified on the command line. The name of the property to remove. The instance of the provider to use. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Copies the specified property on the specified item to the specified property on the destination item. The source and destination items can be the same item. The path(s) to the item(s) to copy the property from. The name of the property to be copied. The path to the item to copy the property to. The name of the property to copy the property to. Passed on to providers to force operations. If true, globbing is not done on paths. If , , , or is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Copies the specified property on the specified item to the specified property on the destination item. The source and destination items can be the same item. The path(s) to the item(s) to copy the property from. The name of the property to be copied. The path to the item to copy the property to. The name of the property to copy the property to. The context which the core command is running. If , , , or is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If does not contain glob characters and could not be found. Copies the property The instance of the provider to use. The path to the item if it was specified on the command line. The name of the property to be copied. The path to the item to copy the property to. The name of the property to copy the property to. The context which the core command is running. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Gets the dynamic parameters for the copy-itemproperty cmdlet. The path to the item if it was specified on the command line. The name of the property to be copied. The path to the item to copy the property to. The name of the property to copy the property to. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If does not contain glob characters and could not be found. Gets the dynamic parameters for the copy-itemproperty cmdlet. The path to the item if it was specified on the command line. The instance of the provider to use. The name of the property to copy. The path to the item to copy the property to. The name of the property to copy the property to on the destination item. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Moves the specified property on the specified item to the specified property on the destination item. The source and destination items can be the same item. The path(s) to the item(s) to move the property from. The name of the property to be moved. The path to the item to move the property to. The name of the property to move the property to. Passed on to providers to force operations. If true, globbing is not done on paths. If , , , or is null. If resolves to more than one item. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Moves the specified property on the specified item to the specified property on the destination item. The source and destination items can be the same item. The path(s) to the item(s) to move the property from. The name of the property to be moved. The path to the item to move the property to. The name of the property to move the property to. The context which the core command is running. If , , , or is null. If resolves to more than one item. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If does not contain glob characters and could not be found. Moves the property from one item to another The provider instance to use. The path to the item if it was specified on the command line. The property to be moved. The path of the item to move the property to. The name of the property to move the property to. The context which the core command is running. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Gets the dynamic parameters for the move-itemproperty cmdlet. The path to the item if it was specified on the command line. The name of the property to be moved. The path to the item to move the property to. The name of the property to move the property to. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If does not contain glob characters and could not be found. Gets the dynamic parameters for the move-itemproperty cmdlet. The path to the item if it was specified on the command line. The name of the property to move. The path to the item to move the property to. The name of the property on the destination item to move the property to. The instance of the provider to use. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Renames the specified property on the specified item to the specified property. The path(s) to the item(s) to rename the property on. The name of the property to be renamed. The name of the property to rename the property to. Passed on to providers to force operations. If true, globbing is not done on paths. If , , or is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Renames the specified property on the specified item to the specified property. The path(s) to the item(s) to rename the property on. The name of the property to be renamed. The name of the property to rename the property to. The context which the core command is running. If , , or is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If does not contain glob characters and could not be found. Renames the property of the item at the specified path. The provider instance to use. The path to the item if it was specified on the command line. The name of the property to rename. The new name of the property. The context which the core command is running. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Gets the dynamic parameters for the rename-itemproperty cmdlet. The path to the item if it was specified on the command line. The name of the property to be renamed. The name of the property to rename the property to. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If does not contain glob characters and could not be found. Gets the dynamic parameters for the rename-itemproperty cmdlet. The path to the item if it was specified on the command line. The instance of the provider to use. The name of the property to rename. The new name for the property. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Add an new SessionState function entry to this session state object... The entry to add Gets a flattened view of the functions that are visible using the current scope as a reference and filtering the functions in the other scopes based on the scoping rules. An IDictionary representing the visible functions. Gets an IEnumerable for the function table for a given scope A scope identifier that is either one of the "special" scopes like "global", "script", "local", or "private, or a numeric ID of a relative scope to the current scope. If is less than zero, or not a number and not "script", "global", "local", or "private" If is less than zero or greater than the number of currently active scopes. Get a functions out of session state. name of function to look up Origin of the command that called this API... The value of the specified function. If is null or empty. Get a functions out of session state. name of function to look up The value of the specified function. If is null or empty. Set a function in the current scope of session state. The name of the function to set. The new value of the function being set. Origin of the caller of this API If is null or empty. If is null. If the function is read-only or constant. If the maximum number of functions have been reached for this scope. Set a function in the current scope of session state. The name of the function to set. The new value of the function being set. The original function (if any) from which the ScriptBlock is derived. The options to set on the function. If true, the function will be set even if its ReadOnly. Origin of the caller of this API If is null or empty. If is null. If the function is read-only or constant. If the maximum number of functions have been reached for this scope. Set a function in the current scope of session state. The name of the function to set. The new value of the function being set. The original function (if any) from which the ScriptBlock is derived. The options to set on the function. If true, the function will be set even if its ReadOnly. Origin of the caller of this API The name of the help file associated with the function. If is null or empty. If is null. If the function is read-only or constant. If the maximum number of functions have been reached for this scope. Set a function in the current scope of session state. The name of the function to set. The new value of the function being set. The original function (if any) from which the ScriptBlock is derived. The options to set on the function. If true, the function will be set even if its ReadOnly. Origin of the caller of this API The execution context for the function. The name of the help file associated with the function. If is null or empty. If is null. If the function is read-only or constant. If the maximum number of functions have been reached for this scope. Set a function in the current scope of session state. The name of the function to set. The new value of the function being set. The original function (if any) from which the ScriptBlock is derived. The options to set on the function. If true, the function will be set even if its ReadOnly. Origin of the caller of this API The execution context for the function. The name of the help file associated with the function. Set to true if it is a regular function (meaning, we do not need to check this is a workflow or if the script contains JobDefinition Attribute and then process it) If is null or empty. If is null. If the function is read-only or constant. If the maximum number of functions have been reached for this scope. Set a function in the current scope of session state. The name of the function to set. The new value of the function being set. The original function (if any) from which the ScriptBlock is derived. If true, the function will be set even if its ReadOnly. The origin of the caller If is null or empty. or If is not a FilterInfo or FunctionInfo If is null. If the function is read-only or constant. If the maximum number of functions have been reached for this scope. Set a function in the current scope of session state. BUGBUG: this overload is preserved because a lot of tests use reflection to call it. The tests should be fixed and this API eventually removed. The name of the function to set. The new value of the function being set. If true, the function will be set even if its ReadOnly. If is null or empty. or If is not a FilterInfo or FunctionInfo If is null. If the function is read-only or constant. If the maximum number of functions have been reached for this scope. Removes a function from the function table. The name of the function to remove. THe origin of the caller of this API If true, the function is removed even if it is ReadOnly. If is null or empty. If the function is constant. Removes a function from the function table. The name of the function to remove. If true, the function is removed even if it is ReadOnly. If is null or empty. If the function is constant. Removes a function from the function table if the function was imported from the given module. BUGBUG: This is only used by the implict remoting functions... The name of the function to remove. Module the function might be imported from. If the function is constant. Gets the specified object The path(s) to the object(s). They can be either a relative (most common) or absolute path. Passed on to providers to force operations. If true, globbing is not done on paths. The item at the specified path. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the specified object The path(s) to the object(s). They can be either a relative (most common) or absolute path. The context which the core command is running. Nothing is returned, but all objects should be written to the WriteObject method of the parameter. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If does not contain glob characters and could not be found. Gets the item at the specified path. The provider instance to use. The path to the item if it was specified on the command line. The context which the core command is running. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Gets the dynamic parameters for the get-item cmdlet. The path to the item if it was specified on the command line. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If does not contain glob characters and could not be found. Gets the dynamic parameters for the get-item cmdlet. The path to the item if it was specified on the command line. The instance of the provider to use. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Gets the specified object The path(s) to the object. It can be either a relative (most common) or absolute path. The new value for the item at the specified path. Passed on to providers to force operations. If true, globbing is not done on paths. The item that was modified at the specified path. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Sets the specified object to the specified value The path(s) to the object. It can be either a relative (most common) or absolute path. The new value of the item at the specified path. The context which the core command is running. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If does not contain glob characters and could not be found. Sets item at the specified path. The provider instance to use. The path to the item if it was specified on the command line. The value of the item. The context which the core command is running. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Gets the dynamic parameters for the set-item cmdlet. The path to the item if it was specified on the command line. The new value of the item at the specified path. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If does not contain glob characters and could not be found. Gets the dynamic parameters for the set-item cmdlet. The path to the item if it was specified on the command line. The instance of the provider to use. The value to be set. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Clears the specified object. Depending on the provider that the path maps to, this could mean the properties and/or content and/or value is cleared. The path(s) to the object. It can be either a relative (most common) or absolute path. Passed on to providers to force operations. If true, globbing is not done on paths. The items that were cleared. If an error occurs that error will be thrown. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Clears the specified item. Depending on the provider that the path maps to, this could mean the properties and/or content and/or value is cleared. The path(s) to the object. It can be either a relative (most common) or absolute path. The context which the core command is running. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If does not contain glob characters and could not be found. Clears the item at the specified path. The provider instance to use. The path to the item if it was specified on the command line. The context which the core command is running. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Gets the dynamic parameters for the clear-item cmdlet. The path to the item if it was specified on the command line. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If does not contain glob characters and could not be found. Gets the dynamic parameters for the clear-item cmdlet. The path to the item if it was specified on the command line. The instance of the provider to use. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Performs the default action on the specified item. The default action is determined by the provider. The path(s) to the object(s). They can be either a relative (most common) or absolute path(s). If true, globbing is not done on paths. If an error occurs that error will be thrown. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Performs the default action on the specified item. The default action is determined by the provider. The path(s) to the object(s). They can be either a relative (most common) or absolute paths. The context which the core command is running. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If does not contain glob characters and could not be found. Invokes the default action on the item at the specified path. The provider instance to use. The path to the item if it was specified on the command line. The context which the core command is running. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Gets the dynamic parameters for the invoke-item cmdlet. The path to the item if it was specified on the command line. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If does not contain glob characters and could not be found. Gets the dynamic parameters for the invoke-item cmdlet. The path to the item if it was specified on the command line. The instance of the provider to use. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Gets the namespace specific path of the current working directory for the specified namespace. An identifier that uniquely identifies the namespace to get the current working directory for. The namespace specific path of the current working directory for the specified namespace. If is null. If refers to a provider that does not exist. If a current drive cannot be found for the provider Changes the current working directory to the path specified The path of the new current working directory The PathInfo object representing the path of the location that was set. If is null. If does not exist, is not a container, or resolved to multiple containers. If refers to a provider that does not exist. If refers to a drive that does not exist. If the provider associated with threw an exception. Changes the current working directory to the path specified The path of the new current working directory The context the provider uses when performing the operation. The PathInfo object representing the path of the location that was set. If is null. If does not exist, is not a container, or resolved to multiple containers. If refers to a provider that does not exist. If refers to a drive that does not exist. If the provider associated with threw an exception. If the could not be resolved. Determines if the specified path is the current working directory or a parent of the current working directory. A monad namespace absolute or relative path. The context the provider uses when performing the operation. true, if the path is the current working directory or a parent of the current working directory. false, otherwise. If is null. If the path is a provider-qualified path for a provider that is not loaded into the system. If the refers to a drive that could not be found. If the provider used to build the path threw an exception. If the provider that the represents is not a NavigationCmdletProvider or ContainerCmdletProvider. If the starts with "~" and the home location is not set for the provider. If the provider specified by threw an exception when its GetParentPath or MakePath was called while processing the . A stack of the most recently pushed locations The name of the default location stack Pushes the current location onto the working location stack so that it can be retrieved later. The ID of the stack to push the location on. If it is null or empty the default stack is used. Resets the current working drive and directory to the first entry on the working directory stack and removes that entry from the stack. The ID of the stack to pop the location from. If it is null or empty the default stack is used. A PathInfo object representing the location that was popped from the location stack and set as the new location. If the path on the stack does not exist, is not a container, or resolved to multiple containers. or If contains wildcard characters and resolves to multiple location stacks. or A stack was not found with the specified name. If the path on the stack refers to a provider that does not exist. If the path on the stack refers to a drive that does not exist. If the provider associated with the path on the stack threw an exception. Gets the monad namespace paths for all the directories that are pushed on the working directory stack. The stack of the ID of the location stack to retrieve. If it is null or empty the default stack is used. The PathInfoStack representing the location stack for the specified stack ID. If no location stack exists except if the default stack is requested. Sets the default stack ID to the specified stack ID The stack ID to be used as the default. The PathInfoStack for the new default stack or null if the stack does not exist yet. If does not exist as a location stack. Gets the path to the parent object for the given object The path to the object to get the parent path from The root of the drive. The path to the parent object If is null. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Gets the path to the parent object for the given object The path to the object to get the parent path from The root of the drive. Namespace providers should return the root if GetParentPath is called for the root. The context which the core command is running. The path to the parent object If is null. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Gets the path to the parent object for the given object. Allow to use FileSystem as the default provider when the given path is drive-qualified and the drive cannot be found. The path to the object to get the parent path from The root of the drive. Namespace providers should return the root if GetParentPath is called for the root. The context which the core command is running. Specify whether to use default provider when needed. The path to the parent object Removes either the drive or provider qualifier or both from the path. The path to strip the provider qualifier from. Returns the qualifier of the path. Returns true if the path is a provider-qualified path. Returns true if the path is a drive-qualified path. The path without the qualifier. Gets the path to the parent object for the given object The provider that should handle the GetParentPath call. The path to the object to get the parent path from The root of the drive. Namespace providers should return the root if GetParentPath is called for the root. The context which the core command is running. The path to the parent object This is internal so that it can be called from the LocationGlobber. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Gets the path to the parent object for the given object The instance of the provider that should handle the GetParentPath call. The path to the object to get the parent path from The root of the drive. Namespace providers should return the root if GetParentPath is called for the root. The context which the core command is running. The path to the parent object This is internal so that it can be called from the LocationGlobber. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Normalizes the path that was passed in and returns the normalized path as a relative path to the basePath that was passed. An MSH path to an item. The item should exist or the provider should write out an error. The path that the return value should be relative to. A normalized path that is relative to the basePath that was passed. If is null. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Normalizes the path that was passed in and returns the normalized path as a relative path to the basePath that was passed. An MSH path to an item. The item should exist or the provider should write out an error. The path that the return value should be relative to. The context under which the command is running. A normalized path that is relative to the basePath that was passed. If is null. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Normalizes the path that was passed in and returns the normalized path as a relative path to the basePath that was passed. The provider to use to normalize the path. An provider internal path to normalize. The path that the return value should be relative to. The context under which the command is running. A normalized path that is relative to the basePath that was passed. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Generates a path from the given parts. The parent segment of the path to be joined with the child. The child segment of the ath to be joined with the parent. The generated path. If is null. If both and is null. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Generates a path from the given parts. The parent segment of the path to be joined with the child. The child segment of the ath to be joined with the parent. The context which the core command is running. The generated path. If is null. If both and is null. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Uses the specified provider to put the two parts of a path together The provider to use. The parent part of the path to join with the child. The child part of the path to join with the parent. The context under which the command is running. The combined path. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Uses the specified provider to put the two parts of a path together The provider instance to use. The parent part of the path to join with the child. The child part of the path to join with the parent. The context under which the command is running. The combined path. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Gets the name of the leaf element in the specified path. The fully qualified path to the item The leaf element in the path. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the name of the leaf element in the specified path. The fully qualified path to the item The context which the core command is running. The leaf element in the path. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the name of the leaf element in the specified path. Allow to use FileSystem as the default provider when the given path is drive-qualified and the drive cannot be found. The fully qualified path to the item The context which the core command is running. to use default provider when needed. The leaf element in the path. Gets the leaf element of the specified path. The provider to use. The path to the item if it was specified on the command line. The context which the core command is running. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Gets the leaf element of the specified path. The provider instance to use. The path to the item if it was specified on the command line. The context which the core command is running. Specify True if the method should just return the Path if the provider doesn't support container overloads. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Moves the item specified by path to the specified destination. The path(s) to the item(s) to be moved. The path of the destination container. Passed on to providers to force operations. If true, globbing is not done on paths. The item(s) that were moved. If is null. If resolves to multiple paths. or If and don't resolve to the same provider. or If resolves to multiple paths and is not a container. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Moves the item specified by path to the specified destination. The path(s) to the item(s) to be moved. The path of the destination container. The context which the core command is running. Nothing. All items that are moved are written into the context object. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If does not contain glob characters and could not be found. Moves the item at the specified path to the destination path The provider instance to use. The path to the item if it was specified on the command line. The path to where the item should be moved. The context which the core command is running. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Gets the dynamic parameters for the move-item cmdlet. The path to the item if it was specified on the command line. The path to move the item to. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If does not contain glob characters and could not be found. Gets the dynamic parameters for the move-item cmdlet. The path to the item if it was specified on the command line. The path to where the item should be moved. The instance of the provider to use. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Gets the specified properties from the specified item. The path(s) to the item(s) to get the properties from. A list of the properties that the provider should return. If true, globbing is not done on paths. A property table container the properties and their values. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Gets the specified properties from the specified item. The path(s) to the item(s) to get the properties from. A list of the properties that the provider should return. The context which the core command is running. Nothing. A PSObject representing the properties should be written to the context. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If does not contain glob characters and could not be found. Gets the property from the item at the specified path. The provider instance to use. The path to the item if it was specified on the command line. The names of the properties to get. The context which the core command is running. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Gets the dynamic parameters for the get-itemproperty cmdlet. The path to the item if it was specified on the command line. A list of the properties that the provider should return. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If does not contain glob characters and could not be found. Gets the dynamic parameters for the get-itemproperty cmdlet. The path to the item if it was specified on the command line. The names of the properties to get. The instance of the provider to use. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Sets the specified properties on the specified item. The path(s) to the item(s) to set the properties on. A PSObject containing the properties to be changed. Passed on to providers to force operations. If true, globbing is not done on paths. An array of PSObjects representing the properties that were set on each item. If or is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Sets the specified properties on specified item. The path(s) to the item(s) to set the properties on. A property table containing the properties and values to be set on the object. The context which the core command is running. Nothing. A PSObject is passed to the context for the properties on each item that were modified. If or is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If does not contain glob characters and could not be found. Sets the property of the item at the specified path. The provider instance to use. The path to the item if it was specified on the command line. The name of the property to set. The context which the core command is running. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Gets the dynamic parameters for the clear-itemproperty cmdlet. The path to the item if it was specified on the command line. A property table containing the properties and values to be set on the object. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If does not contain glob characters and could not be found. Gets the dynamic parameters for the set-itemproperty cmdlet. The path to the item if it was specified on the command line. The value of the property to set. The instance of the provider to use. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Clears the specified property on the specified item. The path(s) to the item(s) to clear the property on. The name of the property to clear. Passed on to providers to force operations. If true, globbing is not done on paths. If or is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Clears the specified property in the specified item. The path(s) to the item(s) to clear the property on. A property table containing the property to clear. The context which the core command is running. If or is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If does not contain glob characters and could not be found. Clears the value of the property from the item at the specified path. The provider instance to use. The path to the item if it was specified on the command line. The name of the property to clear. The context which the core command is running. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Gets the dynamic parameters for the clear-itemproperty cmdlet. The path to the item if it was specified on the command line. A property table containing the property to clear. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. If does not contain glob characters and could not be found. Gets the dynamic parameters for the clear-itemproperty cmdlet. The path to the item if it was specified on the command line. The name of the property to clear. The instance of the provider to use. The context which the core command is running. An object that has properties and fields decorated with parsing attributes similar to a cmdlet class. If the does not support this operation. If the pipeline is being stopped while executing the command. If the provider threw an exception. Gets called by the RunspaceConfiguration when a PSSnapin gets added or removed. Entrypoint used by to add a provider to the current session state based on a SessionStateProviderEntry. Internal method used by RunspaceConfig for updatting providers. Determines the appropriate provider for the drive and then calls the NewDrive method of that provider. The drive to have the provider verify. The command context under which the drive is being added. If true, the drive root will be resolved as an MSH path before verifying with the provider. If false, the path is assumed to be a provider-internal path. The instance of the drive to be added as approved by the provider. If the provider is not a DriveCmdletProvider. The provider for the could not be found. If the provider throws an exception while validating the drive. Gets an instance of a provider given the provider ID. The identifier for the provider to return an instance of. An instance of the specified provider. If is null. If the refers to a provider that doesn't exist or the name passed matched multiple providers. Gets an instance of a provider given the provider information. The provider to return an instance of. An instance of the specified provider. If is null. Creates an exception for the case where the provider name matched multiple providers. The name of the provider. The ProviderInfo of the possible matches. An exception representing the error with a message stating which providers are possible matches. Gets an instance of an DriveCmdletProvider given the provider ID. The provider ID of the provider to get an instance of. An instance of a DriveCmdletProvider for the specified provider ID. if is null. if the is not for a provider that is derived from NavigationCmdletProvider. If the refers to a provider that doesn't exist. Gets an instance of an DriveCmdletProvider given the provider information. The provider to get an instance of. An instance of a DriveCmdletProvider for the specified provider. if is null. if the is not for a provider that is derived from NavigationCmdletProvider. Gets an instance of an DriveCmdletProvider given the provider ID. The instance of the provider to use. An instance of a DriveCmdletProvider for the specified provider ID. if is null. if the is not for a provider that is derived from DriveCmdletProvider. Gets an instance of an ItemCmdletProvider given the provider ID. The provider ID of the provider to get an instance of. An instance of a ItemCmdletProvider for the specified provider ID. if is null. if the is not for a provider that is derived from NavigationCmdletProvider. If the refers to a provider that doesn't exist. Gets an instance of an ItemCmdletProvider given the provider. The provider to get an instance of. An instance of a ItemCmdletProvider for the specified provider. if is null. if the is not for a provider that is derived from NavigationCmdletProvider. Gets an instance of an ItemCmdletProvider given the provider ID. The instance of the provider to use. An instance of a ItemCmdletProvider for the specified provider ID. if is null. if the is not for a provider that is derived from ItemCmdletProvider. Gets an instance of an ContainerCmdletProvider given the provider ID. The provider ID of the provider to get an instance of. An instance of a ContainerCmdletProvider for the specified provider ID. if is null. if the is not for a provider that is derived from NavigationCmdletProvider. If the refers to a provider that doesn't exist. Gets an instance of an ContainerCmdletProvider given the provider. The provider to get an instance of. An instance of a ContainerCmdletProvider for the specified provider. if is null. if the is not for a provider that is derived from NavigationCmdletProvider. Gets an instance of an ContainerCmdletProvider given the provider ID. The instance of the provider to use. An instance of a ContainerCmdletProvider for the specified provider ID. if is null. if the is not for a provider that is derived from ContainerCmdletProvider. Gets an instance of an NavigationCmdletProvider given the provider. The provider to get an instance of. An instance of a NavigationCmdletProvider for the specified provider ID. if is null. if the is not for a provider that is derived from NavigationCmdletProvider. Gets an instance of an NavigationCmdletProvider given the provider ID. The instance of the provider to use. Specify True if the method should just return the Path if the provider doesn't support container overloads. An instance of a NavigationCmdletProvider for the specified provider ID. if is null. if the is not for a provider that is derived from NavigationCmdletProvider. Determines if the specified CmdletProvider is loaded. The name of the CmdletProvider. true if the CmdletProvider is loaded, or false otherwise. If is null or empty. Gets the provider of the specified name The name of the provider to retrieve The provider of the given name If is null or empty. The provider with the specified could not be found. Gets the provider of the specified name The name of the provider to retrieve The provider of the given name If is null or empty. The provider with the specified could not be found or the name was ambiguous. If the name is ambiguous then the PSSnapin qualified name must be specified. Copy the Providers from another session state instance... the session state instance to copy from... Initializes a provider by loading the assembly, creating an instance of the provider, calling its start method followed by the InitializeDefaultDrives method. The Drives that are returned from the InitializeDefaultDrives method are then mounted. An instance of the provider to use for the initialization. The provider to be initialized. The context under which the initialization is occurring. If this parameter is not null, errors will be written to the WriteError method of the context. If or is null. If the provider is not a DriveCmdletProvider. If a drive already exists for the name of one of the drives the provider tries to add. If the provider tries to add default drives which exceed the maximum limit for the number of drives in the current scope. Creates and adds a provider to the provider container The provider to add. The provider that was added or null if the provider failed to be added. If is null. If the provider already exists. If there was a failure to load the provider or the provider threw an exception. Creates an entry in the providers hashtable for the new provider. The provider being added. If a provider with the same name and PSSnapIn name already exists. Removes the provider of the given name. The name of the provider to remove. Determines if the provider should be removed forcefully even if there were drives present or errors. The context under which the command is being run. If is null. There are still drives associated with this provider, and the "force" option was not specified. A provider with name could not be found. If a provider throws an exception it gets written to the . If is null or empty. If is null. All drives associated with the provider must be removed before the provider can be removed. Call SessionState.GetDrivesForProvider() to determine if there are any drives associated with the provider. A SessionStateException will be written to the context if any such drives do exist. Removes the provider from the providers dictionary. The provider to be removed. If there are multiple providers with the same name, then only the provider from the matching PSSnapin is removed. If the last provider of that name is removed the entry is removed from the dictionary. The current scope. It is either the global scope or a nested scope within the global scope. The current scope is implied or can be accessed using $local in the shell. Given a scope identifier, returns the proper session state scope. A scope identifier that is either one of the "special" scopes like "global", "local", or "private, or a numeric ID of a relative scope to the current scope. The scope identified by the scope ID or the current scope if the scope ID is not defined as a special or numeric scope identifier. If is less than zero, or not a number and not "script", "global", "local", or "private" If is less than zero or greater than the number of currently active scopes. Given a scope ID, walks the scope list to the appropriate scope and returns it. The numeric indexer to the scope relative to the current scope. The scope at the index specified. The index is relative to the current scope. If is less than zero or greater than the number of currently active scopes. Creates a new scope in the scope tree and assigns the parent and child scopes appropriately. If true, the new scope is pushed on to the script scope stack and can be referenced using $script: A new SessionStateScope which is a child of the current scope. Removes the current scope from the scope tree and changes the current scope to the parent scope. The scope to cleanup and remove. The global scope cannot be removed. Add an new SessionStateVariable entry to this session state object... The entry to add Get a variable out of session state. This interface supports the scope specifiers like "global:foobar" name of variable to look up Origin of the command making this request. The specified variable. If is null. Get a variable out of session state. This interface supports the scope specifiers like "global:foobar" name of variable to look up The specified variable. If is null. Get a variable out of session state. This interface supports the "namespace:name" syntax so you can do things like "env:PATH" or "global:foobar" name of variable to look up The value of the specified variable. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Get a variable out of session state. This interface supports the "namespace:name" syntax so you can do things like "env:PATH" or "global:foobar" name of variable to look up value to return if you can't find Name or it returns null. The value of the specified variable. If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Looks up the specified variable and returns the context under which the variable was found as well as the variable itself. The VariablePath helper for the variable. The scope the variable was found in. Null if the variable wasn't found. Returns the context under which the variable was found. The context will have the drive data already set. This will be null if the variable was not found. The variable if it was found or null if it was not. The is first parsed to see if it contains a drive specifier or special scope. If a special scope is found ("LOCAL" or "GLOBAL") then only that scope is searched for the variable. If any other drive specifier is found the lookup goes in the following order. - current scope - each consecutive parent scope until the variable is found. - global scope If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Looks up the specified variable and returns the context under which the variable was found as well as the variable itself. The VariablePath helper for the variable. The scope the variable was found in. Null if the variable wasn't found. Returns the context under which the variable was found. The context will have the drive data already set. This will be null if the variable was not found. The origin of the caller of this API The variable if it was found or null if it was not. The is first parsed to see if it contains a drive specifier or special scope. If a special scope is found ("LOCAL" or "GLOBAL") then only that scope is searched for the variable. If any other drive specifier is found the lookup goes in the following order. - current scope - each consecutive parent scope until the variable is found. - global scope If is null. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Looks up the specified variable and returns the context under which the variable was found as well as the variable itself. The VariablePath helper for the variable. The scope the variable was found in. Null if the variable wasn't found. Origin of the command requesting this variable The variable if it was found or null if it was not. The is first parsed to see if it contains a drive specifier or special scope. If a special scope is found ("LOCAL" or "GLOBAL") then only that scope is searched for the variable. - current scope - each consecutive parent scope until the variable is found. - global scope If is null. Looks up the specified variable and returns the context under which the variable was found as well as the variable itself. The VariablePath helper for the variable. The scope the variable was found in. Null if the variable wasn't found. The variable if it was found or null if it was not. The is first parsed to see if it contains a drive specifier or special scope. If a special scope is found ("LOCAL" or "GLOBAL") then only that scope is searched for the variable. - current scope - each consecutive parent scope until the variable is found. - global scope If is null. Get a variable out of session state. This interface supports the "namespace:name" syntax so you can do things like "env:PATH" or "global:foobar" name of variable to look up The ID of the scope to lookup the variable in. The value of the specified variable. If is null. If is less than zero, or not a number and not "script", "global", "local", or "private" If is less than zero or greater than the number of currently active scopes. Get a variable out of session state. This interface supports the "namespace:name" syntax so you can do things like "env:PATH" or "global:foobar" name of variable to look up The ID of the scope to lookup the variable in. The value of the specified variable. If is null. If is less than zero, or not a number and not "script", "global", "local", or "private" If is less than zero or greater than the number of currently active scopes. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Set a variable in session state. This interface supports the "namespace:name" syntax so you can do things like "$env:PATH = 'c:\windows'" or "$global:foobar = 13" The name of the item to set. The new value of the item being set. The origin of the caller of this API... If is null. If the variable is read-only or constant. If the maximum number of variables has been reached for this scope. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Set a variable in session state. This interface supports the "namespace:name" syntax so you can do things like "$env:PATH = 'c:\windows'" or "$global:foobar = 13" BUGBUG: this overload exists because a lot of tests in the testsuite use it. Those tests should eventually be fixed and this overload should be removed. The name of the item to set. The new value of the item being set. If is null. If the variable is read-only or constant. If the maximum number of variables has been reached for this scope. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Set a variable in session state. This interface supports the scope specifiers like "$global:foobar = 13" The variable to be set. If true, the variable is set even if it is ReadOnly. The origin of the caller of this API A PSVariable object if refers to a variable. An PSObject if refers to a provider path. If is null. If the variable is read-only or constant. If the maximum number of variables has been reached for this scope. Set a variable useing a pre-parsed variablePath object instead of a string. A pre-parsed variable path object for the variable in question. The value to set. If true, sets the variable value to newValue. If false, newValue must be a PSVariable object and the item will be set rather than the value. The origin of the caller A PSVariable object if refers to a variable. An PSObject if refers to a provider path. If is null. If the variable is read-only or constant. If the maximum number of variables has been reached for this scope. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Set a variable useing a pre-parsed variablePath object instead of a string. A pre-parsed variable path object for the variable in question. The value to set. If true, sets the variable value to newValue. If false, newValue must be a PSVariable object and the item will be set rather than the value. If true, the variable is set even if it is ReadOnly. The origin of the caller A PSVariable object if refers to a variable. An PSObject if refers to a provider path. If is null. If the variable is read-only or constant. If the maximum number of variables has been reached for this scope. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Set a variable in session state. The variable to set The ID of the scope to do the lookup in. The ID is either a zero based index of the scope tree with the current scope being zero, its parent scope being 1 and so on, or "global", "local", "private", or "script" If true, the variable is set even if it is ReadOnly. The origin of the caller If is null or its name is null or empty. or If is less than zero, or not a number and not "script", "global", "local", or "private" A PSVariable object if refers to a variable. An PSObject if refers to a provider path. If is less than zero or greater than the number of currently active scopes. If the variable is read-only or constant. If the maximum number of variables has been reached for this scope. Creates a new variable. The variable to create If true, the variable is created even if it is ReadOnly. A PSVariable representing the variable that was created. If the variable is read-only or constant. If the maximum number of variables has been reached for this scope. Creates a new variable in the specified scope The variable to create The ID of the scope to do the lookup in. The ID is either a zero based index of the scope tree with the current scope being zero, its parent scope being 1 and so on, or "global", "local", "private", or "script" If true, the variable is set even if it is ReadOnly. If is null or its name is null or empty. or If is less than zero, or not a number and not "script", "global", "local", or "private" A PSVariable representing the variable that was created. If is less than zero or greater than the number of currently active scopes. If the variable is read-only or constant. If the maximum number of variables has been reached for this scope. Removes a variable from the variable table. The name of the variable to remove. If is null. if the variable is constant. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Removes a variable from the variable table. The name of the variable to remove. If true, the variable will be removed even if its ReadOnly. If is null. if the variable is constant. If the refers to a provider that could not be found. If the refers to a drive that could not be found. If the provider that the refers to does not support this operation. If the provider threw an exception. Removes a variable from the variable table. The variable to remove. If is null. if the variable is constant. Removes a variable from the variable table. The variable to remove. If true, the variable will be removed even if its ReadOnly. If is null. if the variable is constant. Remove a variable from session state. This interface supports the "namespace:name" syntax so you can do things like "env:PATH" or "global:foobar" name of variable to remove The ID of the scope to lookup the variable in. If is null. If is less than zero or greater than the number of currently active scopes. if the variable is constant. If refers to an MSH path (not a variable) and the provider throws an exception. Remove a variable from session state. This interface supports the "namespace:name" syntax so you can do things like "env:PATH" or "global:foobar" name of variable to remove The ID of the scope to lookup the variable in. If true, the variable will be removed even if its ReadOnly. If is null or empty. If is less than zero or greater than the number of currently active scopes. if the variable is constant. If refers to an MSH path (not a variable) and the provider throws an exception. Remove a variable from session state. The variable to remove The ID of the scope to lookup the variable in. If is null. If is less than zero or greater than the number of currently active scopes. if the variable is constant. Remove a variable from session state. The variable to remove The ID of the scope to lookup the variable in. If true, the variable will be removed even if its ReadOnly. If is null. If is less than zero or greater than the number of currently active scopes. if the variable is constant. Gets a flattened view of the variables that are visible using the current scope as a reference and filtering the variables in the other scopes based on the scoping rules. An IDictionary representing the visible variables. Gets a flattened view of the variables that are visible using the current scope as a reference and filtering the variables in the other scopes based on the scoping rules. An IDictionary representing the visible variables. If is less than zero, or not a number and not "script", "global", "local", or "private" If is less than zero or greater than the number of currently active scopes. Provides all the path manipulation and globbing for Monad paths. The context of the runspace to which this session state object belongs. Returns the public session state facade object for this session state instance. Gets the engine APIs to access providers The module info object associated with this session state The private module table for this session state object... Get/set constraints for this execution environemnt If true the PowerShell debugger will use FullLanguage mode, otherwise it will use the current language mode The list of scripts that are allowed to be run. If the name "*" is in the list, then all scripts can be run. (This is the default.) The list of appications that are allowed to be run. If the name "*" is in the list, then all applications can be run. (This is the default.) List of functions/filters to export from this session state object... List of aliases to export from this session state object... Gets or sets the current working drive List of functions/filters to export from this session state object... List of workflows to export from this session state object... Gets the current monad namespace specific working location. If you want to change the current working directory use the SetLocation method. If a location has not been set yet. A collection of the providers. Any provider in this collection can have drives in any scope in session state. Stores the current working drive for each provider. This allows for retrieving the current working directory for each individual provider. Gets all the CoreCommandProviders Gets the count of the number of providers that are loaded The global scope of session state. Can be accessed using $global in the shell. The module scope of a session state. This is only used internally by the engine. There is no module scope qualifier. Gets the session state current scope. Gets the session state current script scope. List of variables to export from this session state object... Defines the authorization policy that controls the way scripts (and other command types) are handled by Monad. This authorization policy enforces one of four levels, as defined by the 'ExecutionPolicy' value in one of the following locations: In priority-order (highest priority first,) these come from: - Machine-wide Group Policy HKLM\Software\Policies\Microsoft\Windows\PowerShell - Current-user Group Policy HKCU\Software\Policies\Microsoft\Windows\PowerShell. - Current session preference ENV:PSExecutionPolicyPreference - Current user machine preference HKEY_CURRENT_USER\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell - Local machine preference HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell Restricted - All .ps1 files are blocked. ps1xml files must be digitally signed, and by a trusted publisher. If you haven't made a trust decision on the publisher yet, prompting is done as in AllSigned mode. AllSigned - All .ps1 and .ps1xml files must be digitally signed. If signed and executed, Monad prompts to determine if files from the signing publisher should be run or not. RemoteSigned - Only .ps1 and .ps1xml files originating from the internet must be digitally signed. If remote, signed, and executed, Monad prompts to determine if files from the signing publisher should be run or not. This is the default setting. Unrestricted - No files must be signed. If a file originates from the internet, Monad provides a warning prompt to alert the user. To supress this warning message, right-click on the file in File Explorer, select "Properties," and then "Unblock." Bypass - No files must be signed, and internet origin is not verified Initializes a new instance of the PSAuthorizationManager class, for a given ShellId. The shell identifier that the authorization manager applies to. For example, Microsoft.PowerShell Trust a publisher by adding it to the "Trusted Publishers" store Determines if should run the specified command. Please see the class summary for an overview of the semantics enforced by this authorization manager. The command to be run. The origin of the command. The PSHost executing the command. If access is denied, this parameter provides a specialized Exception as the reason. True if the command should be run. False otherwise. CommandInfo is invalid. This may occur if commandInfo.Name is null or empty. CommandInfo is null. The file specified by commandInfo.Path is not found. Defines the valid status flags that a signature on a file may have. The file has a valid signature. This means only that the signature is syntactically valid. It does not imply trust in any way. The file has an invalid signature. The file has no signature. The hash of the file does not match the hash stored along with the signature. The certificate was signed by a publisher not trusted on the system. The specified file format is not supported by the system for signing operations. This usually means that the system does not know how to sign or verify the file type requested. The signature cannot be verified because it is incompatible with the current system. Represents a digital signature on a signed file. Constructor for class Signature Call this to create a validated time-stamped signature object. this signature is found in this file win32 error code cert of the signer cert of the time stamper constructed object Constructor for class Signature Call this to create a validated signature object. this signature is found in this file cert of the signer constructed object Constructor for class Signature Call this ctor when creating an invalid signature object this signature is found in this file win32 error code cert of the signer constructed object Constructor for class Signature Call this ctor when creating an invalid signature object this signature is found in this file win32 error code constructed object Gets the X509 certificate of the publisher that signed the file. Gets the X509 certificate of the authority that time-stamped the file. Gets the status of the signature on the file. Gets the message corresponding to the status of the signature on the file. Gets the path of the file to which this signature applies. SAFER_TOKEN_NULL_IF_EQUAL -> 0x00000001 SAFER_TOKEN_COMPARE_ONLY -> 0x00000002 SAFER_TOKEN_MAKE_INERT -> 0x00000004 SAFER_CRITERIA_IMAGEPATH -> 0x00001 SAFER_CRITERIA_NOSIGNEDHASH -> 0x00002 SAFER_CRITERIA_IMAGEHASH -> 0x00004 SAFER_CRITERIA_AUTHENTICODE -> 0x00008 SAFER_CRITERIA_URLZONE -> 0x00010 SAFER_CRITERIA_IMAGEPATH_NT -> 0x01000 WTD_UI_NONE -> 0x00002 S_OK -> ((HRESULT)0L) S_FALSE -> ((HRESULT)1L) ERROR_MORE_DATA -> 234L ERROR_ACCESS_DISABLED_BY_POLICY -> 1260L ERROR_ACCESS_DISABLED_NO_SAFER_UI_BY_POLICY -> 786L SAFER_MAX_HASH_SIZE -> 64 SRP_POLICY_SCRIPT -> L"SCRIPT" pinvoke methods from crypt32.dll pinvoke methods from certca.dll pinvoke methods from advapi32.dll signature of cert enumeration function signature of cert find function Return Type: BOOL->int dwNumProperties: DWORD->unsigned int pCodeProperties: PSAFER_CODE_PROPERTIES->_SAFER_CODE_PROPERTIES* pLevelHandle: SAFER_LEVEL_HANDLE* lpReserved: LPVOID->void* Return Type: BOOL->int LevelHandle: SAFER_LEVEL_HANDLE->SAFER_LEVEL_HANDLE__* InAccessToken: HANDLE->void* OutAccessToken: PHANDLE->HANDLE* dwFlags: DWORD->unsigned int lpReserved: LPVOID->void* Return Type: BOOL->int hLevelHandle: SAFER_LEVEL_HANDLE->SAFER_LEVEL_HANDLE__* Return Type: BOOL->int hObject: HANDLE->void* signature of call back function used by CertEnumSystemStore The PROV_RSA_FULL type. The PROV_RSA_SIG type. The PROV_RSA_DSS type. The PROV_FORTEZZA type. The PROV_MS_EXCHANGE type. The PROV_SSL type. The PROV_RSA_SCHANNEL type. SSL certificates are generated with these providers. The PROV_DSS_DH type. The PROV_EC_ECDSA type. The PROV_EC_ECNRA_SIG type. The PROV_EC_ECDSA_FULL type. The PROV_EC_ECNRA_FULL type. The PROV_DH_SCHANNEL type. The PROV_SPYRUS_LYNKS type. The PROV_RNG type. The PROV_INTEL_SEC type. String naming a key container within a particular CSP. String that names a CSP. CSP type. Flags value indicating whether a key container is to be created or destroyed, and whether an application is allowed access to a key container. Number of elements in the rgProvParam array. Array of pointers to CRYPT_KEY_PROV_PARAM structures. The specification of the private key to retrieve. AT_KEYEXCHANGE and AT_SIGNATURE are defined for the default provider. DWORD->unsigned int LPCSTR->CHAR* LPCWSTR->WCHAR* DWORD->unsigned int Anonymous_a3ae7823_8a1d_432c_bc07_a72b6fc6c7d8 CRYPT_DATA_BLOB->_CRYPTOAPI_BLOB DWORD->unsigned int ALG_ID->unsigned int DWORD->unsigned int DWORD->unsigned int BYTE* DWORD->unsigned int BYTE* DWORD->unsigned int GUID->_GUID LPCWSTR->WCHAR* DWORD->unsigned int BYTE* DWORD->unsigned int BYTE* unsigned int unsigned short unsigned short unsigned char[8] WINTRUST_FILE_INFO_* WINTRUST_CATALOG_INFO_* WINTRUST_BLOB_INFO_* WINTRUST_SGNR_INFO_* WINTRUST_CERT_INFO_* DWORD->unsigned int LPVOID->void* LPVOID->void* DWORD->unsigned int DWORD->unsigned int DWORD->unsigned int WinTrust_Choice struct DWORD->unsigned int HANDLE->void* WCHAR* DWORD->unsigned int DWORD->unsigned int DWORD->unsigned int DWORD->unsigned int LPCWSTR->WCHAR* HANDLE->void* DWORD->unsigned int BYTE[SAFER_MAX_HASH_SIZE] DWORD->unsigned int LARGE_INTEGER->_LARGE_INTEGER ALG_ID->unsigned int LPBYTE->BYTE* HWND->HWND__* DWORD->unsigned int Anonymous_9320654f_2227_43bf_a385_74cc8c562686 Anonymous_947eb392_1446_4e25_bbd4_10e98165f3a9 LONGLONG->__int64 int DWORD->unsigned int LONG->int DWORD->unsigned int LONG->int How the policy is being enforced Not enforced at all Enabled - allow, but audit Enabled, enforce restrictions Support class for dealing with the Windows Lockdown Policy Gets the system lockdown policy An EnforcementMode that describes the system policy Gets lockdown policy as applied to a file An EnforcementMode that describes policy Gets lockdown policy as applied to a COM object True if the COM object is allowed, False otherwise. Native constants for dealing with the lockdown policy The different host IDs understood by the lockdown policy Host information structure to contain the lockdown policy request DWORD->unsigned int WLDP_HOST_ID->_WLDP_HOST_ID PCWSTR->WCHAR* Native methods for dealing with the lockdown policy Return Type: HRESULT->LONG->int pHostInformation: PWLDP_HOST_INFORMATION->_WLDP_HOST_INFORMATION* pdwLockdownState: PDWORD->DWORD* dwFlags: DWORD->unsigned int Return Type: HRESULT->LONG->int rclsid: IID* pHostInformation: PWLDP_HOST_INFORMATION->_WLDP_HOST_INFORMATION* ptIsApproved: PBOOL->BOOL* dwFlags: DWORD->unsigned int Defines the options that control what data is embedded in the signature blob Embeds only the signer's certificate. Embeds the entire certificate chain. Embeds the entire certificate chain, except for the root certificate. Default: Embeds the entire certificate chain, except for the root certificate. Helper functions for signature functionality tracer for SignatureHelper Sign a file option that controls what gets embedded in the signature blob name of file to sign signing cert URL of time stamping server The name of the hash algorithm to use. Does not return a value Thrown if argument fileName or certificate is null. Thrown if -- argument fileName is empty OR -- the specified certificate is not suitable for signing code This exception can be thrown if any cryptographic error occurs. It is not possible to know exactly what went wrong. This is because of the way CryptographicException is designed. Possible reasons: -- certificate is invalid -- certificate has no private key -- certificate password mismatch -- etc Thrown if the file specified by argument fileName is not found Get signature on the specified file name of file to check content of file to check Signature object Thrown if argument fileName is empty. Thrown if argument fileName is null Thrown if the file specified by argument fileName is not found. Defines the different Execution Policies supported by the PSAuthorizationManager class. Unrestricted - No files must be signed. If a file originates from the internet, Monad provides a warning prompt to alert the user. To supress this warning message, right-click on the file in File Explorer, select "Properties," and then "Unblock." RemoteSigned - Only .msh and .mshxml files originating from the internet must be digitally signed. If remote, signed, and executed, Monad prompts to determine if files from the signing publisher should be run or not. This is the default setting. AllSigned - All .msh and .mshxml files must be digitally signed. If signed and executed, Monad prompts to determine if files from the signing publisher should be run or not. Restricted - All .msh files are blocked. Mshxml files must be digitally signed, and by a trusted publisher. If you haven't made a trust decision on the publisher yet, prompting is done as in AllSigned mode. Bypass - No files must be signed, and internet origin is not verified Undefined - Not specified at this scope Default - The most restrictive policy available. Defines the available configuration scopes for an execution policy. They are in the following priority, with successive elements overriding the items that precede them: LocalMachine -> CurrentUser -> Runspace Execution policy is retrieved from the PSExecutionPolicyPreference environment variable. Execution policy is retrieved from the HKEY_CURRENT_USER registry hive for the current ShellId. Execution policy is retrieved from the HKEY_LOCAL_MACHINE registry hive for the current ShellId. Execution policy is retrieved from the current user's group policy setting. Execution policy is retrieved from the machine-wide group policy setting. The SAFER policy associated with this file Explicitly allowed through an Allow rule Allowed because it has not been explicitly disallowed Disallowed by a rule or policy. Get the pass / fail result of calling the SAFER API The path to the file in question Returns the value of the Execution Policy as retrieved from group policy. NULL if it is not defined at this level Returns the value of the Execution Policy as retrieved from the local preference. NULL if it is not defined at this level throw if file does not exist path to file Does not return a value check to see if the specified cert is suitable to be used as a code signing cert certificate object true on success, false otherwise check if the specified cert has a private key in it certificate object true on success, false otherwise Get the EKUs of a cert certificate object a collection of cert eku strings convert an int to a DWORD signed int number DWORD convert a DWORD to int number int information used for filtering a set of certs purpose of a certificate SSL Server Authentication DNS name of a certificate EKU OID list of a certificate remaining validity period in days for a certificate combine properties into a filter string Defines the valid purposes by which we can filter certificates. Certificates that can be used to sign code and scripts. Certificates that can be used for any purpose. Defines the attribute used to designate a cmdlet parameter as one that should accept credentials. Transforms the input data to an PSCredential. The engine APIs for the context under which the transformation is being made. If Null, the transformation prompts for both Username and Password If a string, the transformation uses the input for a username, and prompts for a Password If already an PSCredential, the transform does nothing. An PSCredential object representing the inputData. helper class for secure string related functionality Create a new SecureString based on the specified binary data. The binary data must be byte[] version of unicode char[], otherwise the results are unpredictable. input data a SecureString get the contents of a SecureString as byte[] input string contents of s (char[]) converted to byte[] Encode the specified byte[] as a unicode string. Currently we use simple hex encoding but this method can be changed to use a better encoding such as base64. binary data to encode a string representing encoded data Convert a string obtained using ByteArrayToString() back to byte[] format. encoded input string bin data as byte[] return contents of the SecureString after encrypting using DPAPI and encoding the encrypted blob as a string SecureString to protect a string (see summary) Decrypts the specified string using DPAPI and return equivalent SecureString. The string must be obtained earlier by a call to Protect() encrypted string SecureString return contents of the SecureString after encrypting using the specified key and encoding the encrypted blob as a string input string to encrypt encryption key a string (see summary) return contents of the SecureString after encrypting using the specified key and encoding the encrypted blob as a string input string to encrypt encryption key a string (see summary) Decrypts the specified string using the specified key and return equivalent SecureString. The string must be obtained earlier by a call to Encrypt() encrypted string encryption key encryption initialization vector. If this is set to null, the method uses internally computed strong random number as IV SecureString Decrypts the specified string using the specified key and return equivalent SecureString. The string must be obtained earlier by a call to Encrypt() encrypted string encryption key encryption initialization vector. If this is set to null, the method uses internally computed strong random number as IV SecureString Helper class to return encryption results, and the IV used to do the encryption Gets the encrypted data Gets the IV used to encrypt the data This is used for automatic conversions to be performed in shell variables. This ctor form is used to initialize shell variables whose type is not permitted to change. Holds the strings used as the default drive names for all the default providers The default VariableProvider drive name The default EnvironmentProvider drive name The default AliasProvider drive name The default FunctionProvider drive name Defines the names of the internal providers. Derived classes exist for custom and single shells. In the single shell the provider name includes the PSSnapin name. In custom shells it does not. Gets the name of the EnvironmentProvider Gets the name of the Certificate Gets the name of the VariableProvider Gets the name of the AliasProvider Gets the name of the FunctionProvider Gets the name of the FileSystemProvider Gets the name of the RegistryProvider The provider names for custom shells Gets the name of the EnvironmentProvider Gets the name of the Certificate Gets the name of the VariableProvider Gets the name of the AliasProvider Gets the name of the FunctionProvider Gets the name of the FileSystemProvider Gets the name of the RegistryProvider The provider names for the single shell Gets the name of the EnvironmentProvider Gets the name of the Certificate Gets the name of the VariableProvider Gets the name of the AliasProvider Gets the name of the FunctionProvider Gets the name of the FileSystemProvider Gets the name of the RegistryProvider Enumerates the items matching a particular name in the scopes specified using the appropriate scoping lookup rules. The type of items that the derived class returns. Constructs a scoped item searcher. The state of the engine instance to enumerate through the scopes. The parsed name of the item to lookup. If or is null. Gets the current object as an IEnumerator The current object as an IEnumerator. Moves the enumerator to the next matching scoped item. True if another matching scoped item was found, or false otherwise. Derived classes override this method to return their particular type of scoped item. The scope to look the item up in. The name of the item to retrieve. The scope item that the derived class should return. True if the scope item was found or false otherwise. Gets the current scoped item Gets the lookup scope that the Current item was found in. Gets the scope in which the search begins. The scope searcher for variables Derived classes override this method to return their particular type of scoped item. The scope to look the item up in. The name of the item to retrieve. The scope item that the derived class should return. True if the scope item was found or false otherwise. The scope searcher for aliases Derived classes override this method to return their particular type of scoped item. The scope to look the item up in. The name of the item to retrieve. The scope item that the derived class should return. True if the scope item was found or false otherwise. The scope searcher for functions Derived classes override this method to return their particular type of scoped item. The scope to look the item up in. The name of the item to retrieve. The scope item that the derived class should return. True if the scope item was found or false otherwise. The scope searcher for drives Derived classes override this method to return their particular type of scoped item. The scope to look the item up in. The name of the item to retrieve. The scope item that the derived class should return. True if the scope item was found or false otherwise. Baseclass for defining elements that can be added to an InitialSessionState object. ctor so that each derived class has a name Shallow-clone this object The cloned object... The name of this entry The SnapIn to load from initially The SnapIn to load from initially Class to constrain session state entries Command class so that all the commands can derive off this one. Adds the flexibility of adding addditional derived class, such as ProxyCommand for Exchange. Derived classes - Alias, Application, Cmdlet, Function, Script. Base constructor for all SessionState commands. Is internal so it can be set by the engine code... Is internal so it can be set by the engine code... This is used to specify whether this command was imported or not If noClobber is specified during Import-Module, it is set to false Returns the type of the command using an enum instead of requiring a full reflection type check. Type file configuration entry... Loads all entries from the types file. Loads all the types specified in the typeTable Loads all entris from the typeData Shallow-clone this object The cloned object The pathname of the types.ps1xml file. This can be null if TypeTable constructor or TypeData constructor is used. The TypeTable specified with constructor. This can be null if FileName constructor or TypeData constructor is used. The TypeData we want to update with. This can be null if FileName constructor or TypeTable constructor is used. The operation will be done on the typedata. This is only meaningful when the TypeData constructor is used. Format file configuration entry... Loads the entire formats file Loads all the format data specified in the formatTable Loads all the format data specified in the typeDefinition Shallow-clone this object... The cloned object The name of the format file referenced by this entry... The FormatTable specified with constructor. This can be null if FileName constructor is used. The FormatData specified with constructor. This can be null if FileName or FormatTable constructor is used An assembly to load for this sessionstate... Create a named entry for the assembly to load with both the name and the path to the assembly as a backup. The name of the assembly to load The path to the assembly to use as an alternative Create a named entry for the assembly to load, specifying just the nanme The name of the assembly to load Shallow-clone this object The cloned object Return the assembly file name... List a cmdlet to add to this session state entry Shallow-clone this object... Shallow-clone this object... The cloned object Create a session state command entry instance. The path to the script Create a session state command entry instance with the specified visiblity. The path to the script Visibility of the script. Shallow-clone this object... The cloned object Define an alias entry to add to the initial session state Name of the aliase The name of the command it resolves to Define an alias entry to add to the initial session state Name of the aliase The name of the command it resolves to A descripion of the purpose of the alias. Define an alias entry to add to the initial session state Name of the aliase The name of the command it resolves to A descripion of the purpose of the alias. Options defining the scope visiblity, readonly and constant Define an alias entry to add to the initial session state Name of the aliase The name of the command it resolves to A descripion of the purpose of the alias. Options defining the scope visiblity, readonly and constant Shallow-clone this object... The cloned object The string defining the body of this alias... A string describing this alias... Options controling scope visiblity and setability for this entry. Used to define a permitted script in this session state. If the path is "*", then any path is permitted. The full path to the application Used to define a permitted script in this session state. If the path is "*", then any path is permitted. The full path to the application Sets the external visibilty of the path. Shallow-clone this object... The cloned object The path to this application... Represents a function definition in an Initial session state object. The name of the function The definition of the function Options controlling scope-related elements of this object The name of the help file associated with the function Represents a function definition in an Initial session state object. The name of the function The definition of the function The name of the help file associated with the function Represents a function definition in an Initial session state object. The name of the function The definition of the function This is an internal copy constructor. Shallow-clone this object... The cloned object Sets the name of the help file associated with the function. The string to use to define this function... The script block for this function. Options controling scope visiblity and setability for this entry. The name of the help file associated with the function. Represents a workflow definition in an Initial session state object. The name of the workflow The definition of the workflow Options controlling scope-related elements of this object The name of the help file associated with the workflow Represents a workflow definition in an Initial session state object. The name of the workflow The definition of the workflow The name of the help file associated with the workflow Represents a workflow definition in an Initial session state object. The name of the workflow The definition of the workflow This is an internal copy constructor. Shallow-clone this object... The cloned object Sets the name of the help file associated with the function. The string to use to define this function... The script block for this function. Options controling scope visiblity and setability for this entry. The name of the help file associated with the function. Is used to define a variable that should be created when the runspace is opened. Note - if this object is cloned, then the clone will contain a reference to the original object not a clone of it. The name of the variable The value to set the variable to A descriptive string to attach to the variable. Is used to define a variable that should be created when the runspace is opened. Note - if this object is cloned, then the clone will contain a reference to the original object not a clone of it. The name of the variable The value to set the variable to A descriptive string to attach to the variable. Options like readonly, constant, allscope, etc. Is used to define a variable that should be created when the runspace is opened. Note - if this object is cloned, then the clone will contain a reference to the original object not a clone of it. The name of the variable The value to set the variable to A descriptive string to attach to the variable. Options like readonly, constant, allscope, etc. A list of attributes to attach to the variable. Is used to define a variable that should be created when the runspace is opened. Note - if this object is cloned, then the clone will contain a reference to the original object not a clone of it. The name of the variable The value to set the variable to A descriptive string to attach to the variable. Options like readonly, constant, allscope, etc. A single attribute to attach to the variable. Is used to define a variable that should be created when the runspace is opened. Note - if this object is cloned, then the clone will contain a reference to the original object not a clone of it. The name of the variable The value to set the variable to A descriptive string to attach to the variable. Options like readonly, constant, allscope, etc. A single attribute to attach to the variable. Shallow-clone this object... The cloned object The value to bind to this variable. The description associated with this variable. The options associated with this variable (e.g. readonly, allscope, etc.) The attributes that will be attached to this object. Create an empty collection... Create an new collection, copying in the passed items... Clone this collection The cloned object Reset the collection Remove a number of items starting at the specified index. Clears the collection... This overload exists so that we can remove items based on the item name, rather than its position in the collection. The type argument can be null but we'll throw an error if we can't distinguish between multiple entries of the same name but different types and the type hasn't been specified. BUGBUG - brucepay - the throw thing is not implemented yet... The name of the element to remove The type of object to remove, can be null to remove any type. Add an item to this collection. The item to add... Get enumerator for this collection. Get enumerator for this collection. Returns a count of the number of items in the collection... To find the entries based on name. Why collection - Different SnapIn/modules and same entity names. If used on command collection entry, then for the same name, one can have multiple output Allows you to define the set of elements that should be present when Session State is created. Creates an instance that exposes only the minimal set of commands needed by give set of All commands that are not needed are made private in order to minimize the attack surface. What capabilities the session should have. this cmdlets are exposed due to some bugs. Need to figure out if they are still required ctor for Custom-Shell - Do we need this? Creates an empty InitialSessionState object... Creates the default PowerShell one with default cmdlets, provider etc. BuiltIn functions, aliases need to be available through default InitialSessionstate constructor. Need to have this discussion for packaging as well. Creates the default PowerShell one with default cmdlets, provider etc. The default cmdlets, provider, etc are loaded via Modules Clone this InitialSessionState object. The collections are recursively cloned as well as the elements in the collections. Note however, that the contents of the individual entries are not deep-cloned. This is only an issue for variable entries which may have reference types. These objects will be added by reference rather than by value. The cloned object. Want to get away from SnapIn and console file. Have modules and assemblies instead. Specify the registered SnapIn name or name collection This property will be set only if we are refreshing the Type/Format settings by calling UpdateTypes/UpdateFormats directly. In this case, we should wait until all type/format entries get processed. After that, if there were errors generated, we throw them as an exception. Add a list of modules to import when the runspace is created. The modules to add Add a list of modules to import when the runspace is created. The modules, whose specificiations are specified by , to add. Imports all the modules from the specified module path by default path from which all modules need to be imported Add a list of core modules to import when the runspace is created. The modules to add Reinitializes elements of the associated runspace to their initial values. This allows for runspace reuse with minimal chance for contamination. Remove anything that would have been bound by this ISS instance. At this point, it removes assemblies and cmdlet entries at the top level. It also removes types and formats. The other entry types - functions, variables, aliases are not removed by this function. Update the type metadata loaded into this runspace The execution context for the runspace to update if true, re-initialize the metadata collection... True if the format data has been pre-validated (build time, manual testing, etc) so that validation can be skipped at runtime. Update the formatting information for a runspace The execution context for the runspace to be updated True if we only want to add stuff, false if we want to reinitialize Need to have SnapIn support till we move to modules This is a "proxy" snapin that loads a subset of cmdlets from another snapin... The snapin to examine. This is the default function to use for tab expansion. This is the default function to use for 'Import System Modules'. Win8: 320909. Retaining the original definition to ensure backward compatability. This is the default function to use for man/help. It uses splatting to pass in the parameters. Specifies the language mode to be used for this session state instance If true the PowerShell debugger will use FullLanguage mode, otherwise it will use the current language mode ApartmentState of the thread used to execute commands This property determines whether a new thread is create for each invocation of a command If this property is set and there was a runspace creation error, then throw an exception, otherwise just continue creating the runspace even though it may be in an inconsistent state. Specifies the authorization manager to be used for this session state instance. If no authorization manager is specified, then the default authroization manager for PowerShell will be used which checks the ExecutionPolicy before running a command. Imported modules. Gets the dictionary of core modules to import on runspace creation... Load modules for Tab Completion when the engine is idle The list of assemblies to load... List of types to use for this session state instance... If set to true, disables any updates to format table. This includes disabling format table updates throught Update-FormatData, Import-Module etc. All the disabling happens silently ie., the user will not get any exception. By default, this is set to False. List of commands (Alias, Application, Cmdlets, Function, Script) for this entry. Returns a new array of alias entries everytime it's called. This can't be static because the elements may be mutated in different session state objects so each session state must have a copy of the entry. Set of helper methods fro loading assemblies containing cmdlets... A variable that represents the maximum capacity for object types in a scope. An separate instance is created for functions, aliases, variables, and drives. Represents a variable in the PowerShell language. Constructs a variable with the given name. The name of the variable. If is null or empty. Constructs a variable with the given name, and value. The name of the variable. The value of the variable. If is null or empty. Constructs a variable with the given name, value, and options. The name of the variable. The value of the variable. The constraints of the variable. Note, variables can only be made constant in the constructor. If is null or empty. Constructs a variable with the given name, value, options, and description. The name of the variable. The value of the variable. The constraints of the variable. Note, variables can only be made constant in the constructor. The description for the variable. If is null or empty. Constructs a variable with the given name, value, options, and description. The name of the variable. The value of the variable. The constraints of the variable. Note, variables can only be made constant in the constructor. The attributes for the variable. ValidateArgumentsAttribute and derived types will be used to validate a value before setting it. The description for the variable. If is null or empty. Constructs a variable with the given name, value, options, and attributes The name of the variable. The value of the variable. The constraints of the variable. Note, variables can only be made constant in the constructor. The attributes for the variable. ValidateArgumentsAttribute and derived types will be used to validate a value before setting it. If is null or empty. If the validation metadata identified in throws an exception. Checks if the given value meets the validation attribute constraints on the PSVariable. value which needs to be checked If is null or if no attributes are set, then the value is deemed valid. If the validation metadata throws an exception. Determines if the value is valid for the specified attribute The variable value to validate. The attribute to use to validate that value. True if the value is valid with respect to the attribute, or false otherwise. Runs all ArgumentTransformationAttributes that are specified in the Attributes collection on the given value in the order that they are in the collection. The attributes to use to transform the value. The value to be transformed. The transformed value. If the argument transformation fails. Parameter binding does the checking and conversions as specified by the attributes, so repeating that process is slow and wrong. This function applies the attributes without repeating the checks. The list of attributes to add Verifies the constraints and attributes before setting the value The value to be set. If the variable is read-only or constant. If the validation metadata throws an exception or the value doesn't pass the validation metadata. Gets the name of the variable. Gets or sets the description of the variable. Gets or sets the value of the variable If the variable is read-only or constant upon call to set. is not valid according to one or more of the attributes of this shell variable. If true, then this variable is visible outside the runspace. The module where this variable was defined. The name of the module that defined this variable. Gets or sets the scope options on the variable. Upon set, if the variable is constant or if contains the constant flag. Gets the collection that contains the attributes for the variable. To add or remove attributes, get the collection and then add or remove attributes to that collection. Returns true if the PSVariable is constant (only visible in the current scope), false otherwise. Returns true if the PSVariable is readonly (only visible in the current scope), false otherwise. Returns true if the PSVariable is private (only visible in the current scope), false otherwise. Returns true if the PSVariable is propagated to all scopes when the scope is created. Indicates that the variable has been removed from session state and should no longer be considered valid. This is necessary because we surface variable references and can consequently not maintain transparent integrity. Constructs an instance of the variable with the specified name and initial capacity. The name of the variable. The initial capacity The maximum capacity for the scope. The minimum capacity for the scope. Scoped item options for this variable Constructs an instance of the variable with the specified name and initial capacity. The name of the variable. A reference to a SessionStateCapacityVariable in another scope. The value will be shared in this scope unless the capacity gets set in this scope. The scoped item options for this variable Overrides the base IsValidValue to ensure the value is an int. The value to test. true if the value is an int and the base class IsValidValue is true, otherwise false. If the validation metadata throws an exception. Gets or sets the value of the variable. This class will always return an int from the getter. The value is either inherited from a parent scope, or stored locally Provides fast access to the capacity variable as an int, eliminating the need for casts... A variable that represents $? Constructs an instance of the variable with execution context. Execution context Gets or sets the value of the variable. A variable that represents $PSCulture Constructs an instance of the variable. Gets or sets the value of the variable. A variable that represents $PSUICulture Constructs an instance of the variable. Gets or sets the value of the variable. A SessionStateScope defines the scope of visibility for a set of virtual drives and their data. Constructor for a session state scope. The parent of this scope. It can be null for the global scope. Adds a new drive to the scope's drive collection. The new drive to be added. This method assumes the drive has already been verified and the provider has already been notified. If is null. If a drive of the same name already exists in this scope. If the maximum drive count has been reached for this scope. Removes the specified drive from this scope. The drive to be removed. This method assumes that the drive has already been validated for removal by the provider. If is null. Removes all the drives from the scope. Retrieves the drive of the specified name. The name of the drive to retrieve. An instance of a PSDriveInfo object with the specified name if one exists in this scope or null if one does not exist. If is null. Gets the specified variable from the variable table. The name of the variable to retrieve. The origin of the command trying to retrieve this variable... The PSVariable representing the variable specified. Gets the specified variable from the variable table. The name of the variable to retrieve. The PSVariable representing the variable specified. Looks up a variable, returns true and the variable if found and is visible, throws if the found variable is not visible, and returns false if there is no variable with the given name in the current scope. The name of the variable. The command origin (where the scope was created), used to decide if the variable is visible. true if looking up the variable as part of a new or set variable operation The variable, if one is found in scope Thrown if the variable is not visible based on CommandOrigin. True if there is a variable in scope, false otherwise. Sets a variable to the given value. The name of the variable to set. The value for the variable If true, sets the variable value to newValue. If false, newValue must be a PSVariable object and the item will be set rather than the value. If true, the variable will be set even if it is readonly. Which SessionState this variable belongs to. The origin of the caller If true and the variable is being set in the global scope, then all of the normal variable lookup stuff is bypassed and the variable is added directly to the dictionary. The PSVariable representing the variable that was set. If the variable is read-only or constant. If the maximum number of variables has been reached for this scope. Sets a variable to the given value. The new variable to create. If true, the variable will be set even if it is readonly. Which SessionState this variable belongs to. The PSVariable representing the variable that was set. If the variable is read-only or constant. If the maximum number of variables has been reached for this scope. Removes a variable from the variable table. The name of the variable to remove. If true, the variable will be removed even if its ReadOnly. if the variable is constant. For most scopes (global scope being the notable exception), most variables are known ahead of time and stored in a tuple. The names of those variables are stored separately, this method determines if variable name is active in this scope, and if so, returns a wrapper around the tuple to access the property in the tuple for the given variable. Gets the specified alias from the alias table. The name of the alias to retrieve. The string representing the value of the alias specified. Sets an alias to the given value. The name of the alias to set. The value for the alias The execution context for this engine instance. If true, the value will be set even if the alias is ReadOnly. Origin of the caller of this API The string representing the value that was set. if the alias is read-only or constant. If the maximum number of aliases has been reached for this scope. Sets an alias to the given value. The name of the alias to set. The value for the alias The execution context for this engine instance. The options to set on the alias. If true, the value will be set even if the alias is ReadOnly. Origin of the caller of this API The string representing the value that was set. If the alias is read-only or constant. If the maximum number of aliases has been reached for this scope. Sets an alias to the given value. The information about the alias to be set If true, the alias will be set even if there is an existing ReadOnly alias. Specifies the command origin of the calling command. The string representing the value that was set. If the alias is read-only or constant. If the maximum number of aliases has been reached for this scope. Removes a alias from the alias table. The name of the alias to remove. If true, the alias will be removed even if it is ReadOnly. If the alias is constant. Gets the specified function from the function table. The name of the function to retrieve. A FunctionInfo that is either a FilterInfo or FunctionInfo representing the function or filter. Sets an function to the given function declaration. The name of the function to set. The script block that represents the code for the function. If true, the function will be set even if its ReadOnly. The origin of the caller of this API The execution context for the function/filter. A FunctionInfo that is either a FilterInfo or FunctionInfo representing the function or filter. If the function is read-only or constant. If the maximum number of functions have been reached for this scope. Sets an function to the given function declaration. The name of the function to set. The script block that represents the code for the function. The original function (if any) from which the scriptblock was derived. If true, the function will be set even if its ReadOnly. The origin of the caller of this API The execution context for the function/filter. A FunctionInfo that is either a FilterInfo or FunctionInfo representing the function or filter. If the function is read-only or constant. If the maximum number of functions have been reached for this scope. Sets an function to the given function declaration. The name of the function to set. The script block that the function should represent. The original function (if any) from which the scriptblock was derived. The options that should be applied to the function. If true, the function will be set even if its ReadOnly. The origin of the caller of this API The execution context for the function/filter. A FunctionInfo that is either a FilterInfo or FunctionInfo representing the function or filter. If the function is read-only or constant. If the maximum number of functions have been reached for this scope. Sets an function to the given function declaration. The name of the function to set. The script block that the function should represent. The original function (if any) from which the scriptblock was derived. The options that should be applied to the function. If true, the function will be set even if its ReadOnly. The origin of the caller of this API The execution context for the function/filter. The name of the help file associated with the function. Function to create the FunctionInfo. A FunctionInfo that is either a FilterInfo or FunctionInfo representing the function or filter. If the function is read-only or constant. If the maximum number of functions have been reached for this scope. Removes a function from the function table. The name of the function to remove. If true, the function is removed even if it is ReadOnly. If the function is constant. Gets the specified cmdlet from the cmdlet table. The name of the cmdlet to retrieve. A CmdletInfo representing this cmdlet Adds a cmdlet to the cmdlet cache. The name of the cmdlet to add. The cmdlet that should be added. The origin of the caller of this API The execution context for the cmdlet. A CmdletInfo representing the cmdlet If the cmdlet is read-only or constant. Removes a cmdlet from the cmdlet table. The name of the cmdlet to remove. The index at which to remove the cmdlet If index is -1, remove all cmdlets with that name If true, the cmdlet is removed even if it is ReadOnly. If the cmdlet is constant. Removes a cmdlet entry from the cmdlet table. The key for the cmdlet entry to remove. If true, the cmdlet entry is removed even if it is ReadOnly. If the cmdlet is constant. Contains the virtual drives for this scope. Contains the drives that have been automounted by the system. Add the built-in variables defined by the session state scope. A collection of the aliases defined for the session. A collection of the functions defined in this scope... All entries in this table should also be in the normal function table. The entries in this table are automatically propagated to new scopes. A collection of the cmdlets defined in this scope... All entries in this table should also be in the normal cmdlet table. The entries in this table are automatically propagated to new scopes. The variable that represents $true in the language. We don't need a new reference in each scope since it is ScopedItemOptions.Constant. The variable that represents $false in the language. We don't need a new reference in each scope since it is ScopedItemOptions.Constant. The variable that represents $null in the language. We don't need a new reference in each scope since it is ScopedItemOptions.Constant. Gets the alises by command name (used by metadata-driven help) Gets the parent scope of this scope. May be null for the global scope. Defines the origin of the command that resulted in this scope being created. The script scope for this scope. It may reference itself but may not be a null reference. If is null when setting the property. The version of strict mode for the interpreter. Which version of strict mode is active for this scope and it's children. Some local variables are stored in this tuple (for non-global scope, any variable assigned to, or parameters, or some predefined locals.) When dotting a script, no new scope is created. Automatic variables must go somewhere, so rather than store them in the scope they are dotted into, we just store them in a tuple like any other local variable so we can skip saving and restoring them as the scopes change, instead it's a simple push/pop of this stack. This works because in a dotted script block, the only locals in the tuple are the automatic variables, all other variables use the variable apis to find the variable and get/set it. Gets an IEnumerable for the drives in this scope. Gets an IDictionary for the variables in this scope. Gets an IEnumerable for the aliases in this scope. Gets an IEnumerable for the functions in this scope. Gets an IEnumerable for the cmdlets in this scope. Gets the cmdlet cache for this scope instance... Gets the All scope cmdlet cache... Constructs an enumerator for enumerating through the session state scopes using the appropriate scoping rules (default to dynamic scoping). The starting scope to start the enumeration from. Uses the proper scoping rules to get the next scope to do the lookup in. True if the enumerator was advanced to the next scope, or false otherwise. Sets the enumerator to before the first scope Gets the IEnumerator for this class The IEnumerator interface for this class. Gets the current lookup scope The enumerator is positioned before the first element of the collection or after the last element. Holds the #defines for any special strings used in session state. The separator used in provider base paths. The format is providerId::providerPath. The default path separator used by the base implementation of the providers. The alternate path separator used by the base implementation of the providers. The default path prefix for remote paths. This is to mimic UNC paths in the file system. The alternate path prefix for remote paths. This is to mimic UNC paths in the file system. The character used in a path to indicate the home location. name of the global variable table in Variable scopes of session state. Name of the current scope variable table of session state. When prefixing a variable "private" makes the variable only visible in the current scope. When prefixing a variable "script" makes the variable global to the scipt but not global to the entire session. session state string used as resource name in exceptions The file extension (including the dot) of an PowerShell script file The file extension (including the dot) of an PowerShell module file The file extension (including the dot) of a PowerShell cmdletization file The file extension (including the dot) of a PowerShell declarative session configuration file The file extension (including the dot) of an PowerShell data file The file extension (including the dot) of an workflow file The file extension (including the dot) of an workflow dependent assembly The default verb/noun separator for a command. verb-noun or verb/noun The default verb to try if the command was not resolved The default extension for a help file relative to its code assembly name. The language representation of null. The language representation of null. The language representation of false. The language representation of true. The escape character used in the language. The default cmdlet adapter for cmdletization / cdxml modules This class holds the integer constants used in Session State The default maximum for the number of variables Max # of variables allowed in a scope in Session State Min # of variables allows in a scope in Session State The default maximum for the number of aliases Max # of aliases allowed in a scope in Session State Min # of aliases allowed in a scope in Session State The default maximum for the number of functions Max # of functions allowed in a scope in Session State Min # of functions allowed in a scope in Session State The default maximum for the number of drives Max # of drives allowed in a scope in Session State Min # of drives allowed in a scope in Session State The default maximum for the number of errors Max # of errors allowed in a scope in Session State Min # of errors allowed in a scope in Session State The default capacity for a Dictionary store default load factor on a hash table This class has static methods that are used in Session State Converts the specified array into a collection of the specified type. The array to be converted. A collection of the elements that were in the array. Converts the specified list into a collection of the specified type. The list to be converted. A collection of the elements that were in the array. Compares the elements in the specified collection with value specified. If the string comparer is specified it is used for the comparison, else the .Equals method is used. The collection to check for the value. The value to check for. If specified the comparer will be used instead of .Equals. true if the value is contained in the collection or false otherwise. If is null. Constructs a collection of WildcardPatterns for the specified string collection. The string patterns to construct the WildcardPatterns for. The options to create the WildcardPatterns with. A collection of WildcardPatterns that represent the string patterns that were passed. Constructs a collection of WildcardPatterns for the specified string collection. The string patterns to construct the WildcardPatterns for. The options to create the WildcardPatterns with. A collection of WildcardPatterns that represent the string patterns that were passed. Determines if the specified text matches any of the patterns The text to check against the wildcard pattern. An array of wildcard patterns. If the array is empty or null the text is deemed to be a match. The default value that should be returned if is empty or null. True if the text matches any of the patterns OR if patterns is null or empty and defaultValue is True. Converts an OpenMode enum value to a FileMode The OpenMode value to be converted. The FileMode representation of the OpenMode. The enum used by commands to allow the user to specify how a file (or other item) should be opened. This opens the file for appending (similar to FileMode.Append) The file must be created new. If the file exists it is an error (similar to FileMode.CreateNew) Creates a new file, if the file already exists it is overwritten (similar to FileMode.Create) This class is used for $null. It always returns null as a value and accepts any value when it is set and throws it away. Constructor that calls the base class constructor with name "null" and value null. Always returns null from get, and always accepts but ignores the value on set. Gets the description for $null. Gets the scope options for $null which is always None. The options that define some of the constraints for session state items like variables, aliases, and functions. There are no constraints on the item. The item is readonly. It can be removed but cannot be changed. The item cannot be removed or changed. This flag can only be set a variable creation. The item is private to the scope it was created in and cannot be seen from child scopes. The item is propagated to each new child scope created. The option is not specified by the user A collection of the attributes on the PSVariable object. Constructs a variable attribute collection attached to the specified variable. Whenever the attributes change the variable value is varified against the attribute. The variable that needs to be verified anytime an attribute changes. If is null. Ensures that the variable that the attribute is being added to is still valid after the attribute is added. The zero-based index at which should be inserted. The attribute being added to the collection. If the new attribute causes the variable to be in an invalid state. If the new attribute is an ArgumentTransformationAttribute and the transformation fails. Ensures that the variable that the attribute is being set to is still valid after the attribute is set. The zero-based index at which should be set. The attribute being set in the collection. If the new attribute causes the variable to be in an invalid state. Ordinarily, the collection checks/converts the value (by applying the attribute) when an attribute is added. This is both slow and wrong when the attributes have already been checked/applied during parameter binding. So if checking has already been done, this function will add the attribute without checking and possibly updating the value. The attribute to add Validates and performs any transformations that the new attribute implements. The new attribute to be added to the collection. The new variable value. This may change from the original value if the new attribute is an ArgumentTransformationAttribute. The variable whose value needs to be verified anytime the attributes change. A variable path that you can query the scope and drive of the variable reference. Stores the path that was passed to the constructor. The name of the variable without any scope or drive. Store flags about the path, such as private/global/local/etc. Private constructor for CloneAndSetLocal(). Constructs a variable path. The path to parse. If is null. Constructs a scoped item lookup path. The path to parse. These flags for anything known about the path (such as, is it a function) before being scanned. If is null. Helpful for debugging. Gets the full path including any possibly specified scope and/or drive name. Returns true if the path explicitly specifies 'global:'. Returns true if the path explicitly specifies 'local:'. Returns true if the path explicitly specifies 'private:'. Returns true if the path explicitly specifies 'script:'. Returns true if the path specifies no drive or scope qualifiers. Returns true if the path specifies a variable path with no scope qualifiers. Returns true if the path defines a variable. Returns true if the path defines a function. Returns true if the path specifies a drive other than the variable drive. The drive name, or null if the path is for a variable. It may also be null for some functions (specifically if this is a FunctionScopedItemLookupPath.) Gets the namespace specific string Return the drive qualified name, if any drive specified, otherwise the simple variable name. This class is responsible for loading resources using the PSSnapin dll and associated registry entries. The class creates an app-domain to load the resource assemblies in. Upon dispose the class unloads the app-domain to ensure the assemblies get unloaded. It uses ReflectionOnlyLoad and ReflectionOnlyLoadFrom to ensure that no code can execute and that dependencies are not loaded. This allows us to load assemblies that were built with different version of the CLR. Creates an instance of the RegistryStringResourceIndirect class. A new instance of the RegistryStringResourceIndirect class. Set to true when object is disposed Dispose method unloads the app domain that was created in the constructor. The app-domain in which the resources will be loaded. The class that is created in the app-domain which does the resource loading. Creates the app-domain and the instance of the ResourceRetriever and sets the private fields with the references. Retrieves a resource string based on a resource reference stored in the specified registry key. The key in which there is a value that contains the reference to the resource to retrieve. The name of the value in the registry key that contains the reference to the resource. The full name of the assembly from which to load the resource. The full path of the assembly from which to load the resource. The resource string that was loaded or null if it could not be found. This method ensures that an appropriate registry entry exists and that it contains a properly formatted resource reference ("BaseName,ResourceID"). It then creates an app-domain (or uses and existing one if it already exists on the instance of the class) and an instance of the ResourceRetriever in that app-domain. It then calls the ResourceRetriever to load the specified assembly and retrieve the resource. The assembly is loaded using ReflectionOnlyLoad or ReflectionOnlyLoadFrom using the assemblyName or moduleName (respectively) so that no code can be executed. The app-domain is unloaded when this class instance is disposed. Retrieves a resource string based on a resource reference supplied in . The full name of the assembly from which to load the resource. The full path of the assembly from which to load the resource. A comma separated basename and resource id pair. The resource string that was loaded or null if it could not be found. This method ensures that is a properly formatted resource reference ("BaseName,ResourceID"). It then creates an app-domain (or uses an existing one if it already exists on the instance of the class) and an instance of the ResourceRetriever in that app-domain. It then calls the ResourceRetriever to load the specified assembly and retrieve the resource. The assembly is loaded using ReflectionOnlyLoad or ReflectionOnlyLoadFrom using the assemblyName or moduleName (respectively) so that no code can be executed. The app-domain is unloaded when this class instance is disposed. Retrieves a string value from the registry The key to retrieve the value from. The name of the value to retrieve. The string value of the registry key value. This class is the worker class used by RegistryStringResourceIndirect to load the resource assemblies and retrieve the resources inside the alternate app-domain. Loads the specified assembly in the app-domain and retrieves the specified resource string. Full name of the assembly to retrieve the resource from. Full path of the assembly to retrieve the resource from. The resource base name to retrieve. The resource ID of the resource to retrieve. The value of the specified string resource or null if the resource could not be found or loaded. Loads the specified assembly using ReflectionOnlyLoad or ReflectionOnlyLoadFrom The FullName of the assembly to load. This takes precendence over the modulePath and will be passed to as a parameter to the ReflectionOnlyLoad. The full path of the assembly to load. This is used if the ReflectionOnlyLoad using the assemblyName doesn't load the assembly. It is passed as a parameter to the ReflectionOnlyLoadFrom API. An loaded instance of the specified resource assembly or null if the assembly couldn't be loaded. Since the intent of this method is to load resource assemblies, the standard culture fallback rules apply. If the assembly couldn't be loaded for the current culture we fallback to the parent culture until the neutral culture is reached or an assembly is loaded. Attempts to load the assembly for the specified culture The culture for which the assembly should be loaded. The name of the assembly without culture information (or at least undefined culture information). The directory containing the neutral culture assembly. The name of the assembly file. An instance of the loaded resource assembly or null if the assembly could not be loaded. Retrieves the specified resource string from the resource stream. The resource stream containing the desired resource. The identifier of the string resource to retrieve from the stream. The resource string or null if the resourceID could not be found. Runspace config for single shell are a special kind of runspace configuration that is generated for single shells. This class needs to handle the standard managment of 1. consoleInfo: each instance of this class will have a consoleInfo object. 2. interface to consoleInfo. This includes "open", "save", and "change" of consoleInfo and console files. 3. interface to mshsnapin's. This includes add, remove and list mshsnapins in console file. This class derives from RunspaceConfiguration and supports basic information for cmdlets, providers, types, formats, etc. Eventually when minishell model goes away, RunspaceConfiguration and RunspaceConfigForSingleShell may merge into one class. One or more default mshsnapins cannot be loaded because the registry is not populated correctly. fileName is null. fileName does not specify proper file extension. Unable to load/parse the file specified by fileName. One or more default mshsnapins cannot be loaded because the registry is not populated correctly. mshSnapInID is empty or null. PSSnapIn is already loaded. No PSSnapIn with given id found. PSSnapIn cannot be loaded. Caller doesn't have permission to read keys. mshSnapInID is null. mshSnapInID is either a default mshsnapin or not loaded. Gets the shell id for current runspace configuration. Gets the cmdlets defined in runspace configuration. Gets the providers defined in runspace configuration. Gets the type data files defined in runspace configuration. Gets the format data files defined in runspace configuration. Gets the initialization scripts defined in runspace configuration. Class that understands Monad Console File Format. The format for the console file is applied/read by this class only. Functionality: 1. Schema version verification check. 2. Data values for the content represented by Console file. Later this data is used by other components ( MshConsoleInfo ) to construct Monad Types ( like PSSnapInInfo ). 3. Owns responsibilty to read/write Files. Risk: File Acces related security issues. Requires: Might require Permissions to read/write into files. Writes MshConsoleInfo object in Monad Console format into the file specified by the . The absolute path of the file into which the content is saved. The version of PowerShell. The external snapins that are loaded in the console The path value is null. Reads a Monad Console file specified by and constructs a PSConsoleFileElement. The absolute path of the file to read from. A MShConsoleFileElement object that represents content of the console file. The return object wont be null. There is a load or parser error in the XML. MonadVersion from the console file List of MshSnapin IDs from the console file Class that manages(reads/writes) Monad Console files and constructs objects that represent data in the console files. Functionality: 1. Access point to the console files for Runspace and cmdlets 2. Depends on PSConsoleFileElement for reading/writing files Construct a MshConsoleInfo object for the Monad version specified. Monad Version. Constructs a object for the current Monad version which is already started. One or more default mshsnapins cannot be loaded because the registry is not populated correctly. Constructs a object from a Monad console file. Monad console file name. If the filename is not absolute path. Then absolute path is constructed by using Path.GetFullPath() API. PSConsoleLoadException occurred while loading this console file. This object also contains specific PSSnapInExceptions that occurred while loading. One or more default mshsnapins cannot be loaded because the registry is not populated correctly. fileName is null. 1. fileName does not specify proper file extension. fileName contains one or more of the invalid characters defined in System.IO.Path.InvalidPathChars. Unable to load/parse the file specified by fileName. Saves the current object to a file specified by . IsDirty is set to false once file is saved. If path is not an absolute path, then an absolute path is constructed by using Path.GetFullPath() API. 1.Path does not specify proper file extension. 1. Path is null. path contains one or more of the invalid characters defined in System.IO.Path.InvalidPathChars. Saves the current object to its console file. IsDirty is set to false once file is saved. Msh is loaded with default mshsnapins. $console is currently empty. Adds a mshsnapin specified by to the current list of mshsnapins. If the mshsnapin is successfully added, IsDirty property is set to true. ID of the mshsnapin which needs to be added. A object corresponding to mshSnapInID. PSSnapIn information must be present in the registry for this call to succeed. mshSnapInID is empty or null. PSSnapIn is already loaded. No PSSnapIn with given id found. PSSnapIn cannot be loaded. Caller doesn't have permission to read keys. Removes a mshsnapin specified by from the current list. ID of the mshsnapin which needs to be removed PSSnapInInfo object for the mshsnapin that is removed. MshSnapin is removed only from the console file. Registry entry is not touched. mshSnapInID is null. 1. mshSnapInID is either a default mshsnapin or not loaded. 2. mshSnapInId is not valid. Searches for mshsnapin in either current console or registry as determined by . Id/WildcardPattern of the mshsnapin to search for. This can contain wildcard characters as represented by WildCardPattern. A boolean which determines whether to search in the current console or registry. A collection of mshsnapininfo objects. 1.Unable to read registry entries for mshsnapins. 2.Pattern specified is not valid. If pattern doesnt contain wildcard characters, this function checks for the validity of the mshsnapin name. Caller doesn't have permission to read keys. Loads a Monad Console file specified by The absolute path from which the content is loaded. PSConsoleLoadException occurred while loading this console file. This object also contains specific PSSnapInExceptions that occurred while loading. A list of objects specified in the console file. Path is null. 1. Path does not specify proper file extension. 2. PSSnapInId doesnt contain valid characters. 3. Path is not an Absolute Path. Example of valid paths:"\\MyDir\\MyFile.txt" and "C:\\MyDir". path contains one or more of the invalid characters defined in System.IO.Path.InvalidPathChars. Unable to load/parse the file specified by path. Checks whether the mshsnapin is a default mshsnapin Id of the mshsnapin List of default mshsnapins True if PSSnapIn is default.False otherwise. Checks whether the mshsnapin is already loaded Id of the mshsnapin True if PSSnapIn is loaded.False otherwise. Constructs a new list of mshsnapins from defualt mshsnapins and external mshsnapins. A list of mshsnapins represented by the current console file Monad Version that the console file depends on. Returns the major version of current console. List of mshsnapins that are available. This includes both the monad default mshsnapins as well as external mshsnapins as represented by the console file. The list returned is an ordered-list with default mshsnapins at the start followed by external mshsnapins in the order represented by the console file. List of external mshsnapins, as represented by the console file and cmdlets add-pssnapin,remove-pssnapin, that are available. A boolean which tells whether the console file is modified after it is read or created. Modification refers to addition/deletion operations of the external mshsnapins. A string representing the console file name of the current MshConsoleInfo object. If the filename is relative path, an absolute path will be constructed using Path.GetFullPath() Once a MshConsoleInfo object is constructed, a user may update the object by adding,removing mshsnapins. These operations directly effect the state of the MshConsoleInfo object but not update the console file. Root key path under HKLM Root key name Key for monad engine Key under which all the mshsnapin live Contains information about a mshsnapin Overrides ToString Name of the PSSnapIn Returns true if the PSSnapIn Id is valid. A PSSnapIn is valid iff it contains only "Alpha Numeric","-","_","." characters. PSSnapIn Id to validate Validates the PSSnapIn Id. A PSSnapIn is valid iff it contains only "Alpha Numeric","-","_","." characters. PSSnapIn Id to validate 1. Specified PSSnapIn is not valid Unique Name of the mshsnapin Is this mshsnapin default mshsnapin Retuns applicationbase for mshsnapin Strong name of mshSnapIn assembly Name of PSSnapIn module Type of custom mshsnapin. Monad version used by mshsnapin Version of mshsnapin Collection of file names containing types information for PSSnapIn. Collection of file names containing format information for PSSnapIn Description of mshsnapin Vendor of mshsnapin Get/set whether to log Pipeline Execution Detail events. Internal class to read information about a mshsnapin Reads all registered mshsnapin for all monad versions. A collection of PSSnapInInfo objects User doesn't have access to monad/mshsnapin registration information Monad key is not installed Version should be integer (1, 2, 3 etc) Reads all registered mshsnapin for specified psVersion A collection of PSSnapInInfo objects User doesn't have permission to read MonadRoot or Version MonadRoot or Version key doesn't exist. Reads all the mshsnapins for a given psVersion The User doesn't have required permission to read the registry key for this version. Specified version doesn't exist. User doesn't have permission to read specified version Read mshsnapin for specified mshsnapinId and psVersion MshSnapin info object The user does not have the permissions required to read the registry key for one of the following: 1) Monad 2) PSVersion 3) MshSnapinId 1) Monad key is not present 2) VersionKey is not present 3) MshSnapin key is not present 4) MshSnapin key is not valid Reads the mshsnapin info for a specific key under specific monad version ReadOne will never create a default PSSnapInInfo object. The user does not have the permissions required to read the registry key for specified mshsnapin. 1) Specified mshsnapin is not installed. 2) Specified mshsnapin is not correctly installed. Gets multistring value for name if value is not present and mandatory is true Get the value for name if no value is available and mandatory is true. PublicKeyToken is in the form of byte[]. Use this function to convert to a string array of byte's Reads core snapin for monad engine A PSSnapInInfo object Reads all registered mshsnapins for currently executing monad engine A collection of PSSnapInInfo objects Enable Snapin logging based on group policy Enable Snapin logging based on group policy Get the key to monad root Caller doesn't have access to monad registration information. Monad registration information is not available. Get the registry key to PSEngine. RegistryKey Major version in string format. Monad registration information is not available. Gets the version root key for specified monad version Caller doesn't have permission to read the version key specified psVersion key is not present Gets the mshsnapin root key for specified monad version Caller doesn't have permission to read the mshsnapin key mshsnapin key is not present Gets the mshsnapin key for specified monad version and mshsnapin name Caller doesn't have permission to read the mshsnapin key mshsnapin key is not present This structure is meant to hold mshsnapin information for default mshsnapins. This is private only. Defines exception thrown when a PSSnapin was not able to load into current runspace. Initiate an instance of PSSnapInException. PSSnapin for the exception Message with load failure detail. Initiate an instance of PSSnapInException. PSSnapin for the exception Message with load failure detail. Whether this is just a warning for PSSnapin load. Initiate an instance of PSSnapInException. PSSnapin for the exception Message with load failure detail. Exception for PSSnapin load failure Initiate an instance of PSSnapInException. Initiate an instance of PSSnapInException. Error message Initiate an instance of PSSnapInException. Error message Inner exception Create the internal error record. The ErrorRecord created will be stored in the _errorRecord member. Initiate a PSSnapInException instance. Serialization information Streaming context Get object data from serizliation information. Serialization information Streaming context Gets error record embedded in this exception. Gets message for this exception. Defines exception thrown when a PSSnapin was not able to load into current runspace. Intiate an instance of PSConsoleLoadException. Console info object for the exception A collection of PSSnapInExceptions. Initiate an instance of PSConsoleLoadException. Initiate an instance of PSConsoleLoadException. Error message Initiate an instance of PSConsoleLoadException. Error message Inner exception Create the internal error record. The ErrorRecord created will be stored in the _errorRecord member. Initiate a PSConsoleLoadException instance. Serialization information Streaming context Get object data from serizliation information. Serialization information Streaming context Gets error record embedded in this exception. Gets message for this exception. Base class for all the pssnapin related cmdlets. Set to true when object is disposed Dispose method unloads the app domain and the resource reader if it was created. Disposes the resource reader. Writes a non-terminating error onto the pipeline. Object which caused this exception. ErrorId for this error. Complete exception object. ErrorCategory for this exception. Searches the input list for the pattern supplied. Input list pattern with wildcards A collection of string objects (representing PSSnapIn name) that match the pattern. Please note that this method will use WildcardPattern class. So it wont support all the 'regex' patterns See if the snapin is already loaded..returns load snapin info if true, null otherwise. Routine to get the list of loaded snapins... Runspace configuration for the current engine PSSnapIn cmdlets need object to work with. Use to indicate if all registered snapins should be listed by GetSnapins... A single instance of the resource indirect reader. This is used to load the managed resource assemblies in a different app-domain so that they can be unloaded. For perf reasons we only want to create one instance for the duration of the command and be sure it gets disposed when the command completes. Class that implements add-pssnapin cmdlet. Adds pssnapins to console file and loads the pssnapin dlls into the current monad runtime. The new pssnapin information is not stored in the console file until the file is saved. Adds one or more snapins List of snapin IDs This is a helper method and should not throw any exceptions. All exceptions are caught and displayed to the user using write* methods Property that gets/sets PSSnapIn Ids for the cmdlet. An array of strings representing PSSnapIn ids. Gets or sets the Passthru flag for the operation. If true, the PSSnapInInfo object is passed down the output pipeline. Class that implements remove-pssnapin cmdlet. Removes pssnapins from the current console file. The pssnapin is not unloaded from the current engine. So all the cmdlets that are represented by this pssnapin will continue to work. Property that gets/sets PSSnapIn Ids for the cmdlet. An array of strings representing PSSnapIn ids. Gets or sets the Passthru flag for the operation. If true, the PSSnapInInfo object is also passed down the output pipeline. Class that implements get-pssnapin cmdlet. Constructs PSSnapInfo objects as requested by the user and writes them to the output buffer. Name(s) of PSSnapIn(s). Property that determines whether to get all pssnapins that are currently registered ( in registry ). A boolean that determines whether to get all pssnapins that are currently registered ( in registry ). Base class for all the Console related cmdlets. Throws a terminating error. Object which caused this exception. ErrorId for this error. Complete exception object. ErrorCategory for this exception. Runspace configuration for the current engine Console cmdlets need object to work with. InitialSessionState for the current engine Class that implements export-console cmdlet. Saves the current console info into a file. Removes file specified by destination Absolute path of the file to be removed. Resolves the specified path and verifies the path belongs to FileSystemProvider. Path to resolve A fully qualified string representing filename. Resolves the specified path to PathInfo objects The path to be resolved. Each path may contain glob characters. If true, resolves the path even if it doesn't exist. The context under which the command is running. A string representing the resolved path. Gets the filename for the current operation. If Name parameter is empty checks $console. If $console is not present, prompts user? A string representing filename. If filename cannot be deduced returns null. 1. $console points to an PSObject that cannot be converted to string. Prompt user for filename. User input in string format. If user chooses not to export, an empty string is returned. No exception is thrown Property that gets/sets console file name. If a parameter is not supplied then the file represented by $console will be used for saving. Property that sets force parameter. This will reset the read-only attribute on an existing file before deleting it. Property that prevents file overwrite. PSInstaller is a class for facilitating installation of monad engine and monad PSSnapin's. This class implements installer api from CLR. At install time, installation utilities (like InstallUtil.exe) will call api implementation functions in this class automatically. This includes functions like Install, Uninstall, Rollback and Commit. This class is an abstract class for handling installation needs that are common for all monad components, which include, 1. accessing system registry 2. support of additional command line parameters. 3. writing registry files 4. automatically extract informaton like vender, version, etc. Different monad component will derive from this class. Two common components that need install include, 1. PSSnapin. Installation of PSSnapin will require information about PSSnapin assembly, version, vendor, etc to be written to registry. 2. Engine. Installation of monad engine will require information about engine assembly, version, CLR information to be written to registry. This is an abstract class to be derived by monad engine and PSSnapin installers only. Developer should not directly derive from this class. Uninstall this msh component Rollback this msh component MshSnapinBase (or MshSnapinInstaller) is a class for facilitating registry of necessary information for monad mshsnapin's. This class will be built with monad core engine dll (System.Management.Automation.dll). This is the base class for two kinds of mshsnapins: MshSnapin and CustomMshSnapin. Each mshsnapin assembly should derive from this class (indirectly) and fill in information about mshsnapin name, vendor, and version. At install time, installation utilities (like InstallUtil.exe) will call install this engine assembly based on the implementation in this class. This class derives from base class PSInstaller. PSInstaller will handle the details about how information got written into registry. Here, the information about registry content is provided. The reason of not calling this class MshSnapinInstaller is to "hide" the details that MshSnapin class is actually doing installion. It is also more intuitive since people deriving from this class will think there are really implementing a class for mshsnapin. This is an abstract class to be derived by monad mshsnapin and custom mshsnapin. MshSnapin developer should not directly derive from this class. MshCoreMshSnapin (or MshCoreMshSnapinInstaller) is a class for facilitating registry of necessary information for monad core mshsnapin. This class will be built with monad core engine dll (System.Management.Automation.dll). MshSnapin is a class for regular mshsnapin's which is constructed based on mshsnapin assembly. This class derives from PSSnapInInstaller and will be used as the base for all regular mshsnapins. Developers should derive from this class when implementing their own mshsnapins. Derived mshsnapins should be denotated with [RunInstaller] attribute so that installutil.exe can directly install the mshsnapin into registry. Gets list of format files to be loaded for this mshsnapin. This member can be derived to provide the list of formats to be loaded for this mshsnapin. Gets list of type files to be loaded for this mshsnapin. This member can be derived to provide the list of types to be loaded for this mshsnapin. Create an instance of this class. Get name of this mshsnapin. Get the default vendor string for this mshsnapin. Get resource information for vendor. This is a string of format: resourceBaseName,resourceName. Get the default description string for this mshsnapin. Get resource information for description. This is a string of format: resourceBaseName,resourceName. Get type files to be used for this mshsnapin. Get format files to be used for this mshsnapin. Raw mshsnapin is a class for allowing mshsnapin developers to directly specify the set of cmdlets, providers, types, formats, assemblies available in the mshsnapin. To use this class, mshsnapin developers will drive from it and fill in details about cmdlet, provider, type, format, assemblies. This class will also facilitate the registration of the mshsnapin through installutil.exe. This class will be built with monad core engine dll. Developers should derive from this class to implement their own custom mshsnapins. Derived mshsnapins should be denotated with [RunInstaller] attribute so that installutil.exe can directly install the mshsnapin into registry. Gets the cmdlets defined in custom mshsnapin. This member can be derived to provide the list of cmdlets to be included for this mshsnapin. Gets the providers defined in custom mshsnapin. This member can be derived to provide the list of providers to be included for this mshsnapin. Gets the types defined in custom mshsnapin. This member can be derived to provide the list of types to be included for this mshsnapin. Gets the formatsdefined in raw mshsnapin. This member can be derived to provide the list of formats to be included for this mshsnapin. A Managed Wrapper that performs native WinSQM API calls. This class provides functionality to write SQM usage data into Windows Global Session. See header file %PUBLIC_ROOT%\internal\windows\inc\winsqm.h. This wrapper should be used only by Windows Components. PowerShell is part of Windows starting from Windows Server 2008. This wrapper makes PInvoke calls into ntdll.dll and should not be redistributed. This code should always be shipped as part of Windows OS. This function checks if SQM data collection is opted in for Windows. TRUE - SQM data collection is opted in. FALSE - SQM data collection is opted out Raises a Windows SQM event to increment the wit the supplied value. This API makes native calls and is considerabley expensive. DataPoint ID to increment value to increment Callers should make sure that incAmount > 0 to avoid native call overhead. Raises a Windows SQM event to increment values supplied in the of the form {dataPointID, dataPointValue} This API makes native calls and is considerabley expensive. A collection of dataPointID,dataPointValue pairs. The function WinSqmSe generates a SQM_SET_DWORD event and sets a DWORD value, dataPointValue to datapoint with ID, dataPointId in the Windows Global SQM Session. Adds to the stream identified by to the Windows Global Session. ID of the stream for which the data needs to be added. string data Adds and to the stream identified by to the Windows Global Session. ID of the stream for which the data needs to be added. String entry numerical entry Fires a series of Windows Sqm events for the data supplied with Fires a specified Windows SQM event with the data supplied. This function checks if SQM data collection is opted in for Windows. TRUE - SQM data collection is opted in. FALSE - SQM data collection is opted out This function is a Wrapper over EventEnabled encapsulating the WinSqm Event provider. See description of EventEnabled for more information on the arguments. This function is a Wrapper over EventWrite encapsulating the WinSqm Event provider. See description of EventWrite for more information on the arguments. WinSqmAddToStream adds a stream row to the Stream identified by dataPointID in session identified by sessionGuid. The Stream Row is an array of Sqm Stream Entries. WinSQM api is based on ETW provider support introduced in Vista and later. This structure is a managed representation for _EVENT_DESCRIPTOR. See header file %PUBLIC_ROOT%\ddk\inc\evntprov.h WinSQM api is based on ETW provider support introduced in Vista and later. This structure is a managed representation for _EVENT_DATA_DESCRIPTOR. See header file %PUBLIC_ROOT%\ddk\inc\evntprov.h Constructs an EventDataDescriptor object. A pinned pointer to a data object size of data A WinSQM stream entry. See header file %PUBLIC_ROOT%\internal\windows\inc\winsqm.h. Creates a string sqm stream entry A enum representing PowerShell datapoints for SQM None Tracks the usage of every Powershell cmdlet Aliases create a name that refers to other command types An PowerShell script (*.ps1 file) Script filters that are defined by a script block. Script functions that are defined by a script block Any existing application (can be console or GUI). A script that is built into the runspace configuration Tracks the usage of ExecutionPolicy.. This datapoint overrides earlier occurrences. Tracks the new-object with COM parameter usage Runspace Duration This is supposed to track local runspace duration A cmdlet. This is supposed to track the idletimeout value supplied as part of Register/Set-PSSessionConfiguration cmdlets. This is supposed to track the outputbufferingmode value supplied as part of Register/Set-PSSessionConfiguration cmdlets. Number of activities a workflow has. Tracks workflow complexity. Tells us whether workflows are run on domain joined machines. Tracks workflow execution duration Tracks duration of the workflow process Tracks the number of specific parameters added by a workflow Tracks usage of common parameters where values are not desired. Tracks usage of the OOTB activities. Tracks times workflow is invoked. Tracks known types of parameters defined for workflow. Tracks the usage of specific paremeters, such as number of PSComputerNames specified Tracks workflow type, script/xaml Tracks count of workflows run concurrently in process. Tracks terminal workflow state frequency. Tracks workflow quota information. Track size of streams, for persistence information. This class implements the SQM functionality that is specific to Powershell. Powershell writes SQM usage data into Windows Global session. WinSQM architecture collects events and then accumulates data from events once in ~19hrs. WinSQM has a fixed amount of buffer to collect events. If the buffer limit is reached the session will be disabled. So the components should be careful in not raising events frequently. The objectives for the Powershell SQM are: 1. Shouldn't raise WinSQM events frequently. 2. Shouldn't let DoS attacks disable Windows Global Session. Notes the time at which runspace is started. A GUID that uniquely identifies a runspace Notes the time at which runspace is closed / ended. If the runspace start time is not notified, then this will have no effect. A GUID that uniquely identifies a runspace Notes the time at which a workflow has started. A GUID that uniquely identifies a workflow. Notes the time at which a workflow has ended. A GUID that uniquely identifies a workflow. Tracks the idletimeout specified by the user using Register/Set-PSSessionConfiguration cmdlets. Tracks the output buffering mode specified by the user using Register/Set-PSSessionConfiguration cmdlets. Tracks the size of a workflow output stream. size of the output stream. Indicates which stream is being specified. Tracks the workflow endpoint quotas. Updates the maximum number of concurrently running workflows, if number is higher than seen previously. Tracks the usage of workflow common parameters. Name of parameter. Tracks the usage of workflow out of the box activities. Name of activity. Tracks the usage of workflows by workflow name. Name of workflow. Tracks usage of workflow types by authors. For now, "script" and "xaml". Tracks ExecutionPolicy changes of PowerShell. Because of Personal Identification Issues, PS SQM collects only data that belongs to Powershell. So if shellID != PowerShell's ID, the execution policy is not tracked. ShellID on which execution policy is applied ExecutionPolicy of PowerShell Increments the DataPoint (by 1) for the command type identified by . 2. WinSQM is not notified with every call to this method. WinSQM is notified only when a certain threshold is reached for the corresponding type. CommandType for which the increment is needed. Increments the DataPoint (by 1) for the cmdlet identified by . Callers must macke sure cmdlet is not null. Supports only PowerShell commands. User commands are not tracked. Initializes a new data structure to track completion/failure/stop rates for workflow jobs under one parent. The parent job whose state data should be tracked. Increments appropriate items in the data structure that tracks job completion/failure/stop rates for workflow. The InstanceId of the parent job for the job being tracked. The new state of the job. Increments the DataPoint for the number of parameters specified by the workflow, when imported and tracks the type. Type of parameters specified. Increments the value of DataPoint by 1. DataPoint for which the increment is needed. Logs all SQM related data collected so far into the Windows Sqm logger. This will log data only if the time elapsed is greater than 1 minute since the process start. Increments the value for cmdlet by 1. Cmdlet name for which the increment is needed. Writes data for all the datapoints whose value > 0. This method is not thread-safe. Caller should ensure thread-safety. This attribute is used for Design For Testability. It should be placed on any method containing code which is likely to be sensitive to X86/X64/IA64 issues, primarily code which calls DllImports or otherwise uses NativeMethods. This allows us to generate code coverage data specific to architecture sensitive code. Constructor for the ArchitectureSensitiveAttribute class. An object that can be used to execute a method on a threadpool thread while correctly managing system state, such as flowing ETW activities from the current thread to the threadpool thread. Works the same as , except that it also manages system state correctly. Works the same as , except that it also manages system state correctly. Works the same as BeginInvoke would for any other delegate, except that it also manages system state correctly. Works the same as EndInvoke would for any other delegate, except that it also manages system state correctly. A simple implementation of . Creates a that uses an for activity creation and correlation. The to use when logging transfer events during activity correlation. The to use when logging transfer events during activity correlation. Implements . Implements . Implements . Implements . This exception is thrown when a command cannot be found. Constructs a CommandNotFoundException. This is the recommended constructor. The name of the command that could not be found. The inner exception. This string is message template string This string is the ErrorId passed to the ErrorRecord, and is also the resourceId used to look up the message template string in DiscoveryExceptions.txt. Additional arguments to format into the message. Constructs a CommandNotFoundException. Constructs a CommandNotFoundException The message used in the exception. Constructs a CommandNotFoundException The message used in the exception. An exception that led to this exception. Serialization constructor for class CommandNotFoundException serialization information streaming context Serializes the CommandNotFoundException. serialization information streaming context Gets the ErrorRecord information for this exception. Gets the name of the command that could not be found. Defines the exception that is thrown if a native command fails. Initializes a new instance of the ApplicationFailedException class and defines the serialization information, and streaming context. The serialization information to use when initializing this object The streaming context to use when initializing this object constructed object Initializes a new instance of the class ApplicationFailedException. constructed object Initializes a new instance of the ApplicationFailedException class and defines the error message. The error message to use when initializing this object constructed object Initializes a new instance of the ApplicationFailedException class and defines the error message and errorID. The error message to use when initializing this object The errorId to use when initializing this object constructed object Initializes a new instance of the ApplicationFailedException class and defines the error message, error ID and inner exception. The error message to use when initializing this object The errorId to use when initializing this object The inner exception to use when initializing this object constructed object Initializes a new instance of the ApplicationFailedException class and defines the error message and inner exception. The error message to use when initializing this object The inner exception to use when initializing this object constructed object Providers that want to specify OutputType can use these strings for the ProviderCmdlet parameter. Add-Content cmdlet Clear-Content cmdlet Clear-Item cmdlet Clear-ItemProperty cmdlet Convert-Path cmdlet Copy-Item cmdlet Copy-ItemProperty cmdlet Get-Acl cmdlet Get-ChildItem cmdlet Get-Content cmdlet Get-Item cmdlet Get-ItemProperty cmdlet Get-Location cmdlet Get-PSDrive cmdlet Get-PSProvider cmdlet Invoke-Item cmdlet Join-Path cmdlet Move-Item cmdlet Move-ItemProperty cmdlet New-Item cmdlet New-ItemProperty cmdlet New-PSDrive cmdlet Pop-Location cmdlet Push-Location cmdlet Remove-Item cmdlet Remove-ItemProperty cmdlet Remove-PSDrive cmdlet Rename-Item cmdlet Rename-ItemProperty cmdlet Resolve-Path cmdlet Set-Acl cmdlet Set-Content cmdlet Set-Item cmdlet Set-ItemProperty cmdlet Set-Location cmdlet Split-Path cmdlet Test-Path cmdlet Indicates that a cmdlet hit a terminating error. InnerException is the error which the cmdlet hit. Instantiates a new instance of the CmdletInvocationException class Instantiates a new instance of the CmdletInvocationException class wrapped exception identity of cmdlet, null is unknown Instantiates a new instance of the CmdletInvocationException class Instantiates a new instance of the CmdletInvocationException class constructed object Instantiates a new instance of the CmdletInvocationException class constructed object Initializes a new instance of the CmdletInvocationException class using data serialized via serialization information streaming context constructed object Serializer for serialization information streaming context The error reported by the cmdlet never null Indicates that a cmdlet hit a terminating error of type . This is generally reported from the standard provider navigation cmdlets such as get-childitem. Instantiates a new instance of the CmdletProviderInvocationException class wrapped exception identity of cmdlet, null is unknown constructed object Instantiates a new instance of the CmdletProviderInvocationException class constructed object Initializes a new instance of the CmdletProviderInvocationException class using data serialized via serialization information streaming context constructed object Instantiates a new instance of the CmdletProviderInvocationException class constructed object Instantiates a new instance of the CmdletProviderInvocationException class constructed object InnerException as ProviderInvocationException ProviderInvocationException This is the ProviderInfo associated with the provider which generated the error. may be null Indicates that the pipeline has already been stopped. When reported as the result of a command, PipelineStoppedException indicates that the command was stopped asynchronously, either by the user hitting CTRL-C, or by a call to . When a cmdlet or provider sees this exception thrown from a Monad API such as WriteObject(object) this means that the command was already stopped. The cmdlet or provider should clean up and return. Catching this exception is optional; if the cmdlet or providers chooses not to handle PipelineStoppedException and instead allow it to propagate to the Monad Engine's call to ProcessRecord, the Monad Engine will handle it properly. Instantiates a new instance of the PipelineStoppedException class constructed object Initializes a new instance of the PipelineStoppedException class using data serialized via serialization information streaming context constructed object Instantiates a new instance of the PipelineStoppedException class constructed object Instantiates a new instance of the PipelineStoppedException class constructed object PipelineClosedException occurs when someone tries to write to an asynchronous pipeline source and the pipeline has already been stopped. Instantiates a new instance of the PipelineClosedException class constructed object Instantiates a new instance of the PipelineClosedException class constructed object Instantiates a new instance of the PipelineClosedException class constructed object Initializes a new instance of the PipelineClosedException class using data serialized via serialization information streaming context constructed object ActionPreferenceStopException indicates that the command stopped due to the ActionPreference.Stop or Inquire policy. For example, if $WarningPreference is "Stop", the command will fail with this error if a cmdlet calls WriteWarning. Instantiates a new instance of the ActionPreferenceStopException class constructed object Instantiates a new instance of the ActionPreferenceStopException class Non-terminating error which triggered the Stop constructed object Instantiates a new instance of the ActionPreferenceStopException class constructed object Instantiates a new instance of the ActionPreferenceStopException class Initializes a new instance of the ActionPreferenceStopException class using data serialized via serialization information streaming context constructed object Serializer for serialization information streaming context Instantiates a new instance of the ActionPreferenceStopException class constructed object Instantiates a new instance of the ActionPreferenceStopException class constructed object see ErrorRecord If this error results from a non-terminating error being promoted to terminating due to -ErrorAction or $ErrorActionPreference, this is the non-terminating error. ParentContainsErrorRecordException is the exception contained by the ErrorRecord which is associated with a Monad engine custom exception through the IContainsErrorRecord interface. We use this exception class so that there is not a recursive "containment" relationship between the Monad engine exception and its ErrorRecord. Instantiates a new instance of the ParentContainsErrorRecordException class. Note that this sets the Message and not the InnerException. constructed object I leave this non-standard constructor form public. Instantiates a new instance of the ParentContainsErrorRecordException class constructed object Instantiates a new instance of the ParentContainsErrorRecordException class constructed object Instantiates a new instance of the ParentContainsErrorRecordException class constructed object Initializes a new instance of the ParentContainsErrorRecordException class using data serialized via serialization information streaming context doesn't return always Serializer for serialization information context Gets the message for the exception Indicates that a success object was written and success-to-error ("1>&2") has been specified. The redirected object is available as in the ErrorRecord which contains this exception. Instantiates a new instance of the RedirectedException class constructed object Instantiates a new instance of the RedirectedException class constructed object Instantiates a new instance of the RedirectedException class constructed object Initializes a new instance of the RedirectedException class using data serialized via serialization information streaming context constructed object ScriptCallDepthException occurs when the number of session state objects of this type in this scope exceeds the configured maximum. When one Monad command or script calls another, this creates an additional scope. Some script expressions also create a scope. Monad imposes a maximum call depth to prevent stack overflows. The maximum call depth is configurable but generally high enough that scripts which are not deeply recursive should not have a problem. Instantiates a new instance of the ScriptCallDepthException class constructed object Instantiates a new instance of the ScriptCallDepthException class constructed object Instantiates a new instance of the ScriptCallDepthException class constructed object Initializes a new instance of the ScriptCallDepthException class using data serialized via serialization information streaming context constructed object Serializer for serialization information context see TargetObject is the offending call depth Always 0 - depth is not tracked as there is no hard coded maximum. PipelineDepthException occurs when the number of commands participating in a pipeline (object streaming) exceeds the configured maximum. Instantiates a new instance of the PipelineDepthException class constructed object Instantiates a new instance of the PipelineDepthException class constructed object Instantiates a new instance of the PipelineDepthException class constructed object Initializes a new instance of the PipelineDepthException class using data serialized via serialization information streaming context constructed object Serializer for serialization information context see TargetObject is the offending call depth Always 0 - depth is not tracked as there is no hard coded maximum. A cmdlet/provider should throw HaltCommandException when it wants to terminate the running command without this being considered an error. For example, "more" will throw HaltCommandException if the user hits "q". Only throw HaltCommandException from your implementation of ProcessRecord etc. Note that HaltCommandException does not define IContainsErrorRecord. This is because it is not reported to the user. Instantiates a new instance of the HaltCommandException class constructed object Instantiates a new instance of the HaltCommandException class constructed object Instantiates a new instance of the HaltCommandException class constructed object Initializes a new instance of the HaltCommandException class using data serialized via serialization information streaming context constructed object Helper to access Microsoft.PowerShell.GraphicalHost.dll (which references on WPF) using reflection, since we do not want System.Management.Automation.dll or Microsoft.PowerShell.Commands.Utility.dll to reference WPF. Microsoft.PowerShell.GraphicalHost.dll contains: 1) out-gridview window implementation (the actual cmdlet is in Microsoft.PowerShell.Commands.Utility.dll) 2) show-command window implementation (the actual cmdlet is in Microsoft.PowerShell.Commands.Utility.dll) 3) the help window used in the System.Management.Automation.dll's get-help cmdslet when -ShowWindow is specified Initialized in GetGraphicalHostReflectionWrapper with the Microsoft.PowerShell.GraphicalHost.dll assembly. A type in Microsoft.PowerShell.GraphicalHost.dll we want to invoke members on An object in Microsoft.PowerShell.GraphicalHost.dll of type graphicalHostHelperType Prevents a default instance of the GraphicalHostReflectionWrapper class from being created Retrieves a wrapper used to invoke members of the type with name in Microsoft.PowerShell.GraphicalHost.dll the cmdlet requesting the wrapper (used to throw terminating errors) the type name we want to invoke members from wrapper used to invoke members of the type with name in Microsoft.PowerShell.GraphicalHost.dll When it was not possible to load Microsoft.PowerShell.GraphicalHost.dlly Retrieves a wrapper used to invoke members of the type with name in Microsoft.PowerShell.GraphicalHost.dll the cmdlet requesting the wrapper (used to throw terminating errors) the type name we want to invoke members from used for error messages wrapper used to invoke members of the type with name in Microsoft.PowerShell.GraphicalHost.dll When it was not possible to load Microsoft.PowerShell.GraphicalHost.dlly Used to escape characters that are not friendly to WPF binding property name to be used in binding string with escaped characters Calls an instance method with name passing the name of the method to call arguments to call the method with The method return value Calls a static method with name passing the name of the method to call arguments to call the method with The method return value Gets the value of an instance property with name name of the instance property to get the value from the value of an instance property with name Gets the value of a static property with name name of the static property to get the value from the value of a static property with name Returns true if the is being run remotely cmdlet we want to see if is running remotely true if the is being run remotely Defines the exception thrown when the Host cannot complete an operation such as checking whether there is any input available. Initializes a new instance of the HostException class Initializes a new instance of the HostException class and defines the error message The error message that explains the reason for the exception. Initializes a new instance of the HostException class and defines the error message and inner exception. The error message that explains the reason for the exception. The exception that is the cause of the current exception. If the parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception. Initializes a new instance of the HostException class and defines the error message, inner exception, the error ID, and the error category. The error message that explains the reason for the exception. The exception that is the cause of the current exception. If the parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception. The string that should uniquely identifies the situation where the exception is thrown. The string should not contain white space. The ErrorCategory into which this exception situation falls Intentionally public, third-party hosts can call this Initializes a new instance of the HostException class and defines the SerializationInfo and the StreamingContext. The object that holds the serialized object data. The contextual information about the source or destination. Defines the exception thrown when an error occurs from prompting for a command parameter. Initializes a new instance of the PromptingException class Initializes a new instance of the PromptingException class and defines the error message The error message that explains the reason for the exception. Initializes a new instance of the PromptingException class and defines the error message and inner exception. The error message that explains the reason for the exception. The exception that is the cause of the current exception. If the parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception. Initializes a new instance of the PromptingException class and defines the error message, inner exception, the error ID, and the error category. The error message that explains the reason for the exception. The exception that is the cause of the current exception. If the parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception. The string that should uniquely identifies the situation where the exception is thrown. The string should not contain white space. The ErrorCategory into which this exception situation falls Intentionally public, third-party hosts can call this Initializes a new instance of the HostException class and defines the SerializationInfo and the StreamingContext. The object that holds the serialized object data. The contextual information about the source or destination. PipelineReader provides asynchronous access to the stream of objects emitted by a . Close the stream Causes subsequent calls to IsOpen to return false and calls to a write operation to throw an PipelineClosedException. All calls to Close() after the first call are silently ignored. The stream is already disposed Read at most objects The maximum number of objects to read The objects read This method blocks if the number of objects in the stream is less than and the stream is not closed. Read a single object from the stream the next object in the stream This method blocks if the stream is empty Blocks until the pipeline closes and reads all objects. A collection of zero or more objects. If the stream is empty, an empty collection is returned. Reads all objects currently in the stream, but does not block. A collection of zero or more objects. This method performs a read of all objects currently in the stream. If there are no objects in the stream, an empty collection is returned. Reads objects currently in the stream, but does not block. A collection of zero or more objects. This method performs a read of objects currently in the stream. If there are no objects in the stream, an empty collection is returned. Return no more than maxRequested objects. Peek the next object, but do not remove it from the stream. Non-blocking. The next object in the stream or AutomationNull.Value if the stream is empty The stream is closed Returns an enumerator that reads the items in the pipeline Event fired when data is added to the buffer Signaled when data is available Check if the stream is closed and contains no data. True if the stream is closed and contains no data, otherwise false Attempting to read from the underlying stream if EndOfPipeline is true returns zero objects. Check if the stream is open for further writes. true if the underlying stream is open, otherwise false The underlying stream may be readable after it is closed if data remains in the internal buffer. Check to determine if the underlying stream is closed and contains no data. Returns the number of objects currently available in the underlying stream Get the capacity of the stream The capacity of the stream. The capacity is the number of objects that stream may contain at one time. Once this limit is reached, attempts to write into the stream block until buffer space becomes available. PipelineWriter allows the caller to provide an asynchronous stream of objects as input to a . Close the stream Causes subsequent calls to IsOpen to return false and calls to a write operation to throw an ObjectDisposedException. All calls to Close() after the first call are silently ignored. The stream is already disposed Flush the buffered data from the stream. Closed streams may be flushed, but disposed streams may not. The stream is already disposed Write a single object into the underlying stream The object to add to the stream One, if the write was successful, otherwise; zero if the stream was closed before the object could be written, or if the object was AutomationNull.Value. The underlying stream is already closed AutomationNull.Value is ignored Write multiple objects to the underlying stream object or enumeration to read from If enumerateCollection is true, and is an enumeration according to LanguagePrimitives.GetEnumerable, the objects in the enumeration will be unrolled and written seperately. Otherwise, will be written as a single object. The number of objects written The underlying stream is already closed If the enumeration contains elements equal to AutomationNull.Value, they are are ignored. This can cause the return value to be less than the size of the collection. Signaled when buffer space is available in the underlying stream. Check if the stream is open for further writes. true if the underlying stream is open, otherwise false Attempting to write to the underlying stream if IsOpen is false throws a . Returns the number of objects currently in the underlying stream Get the capacity of the stream The capacity of the stream. The capacity is the number of objects that stream may contain at one time. Once this limit is reached, attempts to write into the stream block until buffer space becomes available. Defines the exception thrown for all Metadata errors Initializes a new instance of MetadataException with serialization parameters serialization information streaming context Initializes a new instance of MetadataException with the message set to typeof(MetadataException).FullName Initializes a new instance of MetadataException setting the message the exception's message Initializes a new instance of MetadataException setting the message and innerException the exception's message the exceptions's inner exception Defines the exception thrown for all Validate attributes Initializes a new instance of ValidationMetadataException with serialization parameters serialization information streaming context Initializes a new instance of ValidationMetadataException with the message set to typeof(ValidationMetadataException).FullName Initializes a new instance of ValidationMetadataException setting the message the exception's message Initializes a new instance of ValidationMetadataException setting the message and innerException the exception's message the exceptions's inner exception Initialize a new instance of ValidationMetadataException. This validation exception could be ignored in positional binding phase if the swallowException is set to be true. The error message Indicate whether to swallow this exception in positional binding phase Make the positional binding swallow this exception when it's set to true This property is only used internally in the positional binding phase Defines the exception thrown for all ArgumentTransformation attributes Initializes a new instance of ArgumentTransformationMetadataException with serialization parameters serialization information streaming context Initializes a new instance of ArgumentTransformationMetadataException with the message set to typeof(ArgumentTransformationMetadataException).FullName Initializes a new instance of ArgumentTransformationMetadataException setting the message the exception's message Initializes a new instance of ArgumentTransformationMetadataException setting the message and innerException the exception's message the exceptions's inner exception Defines the exception thrown for all parameter binding exceptions related to metadata attributes Initializes a new instance of ParsingMetadataException with serialization parameters serialization information streaming context Initializes a new instance of ParsingMetadataException with the message set to typeof(ParsingMetadataException).FullName Initializes a new instance of ParsingMetadataException setting the message the exception's message Initializes a new instance of ParsingMetadataException setting the message and innerException the exception's message the exceptions's inner exception This is a wrapper for exception class which provides additional information via . Instances of this exception class are usually generated by the Monad Engine. It is unusual for code outside the Monad Engine to create an instance of this class. Initializes a new instance of the PSArgumentException class. constructed object Initializes a new instance of the PSArgumentException class. constructed object Per MSDN, the parameter is message. I confirm this experimentally as well. Initializes a new instance of the PSArgumentException class. constructed object Note the unusual order of the construction parameters. ArgumentException has this ctor form and we imitate it here. Initializes a new instance of the PSArgumentException class using data serialized via serialization information streaming context constructed object Serializer for serialization information streaming context Initializes a new instance of the PSArgumentException class. constructed object Additional information about the error Note that ErrorRecord.Exception is . see Exception.Message is get-only, but you can effectively set it in a subclass by overriding this virtual property. This is a wrapper for exception class which provides additional information via . Instances of this exception class are usually generated by the Monad Engine. It is unusual for code outside the Monad Engine to create an instance of this class. Initializes a new instance of the PSArgumentNullException class. constructed object Initializes a new instance of the PSArgumentNullException class. constructed object Per MSDN, the parameter is paramName and not message. I confirm this experimentally as well. Initializes a new instance of the PSArgumentNullException class. constructed object Initializes a new instance of the PSArgumentNullException class. constructed object ArgumentNullException has this ctor form and we imitate it here. Initializes a new instance of the PSArgumentNullException class using data serialized via serialization information streaming context constructed object Serializer for serialization information streaming context Additional information about the error Note that ErrorRecord.Exception is . see Exception.Message is get-only, but you can effectively set it in a subclass by overriding this virtual property. This is a wrapper for exception class which provides additional information via . Instances of this exception class are usually generated by the Monad Engine. It is unusual for code outside the Monad Engine to create an instance of this class. Constructor for class PSArgumentOutOfRangeException constructed object Initializes a new instance of the PSArgumentOutOfRangeException class. constructed object Per MSDN, the parameter is paramName and not message. I confirm this experimentally as well. Initializes a new instance of the PSArgumentOutOfRangeException class. constructed object ArgumentOutOfRangeException has this ctor form and we imitate it here. Initializes a new instance of the PSArgumentOutOfRangeException class using data serialized via serialization information streaming context constructed object Serializer for serialization information streaming context Initializes a new instance of the PSArgumentOutOfRangeException class. constructed object Additional information about the error Note that ErrorRecord.Exception is . This is a wrapper for exception class which provides additional information via . Instances of this exception class are usually generated by the Monad Engine. It is unusual for code outside the Monad Engine to create an instance of this class. Initializes a new instance of the PSInvalidOperationException class. constructed object Initializes a new instance of the PSInvalidOperationException class using data serialized via serialization information streaming context constructed object Serializer for serialization information streaming context Initializes a new instance of the PSInvalidOperationException class. constructed object Initializes a new instance of the PSInvalidOperationException class. constructed object Initializes a new instance of the PSInvalidOperationException class. constructed object Additional information about the error Note that ErrorRecord.Exception is . This is a wrapper for exception class which provides additional information via . Instances of this exception class are usually generated by the Monad Engine. It is unusual for code outside the Monad Engine to create an instance of this class. Initializes a new instance of the PSNotImplementedException class. constructed object Initializes a new instance of the PSNotImplementedException class using data serialized via serialization information streaming context constructed object Serializer for serialization information streaming context Initializes a new instance of the PSNotImplementedException class. constructed object Initializes a new instance of the PSNotImplementedException class. constructed object Additional information about the error Note that ErrorRecord.Exception is . This is a wrapper for exception class which provides additional information via . Instances of this exception class are usually generated by the Monad Engine. It is unusual for code outside the Monad Engine to create an instance of this class. Initializes a new instance of the PSNotSupportedException class. constructed object Initializes a new instance of the PSNotSupportedException class using data serialized via serialization information streaming context constructed object Serializer for serialization information streaming context Initializes a new instance of the PSNotSupportedException class. constructed object Initializes a new instance of the PSNotSupportedException class. constructed object Additional information about the error Note that ErrorRecord.Exception is . This is a wrapper for exception class which provides additional information via . Instances of this exception class are usually generated by the Monad Engine. It is unusual for code outside the Monad Engine to create an instance of this class. Initializes a new instance of the PSObjectDisposedException class. constructed object Per MSDN, the parameter is objectName and not message. I confirm this experimentally as well. Also note that there is no parameterless constructor. Initializes a new instance of the PSObjectDisposedException class. constructed object Initializes a new instance of the PSObjectDisposedException class. constructed object Initializes a new instance of the PSObjectDisposedException class using data serialized via serialization information streaming context constructed object Serializer for serialization information streaming context Additional information about the error Note that ErrorRecord.Exception is . An PSTraceSource is a representation of a System.Diagnostics.TraceSource instance that is used the the Monad components to produce trace output. It is permitted to subclass but there is no established scenario for doing this, nor has it been tested. An PSTraceSource is a representation of a System.Diagnostics.TraceSource instance that is used the the Monad components to produce trace output. Lock object for the GetTracer method A helper to get an instance of the PSTraceSource class The name of the category that this class will control the tracing for. The description to describe what the category is used for. An instance of the PSTraceSource class which is initialized to trace for the specified category. If multiple callers ask for the same category, the same PSTraceSource will be returned. A helper to get an instance of the PSTraceSource class The name of the category that this class will control the tracing for. The description to describe what the category is used for. If true, the line headers will be traced, if false, only the trace message will be traced. An instance of the PSTraceSource class which is initialized to trace for the specified category. If multiple callers ask for the same category, the same PSTraceSource will be returned. Traces the Message and StackTrace properties of the exception and returns the new exception. This is not allowed to call other Throw*Exception variants, since they call this. The name of the parameter whose argument value was null Exception instance ready to throw Traces the Message and StackTrace properties of the exception and returns the new exception. This variant allows the caller to specify alternate template text, but only in assembly S.M.A.Core. The name of the parameter whose argument value was invalid This is the BaseName of the ResourceManager in S.M.A.Core which contains the template string for this error This is the ResourceId of the ResourceManager which contains the template string for this error Objects corresponding to {0}, {1}, etc. in the resource string Exception instance ready to throw Traces the Message and StackTrace properties of the exception and returns the new exception. This variant uses the default ArgumentException template text. This is not allowed to call other Throw*Exception variants, since they call this. The name of the parameter whose argument value was invalid Exception instance ready to throw Traces the Message and StackTrace properties of the exception and returns the new exception. This variant allows the caller to specify alternate template text, but only in assembly S.M.A.Core. The name of the parameter whose argument value was invalid This is the BaseName of the ResourceManager in S.M.A.Core which contains the template string for this error This is the ResourceId of the ResourceManager which contains the template string for this error Objects corresponding to {0}, {1}, etc. in the resource string Exception instance ready to throw Traces the Message and StackTrace properties of the exception and returns the new exception Exception instance ready to throw Traces the Message and StackTrace properties of the exception and returns the new exception. This variant allows the caller to specify alternate template text, but only in assembly S.M.A.Core. This is the BaseName of the ResourceManager in S.M.A.Core which contains the template string for this error This is the ResourceId of the ResourceManager which contains the template string for this error Objects corresponding to {0}, {1}, etc. in the resource string Exception instance ready to throw Traces the Message and StackTrace properties of the exception and returns the new exception. This variant allows the caller to specify alternate template text, but only in assembly S.M.A.Core. This is the InnerException for the InvalidOperationException This is the BaseName of the ResourceManager in S.M.A.Core which contains the template string for this error This is the ResourceId of the ResourceManager which contains the template string for this error Objects corresponding to {0}, {1}, etc. in the resource string Exception instance ready to throw Traces the Message and StackTrace properties of the exception and returns the new exception. This is not allowed to call other Throw*Exception variants, since they call this. Exception instance ready to throw Traces the Message and StackTrace properties of the exception and returns the new exception. This is not allowed to call other Throw*Exception variants, since they call this. This is the BaseName of the resource in the calling assembly which contains the template string for this error This is the ResourceId of the resource which contains the template string for this error Objects corresponding to {0}, {1}, etc. in the resource string Exception instance ready to throw Traces the Message and StackTrace properties of the exception and returns the new exception. This is not allowed to call other Throw*Exception variants, since they call this. Exception instance ready to throw Traces the Message and StackTrace properties of the exception and returns the new exception. This variant uses the default ArgumentOutOfRangeException template text. This is not allowed to call other Throw*Exception variants, since they call this. The name of the parameter whose argument value was out of range The value of the argument causing the exception Exception instance ready to throw Traces the Message and StackTrace properties of the exception and returns the new exception. This variant allows the caller to specify alternate template text, but only in assembly S.M.A.Core. The name of the parameter whose argument value was invalid The value of the argument causing the exception This is the BaseName of the ResourceManager in S.M.A.Core which contains the template string for this error This is the ResourceId of the ResourceManager which contains the template string for this error Objects corresponding to {0}, {1}, etc. in the resource string Exception instance ready to throw Traces the Message and StackTrace properties of the exception and returns the new exception. This variant uses the default ObjectDisposedException template text. This is not allowed to call other Throw*Exception variants, since they call this. The name of the disposed object Exception instance ready to throw Note that the parameter is the object name and not the message. Constructor that determines the name of the trace flag in the config file. The full name for the trace category. This is different from the name parameter as it is not limited to 16 characters. The name of the category that this class will control the tracing for. This parameter must always be 16 characters to ensure proper formatting of the output. The description to describe what the category is used for. If true, the line headers will be traced, if false, only the trace message will be traced. Traces the app domain header with information about the execution time, the platform, etc. Outputs a header when a new StructuredTraceSource object is created The assembly that created the instance of the StructuredTraceSource. A header will be output that contains information such as; the category and description of the new trace object, the assembly in which the new trace object will be stored. Trace in the message and then indent the output. Upon disposing of the returned object, the trace output will outdent. A format string for additional trace output The additional args for the format string An object that supports IDisposable. The caller should dispose of the object when it goes out of scope. Traces the method name and indents the trace output The format string for additional arguments to be traced The additional arguments given to the format string An object that supports IDisposable. The caller should dispose of the object when it goes out of scope. public void MethodName(int count) { using (TraceMethod( "count={0:d}", count)) { // do something here... } } This will produce output similar to the following: Entering MethodName: count=4 other trace output indented Leaving MethodName Traces the entrance and exit from event handlers An object that supports IDisposable. The caller should dispose of the object when it goes out of scope. Traces the entrance and exit from event handlers The format string for additional arguments to be traced The additional arguments given to the format string An object that supports IDisposable. The caller should dispose of the object when it goes out of scope. Traces the user specified lock name and indents the trace output An object that supports IDisposable. The caller should dispose of the object when it goes out of scope. public void MethodName() { lock (this) { using (TraceLock("my lock name")) { // do something here... } } } This will produce output similar to the following: Entering Lock: my lock name other trace output indented Leaving Lock: my lock name Call this before acquiring a lock User defined name given to the lock Call this after acquiring a lock User defined name given to the lock Use this only if the TraceLock that returns an IDisposable won't work in your situation. You will not get automatic indentation or release tracing of the lock. Call this after releasing the lock, but only if you called TraceLockAcquired when you acquired the lock. User defined name given to the lock A helper to simplify tracing of the lock flags. A format string for the output. User defined name for the lock Traces the specified formatted output when PSTraceSourceOptions.Error is enabled. The format string containing the error message The arguments for the format string Traces the specified formatted output when PSTraceSourceOptions.Warning is enabled. The format string containing the error message The arguments for the format string Traces the specified formatted output when PSTraceSourceOptions.Verbose is enabled. The format string containing the error message The arguments for the format string Traces the formatted output when PSTraceSourceOptions.WriteLine is enabled The format string The arguments for the format string Traces the formatted output when PSTraceSourceOptions.WriteLine is enabled The object to be output Formats the specified text and then traces it The flag that met the criteria to have this line traced. This is the trace class formatter. For instance, TraceError has a formatter like "ERROR: {0}" Additional format string Arguments for the additional format string Gets the method name of the method that called this one plus the skipFrames. For instance, GetCallingMethodNameAndParameters(1) will return the method that called the method that is calling GetCallingMethodNameAndParameters. The number of frames to skip in the calling stack The name of the method on the stack Composes a line of trace output and then writes it The flag that caused the line to be traced The string to write with format symbols if necessary Arguments to the format string The line is composed by prefixing the process name, thread ID, and tick count. Then the indenting is added. Then the specified string is formatted. Finally the finished string is output using the Trace class. Allocates some thread local storage to hold the indent level Local storage for the trace switch flags Property to access the indent level in thread local storage. Gets or sets the description for this trace sources Determines if the line and switch headers should be shown Gets the full name of the trace source category Creates an instance of the TraceSource on demand Gets or sets the options for what will be traced. Gets the attributes of the TraceSource Gets the listeners for the TraceSource Gets the TraceSource name (also known as category). Note, this name is truncated to 16 characters due to limitations in the TraceSource class. Gets or sets the TraceSource's Switch Storage for all the PSTraceSource instances. Storage for trace source instances which have not been instantiated but for which the user has specified Options. If the PSTraceSource cannot be found in the TraceCatalog, the same name is used to look in this dictionary to see if the PSTraceSource has been pre-configured. A PipelineReader for an ObjectStream This class is not safe for multi-threaded operations. Construct with an existing ObjectStream the stream to read Thrown if the specified stream is null Close the stream Causes subsequent calls to IsOpen to return false and calls to a write operation to throw an ObjectDisposedException. All calls to Close() after the first call are silently ignored. The stream is already disposed Handle DataReady events from the underlying stream The stream raising the event standard event args. The underlying stream Can never be null This object is used to acquire an exclusive lock on event handler registration. Note that we lock _monitorObject rather than "this" so that we are protected from outside code interfering in our critical section. Thanks to Wintellect for the hint. public method for dispose release all resources if true, release all managed resources Event fired when objects are added to the underlying stream Waitable handle for caller's to block until data is ready to read from the underlying stream Check if the stream is closed and contains no data. True if the stream is closed and contains no data, otherwise; false. Attempting to read from the underlying stream if EndOfPipeline is true returns zero objects. Check if the stream is open for further writes. true if the underlying stream is open, otherwise; false. The underlying stream may be readable after it is closed if data remains in the internal buffer. Check to determine if the underlying stream is closed and contains no data. Returns the number of objects in the underlying stream Get the capacity of the stream The capacity of the stream. The capacity is the number of objects that stream may contain at one time. Once this limit is reached, attempts to write into the stream block until buffer space becomes available. A PipelineReader reading objects from an ObjectStream This class is not safe for multi-threaded operations. Construct with an existing ObjectStream the stream to read Thrown if the specified stream is null Read at most objects The maximum number of objects to read The objects read This method blocks if the number of objects in the stream is less than and the stream is not closed. Read a single object from the stream the next object in the stream This method blocks if the stream is empty Blocks until the pipeline closes and reads all objects. A collection of zero or more objects. If the stream is empty, an empty collection is returned. Reads all objects currently in the stream, but does not block. A collection of zero or more objects. This method performs a read of all objects currently in the stream. The method will block until exclusive access to the stream is acquired. If there are no objects in the stream, an empty collection is returned. Reads objects currently in the stream, but does not block. A collection of zero or more objects. This method performs a read of objects currently in the stream. The method will block until exclusive access to the stream is acquired. If there are no objects in the stream, an empty collection is returned. Return no more than maxRequested objects. Peek the next object The next object in the stream or ObjectStream.EmptyObject if the stream is empty release all resources if true, release all managed resources A PipelineReader reading PSObjects from an ObjectStream This class is not safe for multi-threaded operations. Construct with an existing ObjectStream the stream to read Thrown if the specified stream is null Read at most objects The maximum number of objects to read The objects read This method blocks if the number of objects in the stream is less than and the stream is not closed. Read a single PSObject from the stream the next PSObject in the stream This method blocks if the stream is empty Blocks until the pipeline closes and reads all objects. A collection of zero or more objects. If the stream is empty, an empty collection is returned. Reads all objects currently in the stream, but does not block. A collection of zero or more objects. This method performs a read of all objects currently in the stream. The method will block until exclusive access to the stream is acquired. If there are no objects in the stream, an empty collection is returned. Reads objects currently in the stream, but does not block. A collection of zero or more objects. This method performs a read of objects currently in the stream. The method will block until exclusive access to the stream is acquired. If there are no objects in the stream, an empty collection is returned. Return no more than maxRequested objects. Peek the next PSObject The next PSObject in the stream or ObjectStream.EmptyObject if the stream is empty release all resources if true, release all managed resources A ObjectReader for a PSDataCollection ObjectStream PSDataCollection is introduced after 1.0. PSDataCollection is used to store data which can be used with different commands concurrently. Only Read() operation is supported currently. Construct with an existing ObjectStream the stream to read Thrown if the specified stream is null This method is not supported. The maximum number of objects to read The objects read Read a single object from the stream. The next object in the buffer or AutomationNull if buffer is closed and data is not available. This method blocks if the buffer is empty. This method is not supported. This method is not supported. This method is not supported. Return no more than maxRequested objects. This method is not supported. release all resources if true, release all managed resources A ObjectReader for a PSDataCollection ObjectStream PSDataCollection is introduced after 1.0. PSDataCollection is used to store data which can be used with different commands concurrently. Only Read() operation is supported currently. Construct with an existing ObjectStream the stream to read This method is not supported. The maximum number of objects to read The objects read Read a single object from the stream. The next object in the buffer or AutomationNull if buffer is closed and data is not available. This method blocks if the buffer is empty. This method is not supported. This method is not supported. This method is not supported. Return no more than maxRequested objects. This method is not supported. Converts to the return type based on language primitives input object to convert input object converted to the specified return type release all resources if true, release all managed resources Computer name passed in by the pipeline which created this reader Runspace Id passed in by the pipeline which created this reader Base class representing a FIFO memory based object stream. The purpose of this abstraction is to provide the semantics of a unidirectional stream of objects between two threads using a dynamic memory buffer. Raises DataReadyEvent. Source of the event Event args Read a single object from the stream The next object in the stream or AutomationNull if EndOfPipeline is reached This method blocks if the stream is empty Read at most objects The maximum number of objects to read The objects read is less than 0 This method blocks if the number of objects in the stream is less than and the stream is not closed. If there are multiple reader threads, the objects returned to blocking reads Read(int count) and ReadToEnd() are not necessarily single blocks of objects added to the stream in that order. For example, if ABCDEF are added to the stream, one reader may get ABDE and the other may get CF. Each reader reads items from the stream as they become available. Otherwise, if a maximum _capacity has been imposed, the writer and reader could become mutually deadlocked. When there are multiple blocked readers, any of the readers may get the next object(s) added. Blocks until the pipeline closes and reads all objects. A collection of zero or more objects. If the stream is empty, a collection of size zero is returned. If there are multiple reader threads, the objects returned to blocking reads Read(int count) and ReadToEnd() are not necessarily single blocks of objects added to the stream in that order. For example, if ABCDEF are added to the stream, one reader may get ABDE and the other may get CF. Each reader reads items from the stream as they become available. Otherwise, if a maximum _capacity has been imposed, the writer and reader could become mutually deadlocked. When there are multiple blocked readers, any of the readers may get the next object(s) added. Reads objects currently in the stream, but does not block. An array of zero or more objects. This method performs a read of objects currently in the stream. The method will block until exclusive access to the stream is acquired. If there are no objects in the stream, an empty array is returned. Return no more than maxRequested objects. is less than 0 Peek the next object The next object in the stream or AutomationNull.Value if the stream is empty The ObjectStream is closed Writes a object to the current position in the stream and advances the position within the stream by one object. The object to write to the stream. One, if the write was successful, otherwise; zero if the stream was closed before the object could be written, or if the object was AutomationNull.Value. The stream is closed AutomationNull.Value is ignored Write objects to the underlying stream object or enumeration to read from If enumerateCollection is true, and is an enumeration according to LanguagePrimitives.GetEnumerable, the objects in the enumeration will be unrolled and written seperately. Otherwise, will be written as a single object. The number of objects written The underlying stream is closed If the enumeration contains elements equal to AutomationNull.Value, they are are ignored. This can cause the return value to be less than the size of the collection. Close the stream Causes subsequent calls to IsOpen to return false and calls to a write operation to throw PipelineClosedException. All calls to Close() after the first call are silently ignored. Flush the data from the stream. Closed streams may be flushed. public method for dispose release all resources if true, release all managed resources Event fired when data is added to the buffer Get the capacity of the stream The capacity of the stream. The capacity is the number of objects the stream may contain at one time. Once this limit is reached, attempts to write into the stream block until buffer space becomes available. MaxCapacity cannot change, so we can skip the lock. Waitable handle for callers to wait on until data ready to read. The handle is set when data becomes available to read or when a partial read has completed. If multiple readers are used, setting the handle does not guarantee that a read operation will return data. If using multiple reader threads, for performing non-blocking reads. Waitable handle for callers to block until buffer space becomes available. The handle is set when space becomes available for writing. For multiple writer threads writing to a bounded stream, the writer may still block if another thread fills the stream to capacity. Determine if we are at the end of the stream EndOfPipeline is defined as the stream being closed and containing zero objects. Readers check this to determine if any objects are in the stream. Writers should check to determine if the stream can be written to. Check if the stream is open for further writes. true if the stream is open, false if not. IsOpen returns true until the first call to Close(). Writers should check IsOpen to determine if a write operation can be made. Note that writers need to catch . Returns the number of objects in the stream Return a PipelineReader(object) for this stream Return a PipelineReader(PSObject) for this stream Return an PipelineWriter for this stream A FIFO memory based object stream. The purpose of this stream class is to provide the semantics of a unidirectional stream of objects between two threads using a dynamic memory buffer. The stream may be bound or unbounded. Bounded streams are created via passing a capacity to the constructor. Unbounded streams are created using the default constructor. The capacity of the stream can not be changed after construction. For bounded streams, attempts to write to the stream when the capacity has been reached causes the writer to block until objects are read. For unbounded streams, writers only block for the amount of time needed to acquire exclusive access to the stream. Note that unbounded streams have a capacity of of Int32.MaxValue objects. In theory, if this limit were reached, the stream would function as a bounded stream. This class is safe for multi-threaded use with the following side-effects: > For bounded streams, write operations are not guaranteed to be atomic. If a write operation causes the capacity to be reached without writing all data, a partial write occurs and the writer blocks until data is read from the stream. > When multiple writer or reader threads are used, the order the reader or writer acquires a lock on the stream is undefined. This means that the first call to write does not guarantee the writer will acquire a write lock first. The first call to read does not guarantee the reader will acquire the read lock first. > Reads and writes may occur in any order. With a bounded stream, write operations between threads may also result in interleaved write operations. The result is that the order of data is only guaranteed if there is a single writer. Objects in the stream Is the stream open or closed for writing? Read handle - signaled when data is ready to read This event may, on occasion, be signalled even when there is no data available. If this happens, just wait again. Never wait on this event alone. Since this is an AutoResetEvent, there is no way to definitely release all blocked threads when the stream is closed for reading. Instead, use WaitAny on this handle and also _readClosedHandle. Handle returned to callers for blocking on data ready When this handle is set, the stream is closed for reading, so all blocked readers should be released. Write handle - signaled with the number of objects in the stream becomes less than the maximum number of objects allowed in the stream. This event may, on occasion, be signalled even when there is no write buffer available. If this happens, just wait again. Never wait on this event alone. Since this is an AutoResetEvent, there is no way to definitely release all blocked threads when the stream is closed for writing. Instead, use WaitAny on this handle and also _writeClosedHandle. Handle returned to callers for blocking until buffer space is available for write. When this handle is set, the stream is closed for writing, so all blocked readers should be released. The object reader for this stream. This field is allocated on first demand and returned on subsequent calls. The PSObject reader for this stream. This field is allocated on first demand and returned on subsequent calls. The object writer for this stream. This field is allocated on first demand and returned on subsequent calls. Maximum number of objects allowed in the stream Note that this is not permitted to be more than Int32.MaxValue, since the underlying ArrayList has this limitation This object is used to acquire an exclusive lock on the stream Note that we lock _monitorObject rather than "this" so that we are protected from outside code interfering in our critical section. Thanks to Wintellect for the hint. Indicates if this stream has already been disposed Default constructor Constructs a stream with a miximum size of Int32.Max Allocate the stream with an initial size The maximum number of objects to allow in the buffer at a time. Note that this is not permitted to be more than Int32.MaxValue, since the underlying ArrayList has this limitation is less than or equal to zero is greater than Int32.MaxValue Wait for data to be readable true if EndOfPipeline is not reached. WaitRead does not guarantee that data is present in the stream, only that data was added when the event was signaled. Since there may be multiple readers, data may be removed from the stream before the caller has a chance to read the data. This method should never be called within a lock(_monitorObject). Wait for data to be writeable True if the stream is writeable, otherwise; false. WaitWrite does not guarantee that buffer space will be available in the stream when the caller attempts to write, only that buffer space was available when the event was signaled. This method should never be called within a lock(_monitorObject). Utility method to signal handles and raise events in the consistent order. NOTE: Release the lock before raising events; otherwise, there is a possible deadlock during the readable event. RaiseEvents is fairly idempotent, although it will signal DataReady every time. Flush the data from the stream. Closed streams may be flushed. Close the stream Causes subsequent calls to IsOpen to return false and calls to a write operation to throw PipelineClosedException. All calls to Close() after the first call are silently ignored. Read a single object from the stream The next object in the stream or AutomationNull if EndOfPipeline is reached This method blocks if the stream is empty Read at most objects The maximum number of objects to read The objects read is less than 0 This method blocks if the number of objects in the stream is less than and the stream is not closed. If there are multiple reader threads, the objects returned to blocking reads Read(int count) and ReadToEnd() are not necessarily single blocks of objects added to the stream in that order. For example, if ABCDEF are added to the stream, one reader may get ABDE and the other may get CF. Each reader reads items from the stream as they become available. Otherwise, if a maximum _capacity has been imposed, the writer and reader could become mutually deadlocked. When there are multiple blocked readers, any of the readers may get the next object(s) added. Blocks until the pipeline closes and reads all objects. A collection of zero or more objects. If the stream is empty, a collection of size zero is returned. If there are multiple reader threads, the objects returned to blocking reads Read(int count) and ReadToEnd() are not necessarily single blocks of objects added to the stream in that order. For example, if ABCDEF are added to the stream, one reader may get ABDE and the other may get CF. Each reader reads items from the stream as they become available. Otherwise, if a maximum _capacity has been imposed, the writer and reader could become mutually deadlocked. When there are multiple blocked readers, any of the readers may get the next object(s) added. Reads objects currently in the stream, but does not block. An array of zero or more objects. This method performs a read of objects currently in the stream. The method will block until exclusive access to the stream is acquired. If there are no objects in the stream, an empty array is returned. Return no more than maxRequested objects. is less than 0 Peek the next object The next object in the stream or AutomationNull.Value if the stream is empty The ObjectStream is closed Write objects to the underlying stream object or enumeration to read from If enumerateCollection is true, and is an enumeration according to LanguagePrimitives.GetEnumerable, the objects in the enumeration will be unrolled and written seperately. Otherwise, will be written as a single object. The number of objects written The underlying stream is closed If the enumeration contains elements equal to AutomationNull.Value, they are are ignored. This can cause the return value to be less than the size of the collection. These methods are necessary to provide the ObjectStreamTest BVT access to the internal handler DataReady. The EventInfo reflection class does not give access to internal events. release all resources if true, release all managed resources Get the capacity of the stream The capacity of the stream. The capacity is the number of objects the stream may contain at one time. Once this limit is reached, attempts to write into the stream block until buffer space becomes available. MaxCapacity cannot change, so we can skip the lock. Waitable handle for callers to wait on until data ready to read. The handle is set when data becomes available to read or when a partial read has completed. If multiple readers are used, setting the handle does not guarantee that a read operation will return data. If using multiple reader threads, for performing non-blocking reads. Waitable handle for callers to block until buffer space becomes available. The handle is set when space becomes available for writing. For multiple writer threads writing to a bounded stream, the writer may still block if another thread fills the stream to capacity. Return a PipelineReader(object) for this stream Return a PipelineReader(PSObject) for this stream Return an PipelineWriter for this stream Determine if we are at the end of the stream EndOfPipeline is defined as the stream being closed and containing zero objects. Readers check this to determine if any objects are in the stream. Writers should check to determine if the stream can be written to. Check if the stream is open for further writes. true if the stream is open, false if not. IsOpen returns true until the first call to Close(). Writers should check IsOpen to determine if a write operation can be made. Note that writers need to catch . Returns the number of objects in the stream An object stream using a PSDataCollection as the object store. This stream lets user to supply a custom PSDataCollection instance to use as the stream's object store. This stream is designed to be used with the user supplied PSDataBuffers. For internal only purposes use ObjectStream. Creates the stream and uses the supplied as the object store Guid of Powershell instance creating this stream. A PSDataCollection instance. 1. storeToUse is null Creates an Object Reader for the pipeline computer name that the pipeline specifies runspace id that the pipeline specifies the computer name and runspace id are associated with the reader so as to enable cmdlets to identify which computer name runspace does the object that this stream writes belongs to Creates a PSObject Reader for this pipeline computer name that the pipeline specifies runspace id that the pipeline specifies the computer name and runspace id are associated with the reader so as to enable cmdlets to identify which computer name runspace does the object that this stream writes belongs to Write object(s) to the databuffer. This stream do not perform close operations on the buffer. It is upto the user to close the buffers as and when needed. However this method notifies the buffer by decrementing the ref count. release all resources if true, release all resources Gets the PSDataCollection used to store data for this stream. Returns the number of objects in the stream This is not supported Check if the stream is open for further writes. true if the stream is open, false if not. IsOpen returns true until the first call to Close(). Writers should check IsOpen to determine if a write operation can be made. This is not supported. Return a PipelineReader(object) for this stream Return a PipelineReader(PSObject) for this stream The object writer for this stream. This field is allocated on first demand and returned on subsequent calls. Read handle associated with this stream A ObjectWriter for an ObjectStream This class is not safe for multi-threaded operations. Construct with an existing ObjectStream the stream to write Thrown if the specified stream is null Close the stream Causes subsequent calls to IsOpen to return false and calls to a write operation to throw an ObjectDisposedException. All calls to Close() after the first call are silently ignored. The stream is already disposed Flush the data from the stream. Closed streams may be flushed, but disposed streams may not. The underlying stream is disposed Write a single object into the underlying stream The object to add to the stream One, if the write was successful, otherwise; zero if the stream was closed before the object could be written, or if the object was AutomationNull.Value. The underlying stream is closed AutomationNull.Value is ignored Write objects to the underlying stream object or enumeration to read from If enumerateCollection is true, and is an enumeration according to LanguagePrimitives.GetEnumerable, the objects in the enumeration will be unrolled and written seperately. Otherwise, will be written as a single object. The number of objects written The underlying stream is closed If the enumeration contains elements equal to AutomationNull.Value, they are are ignored. This can cause the return value to be less than the size of the collection. The underlying stream Can never be null Waitable handle for caller's to block until buffer space is available in the underlying stream Check if the stream is open for further writes. true if the underlying stream is open, otherwise; false. Attempting to write to the underlying stream if IsOpen is false throws a . Returns the number of objects in the underlying stream Get the capacity of the stream The capacity of the stream. The capacity is the number of objects that stream may contain at one time. Once this limit is reached, attempts to write into the stream block until buffer space becomes available. A ObjectWriter for a PSDataCollection ObjectStream PSDataCollection is introduced after 1.0. PSDataCollection is used to store data from the last command in the pipeline and hence the writer will not support certain features like Flush(). Construct with an existing PSDataCollectionStream the stream to write Thrown if the specified stream is null The exception thrown if the specified value can not be bound parameter of a command. Constructs a ParameterBindingException. The category for the error. The information about the command that encountered the error. The position for the command or parameter that caused the error. If position is null, the one from the InvocationInfo is used. The parameter on which binding caused the error. The Type the parameter was expecting. The Type that was attempted to be bound to the parameter. The base name of the resource to load the format string from for the exception message. The error ID and resource ID of the resource to load the format string from from the exception message. Additional arguments to pass to the format string. If is null. If or is null or empty. Constructs a ParameterBindingException The inner exception. The category for the error. The information about the command that encountered the error. InvocationInfo.MyCommand.Name == {0} The position for the command or parameter that caused the error. If position is null, the one from the InvocationInfo is used. token.LineNumber == {4} token.OffsetInLine == {5} The parameter on which binding caused the error. parameterName == {1} The Type the parameter was expecting. parameterType == {2} The Type that was attempted to be bound to the parameter. typeSpecified == {3} The base name of the resource to load the format string from for the exception message. The error ID and resource ID of the resource to load the format string from from the exception message. Additional arguments to pass to the format string. starts at {6} If is null. If or is null or empty. Constructors a ParameterBindingException using serialized data. serialization information streaming context Serializes the exception serialization information streaming context Constructs a ParameterBindingException. DO NOT USE!!! Constructors a ParameterBindingException Message to be included in exception. DO NOT USE!!! Constructs a ParameterBindingException Message to be included in the exception. exception that led to this exception DO NOT USE!!! Gets the message for the exception Gets the name of the parameter that the parameter binding error was encountered on. Gets the type the parameter is expecting. Gets the Type that was specified as the parameter value Gets the errorId of this ParameterBindingException Gets the line in the script at which the error occurred. Gets the offset on the line in the script at which the error occurred. Gets the invocation information about the command. Constructs a ParameterBindingValidationException The category for the error. The information about the command that encountered the error. InvocationInfo.MyCommand.Name == {0} The position for the command or parameter that caused the error. token.LineNumber == {4} token.OffsetInLine == {5} The parameter on which binding caused the error. parameterName == {1} The Type the parameter was expecting. parameterType == {2} The Type that was attempted to be bound to the parameter. typeSpecified == {3} The base name of the resource to load the format string from for the exception message. The error ID and resource ID of the resource to load the format string from from the exception message. Additional arguments to pass to the format string. starts at {6} If is null. If or is null or empty. Constructs a ParameterBindingValidationException The inner exception. The category for the error. The information about the command that encountered the error. InvocationInfo.MyCommand.Name == {0} The position for the command or parameter that caused the error. token.LineNumber == {4} token.OffsetInLine == {5} The parameter on which binding caused the error. parameterName == {1} The Type the parameter was expecting. parameterType == {2} The Type that was attempted to be bound to the parameter. typeSpecified == {3} The base name of the resource to load the format string from for the exception message. The error ID and resource ID of the resource to load the format string from from the exception message. Additional arguments to pass to the format string. starts at {6} If is null. If or is null or empty. Constructs a ParameterBindingValidationException from serialized data serialization information streaming context Make the positional binding ignore this validation exception when it's set to true. This property is only used internally in the positional binding phase Constructs a ParameterBindingArgumentTransformationException The category for the error. The information about the command that encountered the error. InvocationInfo.MyCommand.Name == {0} The position for the command or parameter that caused the error. token.LineNumber == {4} token.OffsetInLine == {5} The parameter on which binding caused the error. parameterName == {1} The Type the parameter was expecting. parameterType == {2} The Type that was attempted to be bound to the parameter. typeSpecified == {3} The base name of the resource to load the format string from for the exception message. The error ID and resource ID of the resource to load the format string from from the exception message. Additional arguments to pass to the format string. starts at {6} If is null. If or is null or empty. Constructs a ParameterBindingArgumentTransformationException The inner exception. The category for the error. The information about the command that encountered the error. InvocationInfo.MyCommand.Name == {0} The position for the command or parameter that caused the error. token.LineNumber == {4} token.OffsetInLine == {5} The parameter on which binding caused the error. parameterName == {1} The Type the parameter was expecting. parameterType == {2} The Type that was attempted to be bound to the parameter. typeSpecified == {3} The base name of the resource to load the format string from for the exception message. The error ID and resource ID of the resource to load the format string from from the exception message. Additional arguments to pass to the format string. starts at {6} If is null. If or is null or empty. Constructs a ParameterBindingArgumentTransformationException using serialized data serialization information streaming context Constructs a ParameterBindingParameterDefaultValueException The category for the error. The information about the command that encountered the error. InvocationInfo.MyCommand.Name == {0} The position for the command or parameter that caused the error. token.LineNumber == {4} token.OffsetInLine == {5} The parameter on which binding caused the error. parameterName == {1} The Type the parameter was expecting. parameterType == {2} The Type that was attempted to be bound to the parameter. typeSpecified == {3} The base name of the resource to load the format string from for the exception message. The error ID and resource ID of the resource to load the format string from from the exception message. Additional arguments to pass to the format string. starts at {6} If is null. If or is null or empty. Constructs a ParameterBindingParameterDefaultValueException The inner exception. The category for the error. The information about the command that encountered the error. InvocationInfo.MyCommand.Name == {0} The position for the command or parameter that caused the error. token.LineNumber == {4} token.OffsetInLine == {5} The parameter on which binding caused the error. parameterName == {1} The Type the parameter was expecting. parameterType == {2} The Type that was attempted to be bound to the parameter. typeSpecified == {3} The base name of the resource to load the format string from for the exception message. The error ID and resource ID of the resource to load the format string from from the exception message. Additional arguments to pass to the format string. starts at {6} If is null. If or is null or empty. Constructs a ParameterBindingParameterDefaultValueException using serialized data serialization information streaming context Defines the exception thrown when a syntax error occurs while parsing msh script text. Initializes a new instance of the ParseException class and defines the serialization information, and streaming context. The serialization information to use when initializing this object The streaming context to use when initializing this object constructed object Add private data for serialization. Initializes a new instance of the class ParseException constructed object Initializes a new instance of the ParseException class and defines the error message. The error message to use when initializing this object constructed object Initializes a new instance of the ParseException class and defines the error message and errorID. The error message to use when initializing this object The errorId to use when initializing this object constructed object Initializes a new instance of the ParseException class and defines the error message, error ID and inner exception. The error message to use when initializing this object The errorId to use when initializing this object The inner exception to use when initializing this object constructed object Initializes a new instance of the ParseException class and defines the error message and inner exception. The error message to use when initializing this object The inner exception to use when initializing this object constructed object Initializes a new instance of the ParseException class with a collection of error messages. The collection of error messages. The list of parser errors. The error message to display. Defines the exception thrown when a incomplete parse error occurs while parsing msh script text. This is a variation on a parsing error that indicates that the parse was incomplete rather than irrecoverably wrong. A host can catch this exception and then prompt for additional input to complete the parse. Initializes a new instance of the IncompleteParseException class and defines the serialization information, and streaming context. The serialization information to use when initializing this object The streaming context to use when initializing this object constructed object Initializes a new instance of the class IncompleteParseException constructed object Initializes a new instance of the IncompleteParseException class and defines the error message. The error message to use when initializing this object constructed object Initializes a new instance of the IncompleteParseException class and defines the error message and errorID. The error message to use when initializing this object The errorId to use when initializing this object constructed object Initializes a new instance of the IncompleteParseException class and defines the error message, error ID and inner exception. The error message to use when initializing this object The errorId to use when initializing this object The inner exception to use when initializing this object constructed object Initializes a new instance of the IncompleteParseException class and defines the error message and inner exception. The error message to use when initializing this object The inner exception to use when initializing this object constructed object Defines generic utilities and helper methods for PowerShell THE method for opening a file for writing. Should be used by all cmdlets that write to a file. cmdlet that is opening the file (used mainly for error reporting) path to the file (as specified on the command line - this method will resolve the path) encoding (this method will convert the command line strin to an Encoding instance) if true, then we will use default .NET encoding instead of the encoding specified in parameter Result1: opened for writing Result2: (inherits from ) opened for writing Result3: file info that should be used to restore file attributes after done with the file (null is this is not needed) True if wildcard expansion should be bypassed. THE method for opening a file for writing. Should be used by all cmdlets that write to a file. cmdlet that is opening the file (used mainly for error reporting) path to the file (as specified on the command line - this method will resolve the path) encoding (this method will convert the command line strin to an Encoding instance) if true, then we will use default .NET encoding instead of the encoding specified in parameter Result1: opened for writing Result2: (inherits from ) opened for writing Result3: file info that should be used to restore file attributes after done with the file (null is this is not needed) True if wildcard expansion should be bypassed. resolve a user provided file name or path (including globbing characters) to a fully qualified file path, using the file system provider resolve a user provided file name or path (including globbing characters) to a fully qualified file path, using the file system provider retrieve the encoding paramater from the command line it throws if the encoding does not match the known ones a System.Text.Encoding object (null if no encoding specified) Defines generic utilities and helper methods for PowerShell Safely retrieves the MainModule property of a process. Version 2.0 and below of the .NET Framework are impacted by a Win32 API usability knot that throws an exception if API tries to enumerate the process' modules while it is still loading them. This generates the error message: Only part of a ReadProcessMemory or WriteProcessMemory request was completed. The BCL fix in V3 was to just try more, so we do the same thing. Note: If you attempt to retrieve the MainModule of a 64-bit process from a WOW64 (32-bit) process, the Win32 API has a fatal flaw that causes this to return the same error. If you need the MainModule of a 64-bit process from a WOW64 process, you will need to write the P/Invoke yourself. The process from which to retrieve the MainModule You are trying to access the MainModule property for a process that is running on a remote computer. This property is available only for processes that are running on the local computer. The process Id is not available (or) The process has exited. Retrieve the parent process of a process. This is an extremely expensive operation, as WMI needs to work with an ugly Win32 API. The Win32 API creates a snapshot of every process in the system, which you then need to iterate through to find your process and its parent PID. Also, since this is PID based, this API is only reliable when the process has not yet exited. The process we want to find the parent of Checks if a required version of the .NET framework is installed. For the following well known versions of the framework and any service packs, use FrameworkRegistryInstallation.IsFrameworkInstalled directly: 1.1, 2.0, 3.0 and 3.5. The check is performed through the registry, if possible. Otherwise the File System is used. The file system check allows for a larger range of framework versions to be checked and, in most cases, will not be able to check for more than major and minor parts of the .NET version since %systemroot%\Microsoft.NET\Framework\vx.x rarely has mscorlib.dll. The file system seems a better open mechanism to support the module feature that allows specifying a particular version of the framework to be used. The registry way implemented in PsUtils.FrameworkRegistryInstallation is the official way to check for installation, but it can only check for a few versions. It has 2 overloads for IsFrameworkInstalled. The one taking a Version can only check the installation of versions mentioned in http://support.microsoft.com/kb/318785 and serves more for the support of IsDotNetFrameworkVersionInstalled and for the module feature. The one taking major, minor and spNumber should be used directly if you need to check for the installation of .NET 1.1, 2.0, 3.0 or 3.5. spNumber can be 0 if there is no need for a particular service pack. Version to check. for .NET Framework 3.5 and any service pack this can be new Version(3,5) or new Version(3, 5, 21022, 8). for .NET 3.5 with SP1 this should be new Version(3, 5, 30729, 1). For other well knonwn versions please check the table at http://support.microsoft.com/kb/318785. true if the required version is present; false otherwise Checks if a required version of the .NET framework is installed. The most robust check is done on major.minor versions - - the revision/build checks work only if the version includes mscorlib.dll. Based on KB article at http://support.microsoft.com/kb/318785. Framework version to check. For instance, new Version(3,5) will check for .NET 3.5. true if the required version is present; false otherwise Returns processor architecture for the current process. If powershell is running inside Wow64, then is returned. processor architecture for the current process Return true/false to indicate whether the processor architecture is ARM Detects the installation of Frmework Versions 1.1, 2.0, 3.0 and 3.5 and 4.0 through the official registry instalation keys. Gets the three registry names allowing for framework installation and service pack checks based on the majorVersion and minorVersion version numbers. Major version of .NET required, for .NET 3.5 this is 3. Minor version of .NET required, for .NET 3.5 this is 5. name of the key containing installValueName name of the registry key indicating the SP has been installed name of the key containing the SP value with SP version name of the value containing the SP value with SP version true if the majorVersion and minorVersion correspond the versions we can check for, false otherwise. Tries to read the valueName from the registry key returning null if the it was not found, if it is not an integer or if or an exception was thrown. Key containing valueName Name of value to be returned The value or null if it could not be retrieved Tries to read the keyName from the registry key returning null if the key was not found or an exception was thrown. Key containing subKeyName NAme of sub key to be returned The subkey or null if it could not be retrieved Returns true if IsFrameworkInstalled will be able to check for this framework version. version to be checked Major version of .NET required, for .NET 3.5 this is 3. Minor version of .NET required, for .NET 3.5 this is 5. Minimum SP version number corresponding to . true if IsFrameworkInstalled will be able to check for this framework version Check if the given version if the framework is installed version to check. for .NET Framework 3.5 and any service pack this can be new Version(3,5) or new Version(3, 5, 21022, 8). for .NET 3.5 with SP1 this should be new Version(3, 5, 30729, 1). For other versions please check the table at http://support.microsoft.com/kb/318785. Check if the given version if the framework is installed Major version of .NET required, for .NET 3.5 this is 3. Minor version of .NET required, for .NET 3.5 this is 5. Minimum SP version required. 0 (Zero) or less means no SP requirement. true if the framework is available. False if it is not available or that could not be determined. Equality comparer based on Object Identity Maintains a cache of ResourceManager objects. This is a dictionary that is keyed based on the path to the default resource assembly. The value is another dictionary that is keyed based on the base name for the resource that is being retrieved. The value for this dictionary is the ResourceManager. Used to synchronize access to the ResourceManagerCache Helper method to get a single resource manager for this assembly. This prevents people from having to manage resource managers throughout their code. A resource manager for this assembly. Gets the ResourceManager from the cache or gets an instance of the ResourceManager and returns it if it isn't already present in the cache. The assembly to be used as the base for resource lookup. The base name of the resources to get the ResourceManager for. A ResourceManager instance for the assembly and base name that were specified. Gets the string from the resource manager based on the base name, and resource ID specified The base name of the resource to retrieve the string from. Resource ID for which the localized string needs to be retrieved Localized String, or null if the string does not exist The current thread's UI culture is used. ArgumentException if or are null or empty.. InvalidOperationException if the value of the specified resource is not a string MissingManifestResourceException if no usable set of resources have been found, and there are no neutral culture resources. Design For Testability -- assert on failed resource lookup Gets the string from the resource manager based on the assembly, base name, resource ID, and culture specified The base assembly from which to get the resources from. The base name of the resource to retrieve the string from. Resource ID for which the localized string needs to be retrieved Localized String, or null if the string does not exist The current thread's UI culture is used. ArgumentException if or are null or empty.. InvalidOperationException if the value of the specified resource is not a string MissingManifestResourceException if no usable set of resources have been found, and there are no neutral culture resources. Gets the string from the resource manager based on the assembly, base name, resource ID, and culture specified The base assembly from which to get the resources from. The base name of the resource to retrieve the string from. Resource ID for which the localized string needs to be retrieved The resource should be retrieved for this culture. Localized String, or null if the string does not exist ArgumentException if or are null or empty.. InvalidOperationException if the value of the specified resource is not a string MissingManifestResourceException if no usable set of resources have been found, and there are no neutral culture resources. Gets the string from the resource manager based on the assembly, base name, resource ID, and culture specified The base name of the resource to retrieve the string from. Resource ID for which the localized string needs to be retrieved The resource should be retrieved for this culture. Localized String, or null if the string does not exist The calling assembly is used as the base assembly to retrieve the resources from. ArgumentException if or are null or empty.. InvalidOperationException if the value of the specified resource is not a string MissingManifestResourceException if no usable set of resources have been found, and there are no neutral culture resources. Gets a template string from the resource manager, then inserts parameters using String.Format. Culture information based on which the string will be retrieved from appropriate culture's resource file / satellite assembly. If this parameter is null, the current thread's UI culture is used. Culture information based on which the string will be formatted. If this parameter is null, the current thread's culture is used. The base name of the resource to retrieve the string from. Resource ID for which the localized string needs to be retrieved String.Format insertion parameters Localized String, or null if the string does not exist Uses the calling assembly as the base assembly to load resources from. ArgumentException if or are null or empty.. InvalidOperationException if the value of the specified resource is not a string MissingManifestResourceException if no usable set of resources have been found, and there are no neutral culture resources. FormatException if could not be formatted into the resource string Gets a template string from the resource manager, then inserts parameters using String.Format. The base assembly that contains the resources. Culture information based on which the string will be retrieved from appropriate culture's resource file / satellite assembly. If this parameter is null, the current thread's UI culture is used. Culture information based on which the string will be formatted. If this parameter is null, the current thread's culture is used. The base name of the resource to retrieve the string from. Resource ID for which the localized string needs to be retrieved String.Format insertion parameters Localized String, or null if the string does not exist ArgumentException if or are null or empty.. InvalidOperationException if the value of the specified resource is not a string MissingManifestResourceException if no usable set of resources have been found, and there are no neutral culture resources. FormatException if could not be formatted into the resource string Gets a template string from the resource manager using the current thread's UI culture, then inserts parameters using String.Format. The base assembly that contains the resources. The base name of the resource to retrieve the string from. Resource ID for which the localized string needs to be retrieved String.Format insertion parameters Localized String, or null if the string does not exist ArgumentException if or are null or empty. InvalidOperationException if the value of the specified resource is not a string MissingManifestResourceException if no usable set of resources have been found, and there are no neutral culture resources. FormatException if could not be formatted into the resource string Gets a template string from the resource manager using the calling assembly, and the current thread's UI culture, then inserts parameters using String.Format. The base name of the resource to retrieve the string from. Resource ID for which the localized string needs to be retrieved String.Format insertion parameters Localized String, or null if the string does not exist ArgumentException if or are null or empty.. InvalidOperationException if the value of the specified resource is not a string MissingManifestResourceException if no usable set of resources have been found, and there are no neutral culture resources. FormatException if could not be formatted into the resource string Creates a Resource manager instance based on the assembly specified. The root name of the resources. For example, the root name for the resource file named "MyResource.en-US.resources" is "MyResource". The main Assembly for the resources The Type of the custom ResourceSet to use. If a null reference, the default runtime ResourceSet is used Resource Manager instance Thrown if the resource manager instance could not be created An exception that wraps all exceptions that are thrown by providers. This allows callers of the provider APIs to be able to catch a single exception no matter what any of the various providers may have thrown. Constructs a ProviderInvocationException Constructs a ProviderInvocationException using serialized data serialization information streaming context Constructs a ProviderInvocationException with a message The message for the exception. Constructs a ProviderInvocationException with provider information and an inner exception. Information about the provider to be used in formatting the message. The inner exception for this exception. Constructs a ProviderInvocationException with provider information and an ErrorRecord. Information about the provider to be used in formatting the message. Detailed error information Constructs a ProviderInvocationException with a message and inner exception. The message for the exception. The inner exception for this exception. Constructs a ProviderInvocationException This string will be used to construct the FullyQualifiedErrorId, which is a global identifier of the error condition. Pass a non-empty string which is specific to this error condition in this context. This string is the message template string. The provider information used to format into the message. The path that was being processed when the exception occurred. The exception that was thrown by the provider. Constructor to make it easy to wrap a provider exception This string will be used to construct the FullyQualifiedErrorId, which is a global identifier of the error condition. Pass a non-empty string which is specific to this error condition in this context. This is the message template string The provider information used to format into the message. The path that was being processed when the exception occurred. The exception that was thrown by the provider. If true, the message from the inner exception will be used if the exception contains an ErrorRecord. If false, the error message retrieved using the errorId will be used. Gets the provider information of the provider that threw an exception. Gets the error record. Gets the exception message Categories of session state objects, used by SessionStateException Used when an exception is thrown accessing a variable. Used when an exception is thrown accessing an alias. Used when an exception is thrown accessing a function. Used when an exception is thrown accessing a filter. Used when an exception is thrown accessing a drive. Used when an exception is thrown accessing a Cmdlet Provider. Used when an exception is thrown manipulating the PowerShell language scopes. Used when generically accessing any type of command... Other resources not covered by the previous categories... Used when an exception is thrown accessing a cmdlet. SessionStateException represents an error working with session state objects: variables, aliases, functions, filters, drives, or providers. Constructs a SessionStateException name of session state object category of session state object This string is the message template string. This string is the ErrorId passed to the ErrorRecord, and is also the resourceId used to look up the message template string in SessionStateStrings.txt. ErrorRecord.CategoryInfo.Category Additional insertion strings used to construct the message. Note that itemName is always the first insertion string. Constructs a SessionStateException Constructs a SessionStateException The message used in the exception. Constructs a SessionStateException The message used in the exception. The exception that caused the error. Constructs a SessionStateException using serialized data. serialization information streaming context Serializes the exception data. serialization information streaming context Gets the error record information for this exception. Gets the name of session state object the error occurred on. Gets the category of session state object the error occurred on. SessionStateOverflowException occurs when the number of session state objects of this type in this scope exceeds the configured maximum. Constructs a SessionStateOverflowException The name of the session state object the error occurred on. The category of session state object. This string is the ErrorId passed to the ErrorRecord, and is also the resourceId used to look up the message template string in SessionStateStrings.txt. This string is the message template string Additional insertion strings used to construct the message. Note that itemName is always the first insertion string. Constructs a SessionStateOverflowException Constructs a SessionStateOverflowException with a message. The message used by the exception. Constructs a SessionStateOverflowException The message the exception will use. The exception that caused the error. Constructs a SessionStateOverflowException using serialized data. serialization information streaming context SessionStateUnauthorizedAccessException occurs when a change to a session state object cannot be completed because the object is read-only or constant, or because an object which is declard constant cannot be removed or made non-constant. Constructs a SessionStateUnauthorizedAccessException The name of the session state object the error occurred on. The category of session state object. This string is the ErrorId passed to the ErrorRecord, and is also the resourceId used to look up the message template string in SessionStateStrings.txt. This string is the ErrorId passed to the ErrorRecord, and is also the resourceId used to look up the message template string in SessionStateStrings.txt. Constructs a SessionStateUnauthorizedAccessException Constructs a SessionStateUnauthorizedAccessException The message used by the exception. Constructs a SessionStateUnauthorizedAccessException The message used by the exception. The exception that caused the error. Constructs a SessionStateUnauthorizedAccessException using serialized data. serialization information streaming context ProviderNotFoundException occurs when no provider can be found with the specified name. Constructs a ProviderNotFoundException The name of provider that could not be found. The category of session state object This string is the ErrorId passed to the ErrorRecord, and is also the resourceId used to look up the message template string in SessionStateStrings.txt. This string is the message template string Additional arguments to build the message from. Constructs a ProviderNotFoundException Constructs a ProviderNotFoundException The messaged used by the exception. Constructs a ProviderNotFoundException The message used by the exception. The exception that caused the error. Constructs a ProviderNotFoundException using serialized data. serialization information streaming context ProviderNameAmbiguousException occurs when more than one provider exists for a given name and the request did not contain the PSSnapin name qualifier. Constructs a ProviderNameAmbiguousException The name of provider that was ambiguous. This string is the ErrorId passed to the ErrorRecord, and is also the resourceId used to look up the message template string in SessionStateStrings.txt. This string is the message template string The provider information for the providers that match the specified name. Additional arguments to build the message from. Constructs a ProviderNameAmbiguousException Constructs a ProviderNameAmbiguousException The messaged used by the exception. Constructs a ProviderNameAmbiguousException The message used by the exception. The exception that caused the error. Constructs a ProviderNameAmbiguousException using serialized data. serialization information streaming context Gets the information of the providers which might match the specified provider name. DriveNotFoundException occurs when no drive can be found with the specified name. Constructs a DriveNotFoundException The name of the drive that could not be found. This string is the ErrorId passed to the ErrorRecord, and is also the resourceId used to look up the message template string in SessionStateStrings.txt. This string is the message template string Constructs a DriveNotFoundException Constructs a DriveNotFoundException The message that will be used by the exception. Constructs a DriveNotFoundException The message that will be used by the exception. The exception that caused the error. Constructs a DriveNotFoundException using serialized data. serialization information streaming context ItemNotFoundException occurs when the path contained no wildcard characters and an item at that path could not be found. Constructs a ItemNotFoundException The path that was not found. This string is the ErrorId passed to the ErrorRecord, and is also the resourceId used to look up the message template string in SessionStateStrings.txt. This string is the ErrorId passed to the ErrorRecord, and is also the resourceId used to look up the message template string in SessionStateStrings.txt. Constructs a ItemNotFoundException Constructs a ItemNotFoundException The message used by the exception. Constructs a ItemNotFoundException The message used by the exception. The exception that caused the error. Constructs a ItemNotFoundException using serialized data. serialization information streaming context These flags enable tracing based on the types of a tracing supplied. Each type of tracing will allow for one or more methods in the StructuredTraceSource class to become "enabled". All tracing off Constructors will be traced Dispose will be traced Finalize will be traced Methods will be traced Properties will be traced Delegates will be traced Events will be traced Exceptions will be traced Locks will be traced Errors will be traced Warnings will be traced Verbose messages will be traced WriteLines will be traced TraceScope calls will be traced Assertions will be traced A combination of flags that trace the execution flow will be traced The methods associated with the flags; Constructor, Dispose, Finalizer, Method, Delegates, and Events will be enabled A combination of flags that trace the data will be traced be traced The methods associated with the flags; Constructor, Dispose, Finalizer, Property, and WriteLine will be enabled A combination of flags that trace the errors The methods associated with the flags; Error, and Exception will be enabled All combination of trace flags will be set be traced All methods for tracing will be enabled. A light-weight object to manage the indention of trace output for each thread. An instance of this object is returned when any scoping Trace method (like TraceMethod, TraceProperty, etc.) is called. In the constructor to the object the indention level for the thread is incremented. The Dispose method will decrement the thread indent level. Constructor that traces the scope name and raises the indent level in thread local storage. The trace object that is to be used for output The PSTraceSourceOptions that is causing the scope object to be created. This format string is used to determine the general output format for the scope. For instance, TraceMethod would probably provide a formatter similar to "Entering: {0}: {1}" where {0} is the name of the method and {1} is the additional formatted info provided. The format string used to determine the general output format for the scope when the Dispose method is called. The name of the scope that is being traced Constructor that traces the scope name and raises the indent level in thread local storage. The trace object that is to be used for output The PSTraceSourceOptions that is causing the scope object to be created. This format string is used to determine the general output format for the scope. For instance, TraceMethod would probably provide a formatter similar to "Entering: {0}: {1}" where {0} is the name of the method and {1} is the additional formatted info provided. The format string used to determine the general output format for the scope when the Dispose method is called. The name of the scope that is being traced The format of any additional arguments which will be appended to the line of trace output Arguments to the format string. Helper for the ScopeTracer constructor The flag that caused this line of tracing to be traced. This format string is used to determine the general output format for the scope. For instance, TraceMethod would probably provide a formatter similar to "Entering: {0}: {1}" where {0} is the name of the method and {1} is the additional formatted info provided. The format string used to determine the general output format for the scope when the Dispose method is called. The name of the scope being entered The format of any additional arguments which will be appended to the "Entering" line of trace output Arguments to the format string. Decrements the indent level in thread local storage and then traces the scope name. The trace object that is used for any output The flag which caused this scope object to be created. Stores the scope name that is passed to the constructor. Stores the format string used when formatting output when leaving the scope This attribute is placed on the field of the PSTraceSource class in the class that is consuming the tracing methods defined in this file. It defines the trace category and description for that instance of PSTraceSource. This attribute is only allowed on fields and there can only be one for each instance. Only one instance of this attribute should be used in any one class. In order for the attribute to be used to help in constructing the PSTraceSource object, reflection is used to find the field that the PSTraceSource object will be assigned to. This attribute declares the category and description for the PSTraceSource object in that field. Having multiple instances of this attribute on multiple fields in the same class will cause unexpected results. For instance, trace output for one category may actually be considered part of another category. Constructor for the TraceSourceAttribute class. The name of the category for which the TraceSource instance will be used. A description for the category. The category to be used for the TraceSource The description for the category to be used for the TraceSource The category to be used for the TraceSource The description for the category to be used for the TraceSource This derived class of TraceSource is required so that we can tell the configuration infrastructure which attributes are supported in the XML app-config file for our trace source. Tells the config infrastructure which attributes are supported for our TraceSource A string array with the names of the attributes supported by our trace source. Verbs that are commonly used in cmdlet names. These verbs are recommended over their synonyms when used as the verb name for cmdlets. Synonyms: Add to, append or attach. Remove all the elements or content of a container Change the state of a resource to make it inaccessible, unavailable, or unusable Copy a resource to another name or another container Enters a context Exits a context Search for an object Formats an object for output. Get the contents/object/children/properties/relations/... of a resource Remove from visibility Lock a resource. Move a resource Create a new resource Change the state of a resource to make it accessible, available, or usable Increases the effectiveness of a resource To set as the current context, including the ability to reverse this action To restore a context saved by a Push operation Remove a resource from a container Give a resource a new name Set/reset the contents/object/properties/relations... of a resource Changes the size of a resource Set the contents/object/properties/relations... of a resource Get a reference to a resource or summary information about a resource by looking in a specified collection. Does not actually retrieve that resource. Makes visible, or displays information. Combines get, format, and out verbs. Pass from one resource or point to another while disregarding or omitting intervening resources or points Move to the next point or resource Join - to unite so as to form one unit Act on a resource again. Split an object into portions. parts or fragments To take as a choice from among several; pick out Reverse an action or process. Unlock a resource. Continually inspect a resource for changes Verbs that are commonly used in cmdlet names when the cmdlet manipulates data. These verbs are recommended over their synonyms when used as the verb name for cmdlets. backup Establish a well defined state to be able to roll back to Compare this resource with another one and produce a set of differences Reduce in size Change from one encoding to another or from one unit base to another (e.g. feet to meters) Convert from the format named in the noun to a general-purpose format (e.g. string or int). Convert from a general-purpose format (e.g. string or int) to the format named in the noun. Performs an in-place modification of a resource. Uncompress or increase in size Make a copy of a set of resources using an interchange format Arrange or associate one or more resources Create a set of resources using an interchange format Prepare a resource for use. Assign a beginning value to something Limit the consumption of a resource or apply a constraint on a resource Take multiple instances and create a single instance Make known and accessible to another Rollback state to a predefined snapshot/checkpoint Store state in a permanent location Coerce one or more resources to the same state Remove from public access and visibility Update a resource with new elements or refresh from a source of truth To mount - to attache a named entity to a hierarchy at the pathname location. To set in position. To dismount - to get off. To detach. Out - direct to a port. Output something to a port. Verbs that are commonly used in cmdlet names when the cmdlet manipulates the lifecycle of something. These verbs are recommended over their synonyms when used as the verb name for cmdlets. Agree to the status of a resource or process State or affirm the state of an object Finalize an interruptable activity. Makes pending changes permanent. Acknowledge, verify, or validate the state of a resource Refuse, object, block, or oppose the state of a resource or process Stop and/or configure something to be unavailable (e.g unable to not start again) Configure to be available (e.g. able to start) Settle in an indicated place or condition (optionally initializing for use) Calls or launches an activity that cannot be stopped Record details about an item in a public store or publishing location Ask for a resource or permissions Terminate existing activity and begin it again (with the same configuration) Begin an activity again after it was suspended Begin an activity Discontinue or cease an activity Present a resource for approval Suspend an activity temporarily Remove or disassociate Remove details of an item from a public store or publishing location Suspend execution until an expected event Verbs that are commonly used in cmdlet names when the cmdlet is used to diagnose the health of something. These verbs are recommended over their synonyms when used as the verb name for cmdlets. Interatively interact with a resource or activity for the purpose finding a flaw or better understanding of what is occurring. calculate/identify resources consumed by a specified operation or retrieve statistics about a resource Determine whether a resource is alive and responding to requests Detect and correct problems Map a shorthand name will be bound to a longname Verify the operational validity or consistency of a resource Trace activities performed by a specified operation Verbs that are commonly used in cmdlet names when the cmdlet is used to communicate with something. These verbs are recommended over their synonyms when used as the verb name for cmdlets. Convey by an intermediary to a destination Take or acquire from a source Associate subsequent activies with a resource Disassociate from a resource TO write - communicate or express. Display data. To read - to obtain (data) from a storage medium or port Verbs that are commonly used in cmdlet names when the cmdlet is used to secure a resource. These verbs are recommended over their synonyms when used as the verb name for cmdlets. Gives access to a resource. Removes access to a resource. Guard a resource from attack or loss Remove guards from a resource that prevent it from attack or loss Prevent access to or usage of a resource. Allow access to or usage of a resource. Canonical verbs that don't fit into any of the other categories. To use or include a resource. To set as the context of an action. Exception with a full stack trace excluding the last two frames calls the base class with message and sets the stack frame repassed to the base class returns the stack trace set in the constructor the constructor's stackTrace This class contain the few methods necessary for the basic assertion use. All methods are public and static. The class cannot derive from the sealed System.Diagnostics.Debug The class was also made sealed. Diagnostics.Assert(x >= 0,"A negative x would have caused early return."); This class only has statics, so we shouldn't need to instantiate any object. Basic assertion with logical condition and message logical condtion that should be true for program to proceed Message to explain why condition should always be true Basic assertion with logical condition, message and detailed message logical condtion that should be true for program to proceed Message to explain why condition should always be true Additional information about the assertion If set to true will prevent the assertion dialog from showing up by throwing an exception instead of calling Debug.Assert false for dialog, true for exception Class that encapsulates native crypto provider handles and provides a mechanism for resources released by them This safehandle instance "owns" the handle, hence base(true) is being called. When safehandle is no longer in use it will call this class's ReleaseHandle method which will release the resources Release the crypto handle held by this instance true on success, false otherwise Class the encapsulates native crypto key handles and provides a mechanism to release resources used by it This safehandle instance "owns" the handle, hence base(true) is being called. When safehandle is no longer in use it will call this class's ReleaseHandle method which will release the resources Release the crypto handle held by this instance true on success, false otherwise Equivalent of IntPtr.Zero for the safe crypt key This class provides the wrapper for all Native CAPI functions Do not use persisted private key Mark the key for export Automatically assign a salt value when creating a session key RSA Provider RSA Provider that supports AES encryption Public key to be used for encryption RSA Key Create a key for encryption Create a RSA key pair Option for exporting public key blob Option for exporting a session key AES 256 symmetric key ALG_CLASS_DATA_ENCRYPT ALG_TYPE_BLOCK ALG_SID_AES_256 -> 16 CALG_AES_128 -> (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_AES_128) ALG_SID_AES_128 -> 14 Return Type: BOOL->int hProv: HCRYPTPROV->ULONG_PTR->unsigned int Algid: ALG_ID->unsigned int dwFlags: DWORD->unsigned int phKey: HCRYPTKEY* Return Type: BOOL->int hKey: HCRYPTKEY->ULONG_PTR->unsigned int Return Type: BOOL->int phProv: HCRYPTPROV* szContainer: LPCWSTR->WCHAR* szProvider: LPCWSTR->WCHAR* dwProvType: DWORD->unsigned int dwFlags: DWORD->unsigned int Return Type: BOOL->int hProv: HCRYPTPROV->ULONG_PTR->unsigned int dwFlags: DWORD->unsigned int Return Type: BOOL->int hKey: HCRYPTKEY->ULONG_PTR->unsigned int hHash: HCRYPTHASH->ULONG_PTR->unsigned int Final: BOOL->int dwFlags: DWORD->unsigned int pbData: BYTE* pdwDataLen: DWORD* dwBufLen: DWORD->unsigned int Return Type: BOOL->int hKey: HCRYPTKEY->ULONG_PTR->unsigned int hHash: HCRYPTHASH->ULONG_PTR->unsigned int Final: BOOL->int dwFlags: DWORD->unsigned int pbData: BYTE* pdwDataLen: DWORD* Return Type: BOOL->int hKey: HCRYPTKEY->ULONG_PTR->unsigned int hExpKey: HCRYPTKEY->ULONG_PTR->unsigned int dwBlobType: DWORD->unsigned int dwFlags: DWORD->unsigned int pbData: BYTE* pdwDataLen: DWORD* Return Type: BOOL->int hProv: HCRYPTPROV->ULONG_PTR->unsigned int pbData: BYTE* dwDataLen: DWORD->unsigned int hPubKey: HCRYPTKEY->ULONG_PTR->unsigned int dwFlags: DWORD->unsigned int phKey: HCRYPTKEY* Return Type: BOOL->int hKey: HCRYPTKEY->ULONG_PTR->unsigned int pdwReserved: DWORD* dwFlags: DWORD->unsigned int phKey: HCRYPTKEY* Return Type: DWORD->unsigned int Defines a custom exception which is thrown when a native CAPI call results in an error This exception is currently internal as it's not surfaced to the user. However, if we decide to surface errors to the user when something fails on the remote end, then this can be turned public Default constructor Constructor that will be used from within CryptoUtils error code returned by native crypto application error message associated with this failure Constructor with just message but no inner exception error message associated with this failure Constructor with inner exception error message innter exception This constructor is currently not called explicitly from crypto utils Constructor which has type specific serialization logic serialization info context in which this constructor is called Currently no custom type-specific serialization logic is implemented Returns base implementation serialization info context Error code returned by the native CAPI call One of the issues with RSACryptoServiceProvider is that it never uses CRYPT_VERIFYCONTEXT to create ephemeral keys. This class is a facade written on top of native CAPI APIs to create ephemeral keys. Private constructor indicates if this service provider is operating in server mode Get the public key as a base64 encoded string public key as base64 encoded string Generates an AEX-256 sessin key if one is not already generated 1. Generate a AES-256 session key 2. Encrypt the session key with the Imported RSA public key 3. Encode result above as base 64 string and export session key encrypted with receivers public key and encoded as a base 64 string Import a public key into the provider whose context has been obtained base64 encoded public key to import Import a session key from the remote side into the current CSP encrypted session key as a base64 encoded string Encrypt the specified byte array data to encrypt encrypted byte array Decrypt the specified buffer data to decrypt decrypted buffer Generates key pair in a thread safe manner the first time when required Returns a crypto service provider for use in the client. This will reuse the key that has been generated crypto service provider for the client side Returns a crypto service provider for use in the server. This will not generate a key pair crypto service provider for the server side Checks the status of a call, if it had resulted in an error then obtains the last error, wraps it in an exception and throws the same value to examine Dipose resources Destructor Indicates if a key exchange is complete and this provider can encrypt Helper for exchanging keys and encrypting/decrypting secure strings for serialization in remoting Crypto provider which will be used for importing remote public key as well as generating a session key, exporting it and performing symmetric key operations using the session key Key exchange has been completed and both keys available Object for synchronizing key exchange Core logic to encrypt a string. Assumes session key is already generated secure string to be encrypted Core logic to decrypt a secure string. Assumes session key is already available encrypted string to be decrypted Encrypt a secure string secure string to encrypt encrypted string This method zeroes out all interim buffers used Decrypt a string and construct a secure string from its contents encrypted string secure string object This method zeroes out any interim buffers used Resets the wait for key exchange Represents the session to be used for requesting public key Helper for exchanging keys and encrypting/decrypting secure strings for serialization in remoting This is the instance of runspace pool data structure handler to use for negotiations Creates the encryption provider, but generates no key. The key will be imported later Imports a public key from its base64 encoded string representation public key in its string representation true on success Gets a helper with a test session helper for testing To be used only for testing Represents the session to be used for requesting public key Helper for exchanging keys and encrypting/decrypting secure strings for serialization in remoting This is the instance of runspace pool data structure handler to use for negotiations Creates the encryption provider, but generates no key. The key will be imported later Export the public key as a base64 encoded string on execution will contain the public key as string true on success Gets a helper with a test session helper for testing To be used only for testing Represents the session to be used for requesting public key Registered??? TODO/FIXME Returns the deepest frame. exception with stack trace to analyze maximum length of the returned string frame string Returns the deepest frame belonging to powershell. exception with stack trace to analyze maximum length of the returned string frame string Some failure HRESULTs map to well-defined exceptions, while others do not map to a defined exception. If the HRESULT maps to a defined exception, ThrowExceptionForHR creates an instance of the exception and throws it. Otherwise, it creates an instance of System.Runtime.InteropServices.COMException, initializes the error code field with the HRESULT, and throws that exception. When this method is invoked, it attemps to retrieve extra information regarding the error by using the unmanaged GetErrorInfo function. You are trying to access the MainModule property for a process that is running on a remote computer. This property is available only for processes that are running on the local computer. The process Id is not available (or) The process has exited. For the mapping from each HRESULT to its comparable exception class in the .NET Framework, see "How to: Map HRESULTs and Exceptions"->http://msdn.microsoft.com/en-us/library/9ztbc5s1.aspx. For additional information about GetErrorInfo, see the MSDN library. Some failure HRESULTs map to well-defined exceptions, while others do not map to a defined exception. If the HRESULT maps to a defined exception, ThrowExceptionForHR creates an instance of the exception and throws it. Otherwise, it creates an instance of System.Runtime.InteropServices.COMException, initializes the error code field with the HRESULT, and throws that exception. When this method is invoked, it attemps to retrieve extra information regarding the error by using the unmanaged GetErrorInfo function. Submits a Dr. Watson (aka Windows Error Reporting / WER) crash report and then terminates the process. Unhandled exception causing the crash Some failure HRESULTs map to well-defined exceptions, while others do not map to a defined exception. If the HRESULT maps to a defined exception, ThrowExceptionForHR creates an instance of the exception and throws it. Otherwise, it creates an instance of System.Runtime.InteropServices.COMException, initializes the error code field with the HRESULT, and throws that exception. When this method is invoked, it attemps to retrieve extra information regarding the error by using the unmanaged GetErrorInfo function. Equivalent to "System.Environment.FailFast(string, System.Exception)" that also does custom Watson reports. This method suppresses all the exceptions as this is not important for any functionality. This feature is primarily used to help Microsoft fix bugs/crashes from customer data. exception causing the failure. It is good to make sure this is not null. However the code will handle null cases. Sets everything up to report unhandled exceptions. This method suppresses all the exceptions as this is not important for any functionality. This feature is primarily used to help Microsoft fix bugs/crashes from customer data. If true, then reports are not going to require any user interaction Writes a default type of memory dump to the specified file. file to write the dump to Writes a memory dump to the specified file. file to write the dump to type of the dump Copied from \\shindex\winmain\sdpublic\sdk\inc\werapi.h If the report is being queued, do not include a heap dump. Using this flag saves disk space. Copied from \\shindex\winmain\sdpublic\sdk\inc\werapi.h Copied from \\shindex\winmain\sdpublic\sdk\inc\werapi.h (with adapted names) Copied from \\shindex\winmain\sdpublic\sdk\inc\werapi.h Identifies the type of information that will be written to the minidump file by the MiniDumpWriteDump function More info: http://msdn.microsoft.com/en-us/library/ms680519(VS.85).aspx http://www.debuginfo.com/articles/effminidumps.html The consent status. Copied from \\shindex\winmain\sdpublic\sdk\inc\werapi.h Used in . Copied from \\shindex\winmain\sdpublic\sdk\inc\werapi.h Honor any recovery registration for the application. For more information, see RegisterApplicationRecoveryCallback. Honor any restart registration for the application. For more information, see RegisterApplicationRestart. Add the report to the WER queue without notifying the user. The report is queued only—reporting (sending the report to Microsoft) occurs later based on the user's consent level. Show the debug button. Add the data registered by WerSetFlags, WerRegisterFile, and WerRegisterMemoryBlock to the report. Spawn another process to submit the report. The calling thread is blocked until the function returns. Do not display the close dialog box for the critical report. Do not queue the report. If there is adequate user consent the report is sent to Microsoft immediately; otherwise, the report is discarded. You may use this flag for non-critical reports. The report is discarded for any action that would require the report to be queued. For example, if the computer is offline when you submit the report, the report is discarded. Also, if there is insufficient consent (for example, consent was required for the data portion of the report), the report is discarded. Do not archive the report. The initial UI is minimized and flashing. Spawn another process to submit the report and return from this function call immediately. Note that the contents of the pSubmitResult parameter are undefined and there is no way to query when the reporting completes or the completion status. Used in . Copied from \\shindex\winmain\sdpublic\sdk\inc\werapi.h The report was queued. The report was uploaded. The Debug button was clicked. The report submission failed. Error reporting was disabled. The report was canceled. Queuing was disabled. The report was asynchronous. The fault reporting settings. Used in . Copied from \\shindex\winmain\sdpublic\sdk\inc\werapi.h Do not add heap dumps for reports for the process Queue critical reports for this process Do not suspend the process before error reporting Queue critical reports for this process and upload from the queue Wraps HREPORT value returned by Contains information used by the WerReportCreate function. http://msdn.microsoft.com/en-us/library/bb513637(VS.85).aspx The size of this structure, in bytes. A handle to the process for which the report is being generated. If this member is NULL, this is the calling process. The name used to look up consent settings. If this member is empty, the default is the name specified by the pwzEventType parameter of WerReportCreate. The display name. If this member is empty, the default is the name specified by pwzEventType parameter of WerReportCreate. The name of the application. If this parameter is empty, the default is the base name of the image file. The full path to the application. A description of the problem. This description is displayed in Problem Reports and Solutions. A handle to the parent window. Creates a problem report that describes an application event. A pointer to a Unicode string that specifies the name of the event. To register an event that can be used by your application, see About Windows Error Reporting for Software. The type of report. A handle to the report. If the function fails, this handle is NULL. hresult Sets the parameters that uniquely identify an event. http://msdn.microsoft.com/en-us/library/bb513626(VS.85).aspx A handle to the report. This handle is returned by the function. The identifier of the parameter to be set. A pointer to a Unicode string that contains the name of the event. If this parameter is NULL, the default name is Px, where x matches the integer portion of the value specified in dwparamID. The parameter value hresult Adds a dump of the specified type to the specified report. http://msdn.microsoft.com/en-us/library/bb513622(VS.85).aspx A handle to the report. This handle is returned by the function. A handle to the process for which the report is being generated. This handle must have the STANDARD_RIGHTS_READ and PROCESS_QUERY_INFORMATION access rights. Optional. A handle to the thread of hProcess for which the report is being generated. If dumpType is WerDumpTypeMicro, this parameter is required. The type of minidump. Optional. A pointer to a WER_EXCEPTION_INFORMATION structure that specifies exception information. Optional. Specifies custom minidump options. If this parameter is null, the standard minidump information is collected. Submits the specified report. A handle to the report. This handle is returned by the WerReportCreate function. The consent status. The result of the submission. hresult Closes the specified report (to be used only from SafeHandle class). http://msdn.microsoft.com/en-us/library/bb513624(VS.85).aspx Handle returned by hresult Sets the fault reporting settings for the current process. The fault reporting settings. hresult Writes user-mode minidump information to the specified file. A handle to the process for which the information is to be generated. The identifier of the process for which the information is to be generated. A handle to the file in which the information is to be written. The type of dump to be generated. A pointer to a MINIDUMP_EXCEPTION_INFORMATION structure describing the client exception that caused the minidump to be generated. If the value of this parameter is NULL, no exception information is included in the minidump file. A pointer to a MINIDUMP_USER_STREAM_INFORMATION structure. If the value of this parameter is NULL, no user-defined information is included in the minidump file. A pointer to a MINIDUMP_CALLBACK_INFORMATION structure that specifies a callback routine which is to receive extended minidump information. If the value of this parameter is NULL, no callbacks are performed. Defines enumerations for event ids add an entry for a new event that you add to the manifest. Set it to the same value that was set in the manifest None. (Should not be used) HostNameResolve SchemeResolve ShellResolve RunspaceConstructor RunspacePoolConstructor RunspacePoolOpen OperationalTransferEventRunspacePool RunspacePort AppName ComputerName Scheme TestAnalytic WSManConnectionInfoDump AnalyticTransferEventRunspacePool TransportReceivedObject AppDomainUnhandledExceptionAnalytic TransportErrorAnalytic AppDomainUnhandledException TransportError WSManCreateShell WSManCreateShellCallbackReceived WSManCloseShell WSManCloseShellCallbackReceived WSManSendShellInputExtended WSManSendShellInputExCallbackReceived WSManReceiveShellOutputExtended WSManReceiveShellOutputExCallbackReceived WSManCreateCommand WSManCreateCommandCallbackReceived WSManCloseCommand WSManCloseCommandCallbackReceived WSManSignal WSManSignalCallbackReceived UriRedirection ServerSendData ServerCreateRemoteSession ReportContext ReportOperationComplete ServerCreateCommandSession ServerStopCommand ServerReceivedData ServerClientReceiveRequest ServerCloseOperation LoadingPSCustomShellAssembly LoadingPSCustomShellType ReceivedRemotingFragment SentRemotingFragment WSManPluginShutdown SerializerWorkflowLoadSuccess SerializerWorkflowLoadFailure SerializerDepthOverride SerializerModeOverride SerializerScriptPropertyWithoutRunspace SerializerPropertyGetterFailed SerializerEnumerationFailed SerializerToStringFailed SerializerMaxDepthWhenSerializing SerializerXmlExceptionWhenDeserializing SerializerSpecificPropertyMissing PerformanceTrackConsoleStartupStart PerformanceTrackConsoleStartupStop ErrorRecord Exception PoweShellObject Job Writing a simple trace message from code Trace the WSManConnectionInfo used for this connection Writing a simple trace message from code with 2 strings Writing a simple trace message from code with 2 strings Defines enumerations for channels None (No channel selected, should not be used) Operational Channel Analytic Channel Debug Channel Define enumerations for levels LogAlways Critical Error Warning Informational Verbose Debug Defines enumerations for op codes None. (Should not be used) Open Close Connect Disconnect Negotiate Create Constructor Dispose EventHandler Exception Method Send Receive WorkflowLoad SerializationSettings WinInfo WinStart WinStop WinDCStart WinDCStop WinExtension WinReply WinResume WinSuspend Defines Tasks None CreateRunspace ExecuteCommand Serialization PowerShellConsoleStartup Defines Keywords. None Runspace Pipeline Protocol Transport Host Cmdlets Serializer Session ManagedPlugIn BaseChannelWriter is the abstract base class defines event specific methods that are used to write a trace. The default implementation does not write any message to any trace channel Dispose method TraceError TraceWarning TraceInformational TraceVerbose TraceDebug TraceLogAlways TraceCritical NullWriter is the implementation of BaseChannelWriter. This implementation does not write to any trace logs. This class is singleton and exposes its only instance through the static Instance property. Static Instance property ChannelWrite is the concrete implementation of IChannelWrite. It writes all the traces to the specified traceChannel. TraceChannel is specified in the constructor. It always uses PowerShell event provider Id. Dispose method TraceError TraceWarning TraceInformational TraceVerbose TraceDebug TraceLogAlways TraceCritical TraceSource class gives access to the actual TraceWriter channels. Three channels are pre-defined 1) Debug 2) Analytic and 3) Operations This class also has strongly types methods that are used for easy tracing. Consturctor Dispose method. TraceErrorRecord TraceException TracePowerShellObject TraceJob Writes operational scheduled job start message. Writes operational scheduled job completed message. Writes operational scheduled job error message. Keywords that were set through constructor when object was instantiated Task that was set through constructor Gives access to Debug channel writer Gives access to analytical channel writer Gives access to operational channel writer TraceSourceFactory will return an instance of TraceSource every time GetTraceSource method is called. Returns an instance of BaseChannelWriter. If the Etw is not supported by the platform it will return NullWriter.Instance A Task and a set of Keywords can be specified in the GetTraceSource method (See overloads). The supplied task and keywords are used to pass to the Etw provider in case they are not defined in the manifest file. Returns an instance of BaseChannelWriter. If the Etw is not supported by the platform it will return NullWriter.Instance A Task and a set of Keywords can be specified in the GetTraceSource method (See overloads). The supplied task and keywords are used to pass to the Etw provider in case they are not defined in the manifest file. Returns an instance of BaseChannelWriter. If the Etw is not supported by the platform it will return NullWriter.Instance A Task and a set of Keywords can be specified in the GetTraceSource method (See overloads). The supplied task and keywords are used to pass to the Etw provider in case they are not defined in the manifest file. Attribute to represent an EtwEvent Constructor EventId Delegates that defines a call back with no parameter Delegates that defines a call back with one parameter (state) Delegates that defines a call back with two parameters; state and ElapsedEventArgs. It will be used in System.Timers.Timer scenarios. ETW events argument class Creates a new instance of EtwEventArgs class. Event descriptor Indicate whether the event is sucessfully written Event payload Gets Event descriptor Gets whether the event is sucessfully written Gets payload in the event This the abstract base class of all activity classes that represent an end-to-end scenario. Sets the activityId provided in the current thread. If current thread already has the same activityId it does nothing. true when provided activity was set, false if current activity was found to be same and set was not needed Creates a new ActivityId that can be used to set in the thread's context. Returns the ActivityId set in current thread Constructor CorrelateWithActivity (EventId: 0x1f05/7941) This method also sets a new activity id in current thread. And then correlates the new id with parentActivityId Checks whether a provider matching certain levels and keyword is enabled Levels to check Keywords to check True, if any ETW listener is enabled else false Correlates parent activity id set in the thread with a new activity id If parent activity id is not, it just sets a new activity in the current thread. And does not write the Transfer event Wraps a callback with no params Wraps a callback with one object param Wraps a AsyncCallback with IAsyncResult param Wraps a callback with one object param and one ElapsedEventArgs object This is menat to be used in System.Timers.Timer scenarios. This is the main method that write the messages to the trace. All derived classes must use this method to write to the provider log. EventDescriptor payload Event handler for the class IsEnabled The provider where the tracing messages will be written to. The event that is defined to be used to log transfer event. The derived class must override this property if they don't want to use the PowerShell's transfer event. This is a helper class that is used to wrap many multi-threading scenarios and makes correlation event to be logged easily. parantActivityId EtwCorrelator Constructor EtwCorrelator Constructor EtwCorrelator Constructor EtwCorrelator Constructor Correlate This is the wrapper on the actual callback This is the wrapper on the actual callback This is the wrapper on the actual callback This is the wrapper on the actual callback Provides interop access to creating, querying and setting the current activity identifier The indicating the type of operation to perform. The activity id to set or retrieve. Zero on success. Gets the ActivityId from thread local storage. Sets the ActivityId in the thread local storage. Creates a new activity id Sets the activity id in thread local storage and returns the previous value. Creates a new activity id, sets thread local storage, and returns the previous value. An object that can be used to revert the ETW activity ID of the current thread to its original value. Reverts the ETW activity ID of the current thread to its original value. Calling has the same effect as calling this method and is useful in the C# "using" syntax. An object that can be used to manage the ETW activity ID of the current thread. Creates and sets a new activity ID for the current thread, optionally correlating the new activity with another activity. The ID of an existing activity to be correlated with the new activity or if correlation is not desired. An object which can be used to revert the activity ID of the current thread once the new activity yields control of the current thread. Creates and sets a new activity ID for the current thread. If the current thread has an existing activity ID, it will be correlated with the new activity ID. An object which can be used to revert the activity ID of the current thread once the new activity yields control of the current thread. Gets or sets the ETW activity ID of the current thread. This method should only be used for advanced scenarios or diagnostics. Prefer using or instead. A simple implementation of . Creates an . The to use when logging transfer events during activity correlation. The to use when logging transfer events during activity correlation. Implements . Implements . Implements . ETW logging API Class constructor Provider interface function for logging health event Provider interface function for logging engine lifecycle event Provider interface function for logging command health event Provider interface function for logging command lifecycle event Provider interface function for logging pipeline execution detail. Provider interface function for logging provider health event Provider interface function for logging provider lifecycle event Provider interface function for logging settings event Logs information to the operational channel Logs Verbose to the operational channel Logs error message to the analytic channel Logs warning message to the analytic channel Logs remoting fragment data to verbose channel. Logs verbose message to the analytic channel Logs informational message to the analytic channel Logs error message to operation channel. Logs error message to the operational channel Writes a transfer event mapping current activity id with a related activity id This function writes a transfer event for both the operational and analytic channels Writes a transfer event ETW log provider implementation Class constructor Determines whether any session is requesting the specified event from the provider. Typically, a provider does not call this method to determine whether a session requested the specified event; the provider simply writes the event, and ETW determines whether the event is logged to a session. A provider may want to call this function if the provider needs to perform extra work to generate the event. In this case, calling this function first to determine if a session requested the event or not, may save resources and time. Provider interface function for logging health event Provider interface function for logging engine lifecycle event Provider interface function for logging command health event Provider interface function for logging command lifecycle event Provider interface function for logging pipeline execution detail. Provider interface function for logging provider health event Provider interface function for logging provider lifecycle event Provider interface function for logging settings event The ETW provider does not use logging variables Gets PSLogUserData from execution context Appends exception information string builder exception Appends additional information string builder additional information Gets PSLevel from severity error severity PS log level Converts log context to string log context string representation Writes a single event event id log context Writes an event Writes an activity transfer event Tracer Tracer Critical level Error level Warning level Informational level Verbose level Keyword all Static constructor Constructor WriteTransferEvent (EventId: 0x1f05/7941) DebugMessage (EventId: 0xc000/49152) AbortingWorkflowExecution (EventId: 0xb038/45112) ActivityExecutionFinished (EventId: 0xb03f/45119) ActivityExecutionQueued (EventId: 0xb017/45079) ActivityExecutionStarted (EventId: 0xb018/45080) BeginContainerParentJobExecution (EventId: 0xb50c/46348) BeginCreateNewJob (EventId: 0xb503/46339) BeginJobLogic (EventId: 0xb506/46342) BeginProxyChildJobEventHandler (EventId: 0xb512/46354) BeginProxyJobEventHandler (EventId: 0xb510/46352) BeginProxyJobExecution (EventId: 0xb50e/46350) BeginRunGarbageCollection (EventId: 0xb514/46356) BeginStartWorkflowApplication (EventId: 0xb501/46337) BeginWorkflowExecution (EventId: 0xb508/46344) CancellingWorkflowExecution (EventId: 0xb037/45111) ChildWorkflowJobAddition (EventId: 0xb50a/46346) EndContainerParentJobExecution (EventId: 0xb50d/46349) EndCreateNewJob (EventId: 0xb504/46340) EndJobLogic (EventId: 0xb507/46343) EndpointDisabled (EventId: 0xb044/45124) EndpointEnabled (EventId: 0xb045/45125) EndpointModified (EventId: 0xb042/45122) EndpointRegistered (EventId: 0xb041/45121) EndpointUnregistered (EventId: 0xb043/45123) EndProxyChildJobEventHandler (EventId: 0xb513/46355) EndProxyJobEventHandler (EventId: 0xb511/46353) EndProxyJobExecution (EventId: 0xb50f/46351) EndRunGarbageCollection (EventId: 0xb515/46357) EndStartWorkflowApplication (EventId: 0xb502/46338) EndWorkflowExecution (EventId: 0xb509/46345) ErrorImportingWorkflowFromXaml (EventId: 0xb01b/45083) ForcedWorkflowShutdownError (EventId: 0xb03c/45116) ForcedWorkflowShutdownFinished (EventId: 0xb03b/45115) ForcedWorkflowShutdownStarted (EventId: 0xb03a/45114) ImportedWorkflowFromXaml (EventId: 0xb01a/45082) ImportingWorkflowFromXaml (EventId: 0xb019/45081) JobCreationComplete (EventId: 0xb032/45106) JobError (EventId: 0xb02e/45102) JobRemoved (EventId: 0xb033/45107) JobRemoveError (EventId: 0xb034/45108) JobStateChanged (EventId: 0xb02d/45101) LoadingWorkflowForExecution (EventId: 0xb035/45109) OutOfProcessRunspaceStarted (EventId: 0xb046/45126) ParameterSplattingWasPerformed (EventId: 0xb047/45127) ParentJobCreated (EventId: 0xb031/45105) PersistenceStoreMaxSizeReached (EventId: 0xb516/46358) PersistingWorkflow (EventId: 0xb03d/45117) ProxyJobRemoteJobAssociation (EventId: 0xb50b/46347) RemoveJobStarted (EventId: 0xb02c/45100) RunspaceAvailabilityChanged (EventId: 0xb022/45090) RunspaceStateChanged (EventId: 0xb023/45091) TrackingGuidContainerParentJobCorrelation (EventId: 0xb505/46341) UnloadingWorkflow (EventId: 0xb039/45113) WorkflowActivityExecutionFailed (EventId: 0xb021/45089) WorkflowActivityValidated (EventId: 0xb01f/45087) WorkflowActivityValidationFailed (EventId: 0xb020/45088) WorkflowCleanupPerformed (EventId: 0xb028/45096) WorkflowDeletedFromDisk (EventId: 0xb02a/45098) WorkflowEngineStarted (EventId: 0xb048/45128) WorkflowExecutionAborted (EventId: 0xb027/45095) WorkflowExecutionCancelled (EventId: 0xb026/45094) WorkflowExecutionError (EventId: 0xb040/45120) WorkflowExecutionFinished (EventId: 0xb036/45110) WorkflowExecutionStarted (EventId: 0xb008/45064) WorkflowJobCreated (EventId: 0xb030/45104) WorkflowLoadedForExecution (EventId: 0xb024/45092) WorkflowLoadedFromDisk (EventId: 0xb029/45097) WorkflowManagerCheckpoint (EventId: 0xb049/45129) WorkflowPersisted (EventId: 0xb03e/45118) WorkflowPluginRequestedToShutdown (EventId: 0xb010/45072) WorkflowPluginRestarted (EventId: 0xb011/45073) WorkflowPluginStarted (EventId: 0xb007/45063) WorkflowQuotaViolated (EventId: 0xb013/45075) WorkflowResumed (EventId: 0xb014/45076) WorkflowResuming (EventId: 0xb012/45074) WorkflowRunspacePoolCreated (EventId: 0xb016/45078) WorkflowStateChanged (EventId: 0xb009/45065) WorkflowUnloaded (EventId: 0xb025/45093) WorkflowValidationError (EventId: 0xb01e/45086) WorkflowValidationFinished (EventId: 0xb01d/45085) WorkflowValidationStarted (EventId: 0xb01c/45084) DebugMessage Converts exception object into a string. Provider Guid Transfer Event An abstract class that forms the base class for any Counter Set type. A Counter Set Instance is required to register a given performance counter category with PSPerfCountersMgr. An instance of counterSetRegistrarBase type encapsulates all the information about a counter set and its associated counters. Dictionary mapping counter name to id. Dictionary mapping counter id to counter type. Constructor Method that retrieves the target counter id. NOTE: If isNumerator is true, then input counter id is returned. But, if isNumerator is false, then a check is made on the input counter's type to ensure that denominator is indeed value for such a counter. If isNumerator is true, then updates the numerator component of target counter 'counterId' by a value given by 'stepAmount'. Otherwise, updates the denominator component by 'stepAmount'. If isNumerator is true, then updates the numerator component of target counter 'counterName' by a value given by 'stepAmount'. Otherwise, updaqtes the denominator component by 'stepAmount'. If isNumerator is true, then sets the numerator component of target counter 'counterId' to 'counterValue'. Otherwise, sets the denominator component to 'counterValue'. If isNumerator is true, then sets the numerator component of target Counter 'counterName' to 'counterValue'. Otherwise, sets the denominator component to 'counterValue'. This method retrieves the counter value associated with counter 'counterId' based on isNumerator parameter. This method retrieves the counter value associated with counter 'counterName' based on isNumerator parameter. An abstract method that will be implemented by the derived type so as to dispose the appropriate counter set instance. PSCounterSetInstance is a thin wrapper on System.Diagnostics.PerformanceData.CounterSetInstance Constructor for creating an instance of PSCounterSetInstance This destructor will run only if the Dispose method does not get called. It gives the base class opportunity to finalize. Dispose(bool disposing) executes in two distinct scenarios. If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. If disposing equals false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. Dispose Method implementation for IDisposable interface. If isNumerator is true, then updates the numerator component of target counter 'counterId' by a value given by 'stepAmount'. Otherwise, updates the denominator component by 'stepAmount'. If isNumerator is true, then updates the numerator component of target counter 'counterName' by a value given by 'stepAmount'. Otherwise, updates the denominator component by 'stepAmount'. If isNumerator is true, then sets the numerator component of target counter 'counterId' to 'counterValue'. Otherwise, sets the denominator component to 'counterValue'. If isNumerator is true, then updates the numerator component of target counter 'counterName' by a value given by 'counterValue'. Otherwise, sets the denominator component to 'counterValue'. This method retrieves the counter value associated with counter 'counterId' based on isNumerator parameter. This method retrieves the counter value associated with counter 'counterName' based on isNumerator parameter. A struct that encapuslates the information pertaining to a given counter like name,type and id. Counter Name Counter Id Counter Type Constructor Constructor Getter for Counter Name property Getter for Counter Id property. Getter for Counter Type property. An abstract class that forms the base class for any CounterSetRegistrar type. Any client that needs to register a new type of perf counter category with the PSPerfCountersMgr, should create an instance of CounterSetRegistrarBase's derived non-abstract type. The created instance is then passed to PSPerfCounterMgr's AddCounterSetInstance() method. A reference to the encapsulated counter set instance. Method that creates an instance of the CounterSetInstanceBase's derived type. This method is invoked by the PSPerfCountersMgr to retrieve the appropriate instance of CounterSet to register with its internal datastructure. Constructor that creates an instance of CounterSetRegistrarBase derived type based on Provider Id, counterSetId, counterSetInstanceType, a collection with counters information and an optional counterSetName. Copy constructor Method that disposes the referenced instance of the CounterSetInstanceBase's derived type. This method is invoked by the PSPerfCountersMgr to dispose the appropriate instance of CounterSet from its internal datastructure as part of PSPerfCountersMgr cleanup procedure. Getter method for ProviderId property Getter method for CounterSetId property Getter method for CounterSetName property Getter method for CounterSetInstanceType property Getter method for array of counters information property Getter method that returns an instance of the CounterSetInstanceBase's derived type PSCounterSetRegistrar implements the abstract methods of CounterSetRegistrarBase. Any client that needs to register a new type of perf counter category with the PSPerfCountersMgr, should create an instance of PSCounterSetRegistrar. The created instance is then passed to PSPerfCounterMgr's AddCounterSetInstance() method. Constructor that creates an instance of PSCounterSetRegistrar. Copy Constructor Method that creates an instance of the CounterSetInstanceBase's derived type. Method that disposes the referenced instance of the CounterSetInstanceBase's derived type. Powershell Performance Counters Manager class shall provide a mechanism for components using SYstem.Management.Automation assembly to register performance counters with Performance Counters susbsystem. Destructor which will trigger the cleanup of internal data structures and disposal of counter set instances. Helper method to generate an instance name for a counter set. Method to determine whether the counter set given by 'counterSetName' is registered with the system. If true, then counterSetId is populated. Method to determine whether the counter set given by 'counterSetId' is registered with the system. If true, then CounterSetInstance is populated. Method to register a counter set with the Performance Counters Manager. If IsNumerator is true, then updates the numerator component of target counter 'counterId' in Counter Set 'counterSetId' by 'stepAmount'. Otherwise, updates the denominator component by 'stepAmount'. If IsNumerator is true, then updates the numerator component of target counter 'counterName' in Counter Set 'counterSetId' by 'stepAmount'. Otherwise, updates the denominator component by 'stepAmount'. If IsNumerator is true, then updates the numerator component of target counter 'counterId' in Counter Set 'counterSetName' by 'stepAmount'. Otherwise, updates the denominator component by 'stepAmount'. If IsNumerator is true, then updates the numerator component of target counter 'counterName' in Counter Set 'counterSetName' by 'stepAmount'. Otherwise, updates the denominator component by 'stepAmount'. If IsNumerator is true, then sets the numerator component of target counter 'counterId' in Counter Set 'counterSetId' to 'counterValue'. Otherwise, updates the denominator component to 'counterValue'. If IsNumerator is true, then sets the numerator component of target counter 'counterName' in Counter Set 'counterSetId' to 'counterValue'. Otherwise, updates the denominator component to 'counterValue'. If IsNumerator is true, then sets the numerator component of target counter 'counterId' in Counter Set 'counterSetName' to 'counterValue'. Otherwise, updates the denominator component to 'counterValue'. If IsNumerator is true, then sets the numerator component of target counter 'counterName' in Counter Set 'counterSetName' to 'counterValue'. Otherwise, updates the denominator component to 'counterValue'. NOTE: This method is provided solely for testing purposes. Getter method to retrieve the singleton instance of the PSPerfCountersMgr. The status of a PowerShell transaction. The transaction has been rolled back The transaction has been committed The transaction is currently active Represents an active transaction Initializes a new instance of the PSTransaction class Initializes a new instance of the PSTransaction class using a CommittableTransaction Activates the transaction held by this PSTransaction Commits the transaction held by this PSTransaction Rolls back the transaction held by this PSTransaction Destructor for the PSTransaction class Disposes the PSTransaction object. Disposes the PSTransaction object, which disposes the underlying transaction. Whether to actually dispose the object. Gets the rollback preference for this transaction Gets the number of subscribers to this transaction Returns the status of this transaction. Determines whether this PSTransaction has been rolled back or not. Determines whether this PSTransaction has been committed or not. Supports the transaction management infrastructure for the PowerShell engine Initializes a new instance of the PSTransactionManager class Destructor for the PSTransactionManager class Disposes the PSTransactionContext object. Disposes the PSTransactionContext object, which resets the active PSTransaction. Whether to actually dispose the object. The severity of error that causes PowerShell to automatically rollback the transaction. Non-terminating errors or worse Terminating errors or worse Do not rollback the transaction on error Supports the transaction management infrastructure for the PowerShell engine Initializes a new instance of the PSTransactionManager class Called by engine APIs to ensure they are protected from ambient transactions. Called by the transaction manager to enable engine protection the first time a transaction is activated. Engine protection APIs remain protected from this point on. Creates a new Transaction if none are active. Otherwise, increments the subscriber count for the active transaction. Creates a new Transaction if none are active. Otherwise, increments the subscriber count for the active transaction. Creates a new Transaction that should be managed idependently of any parent transactions. Creates a new Transaction that should be managed idependently of any parent transactions. Completes the current transaction. If only one subscriber is active, this commits the transaction. Otherwise, it reduces the subscriber count by one. Aborts the current transaction, no matter how many subscribers are part of it. Aborts the current transaction, no matter how many subscribers are part of it. Sets the base transaction; any transactions created thereafter will be nested to this instance Removes the transaction added by SetBaseTransaction Returns the current engine transaction Activates the current transaction, both in the engine, and in the Ambient. Deactivates the current transaction in the engine, and restores the ambient transaction. Destructor for the PSTransactionManager class Disposes the PSTransactionManager object. Disposes the PSTransactionContext object, which resets the active PSTransaction. Whether to actually dispose the object. Gets the rollback preference for the active transaction Determines if you have a transaction that you can set active and work on. Determines if the last transaction has been committed. Determines if the last transaction has been rolled back. Represents a a string that can be used in transactions. Constructor for the TransactedString class. Constructor for the TransactedString class. The initial value of the transacted string. Make the transacted changes permanent. Discard the transacted changes. Discard the transacted changes. Append text to the transacted string. The text to append. Remove text from the transacted string. The position in the string from which to start removing. The length of text to remove. Gets the System.String that represents the transacted transacted string. If this is called within the transaction, it returns the transacted value. Otherwise, it returns the original value. Gets the length of the transacted string. If this is called within the transaction, it returns the length of the transacted value. Otherwise, it returns the length of the original value. class containing miscellaneous helpers to deal with PSObject manipulation WriteError adds a note property called WriteErrorStream to the error record wrapped in an PSObject and set its value to true. When F and O detects this note exists and its value is set to true, WriteErrorLine will be used to emit the error; otherwise, F and O actions are regular. Checks for WriteWarningStream property on object, indicating that it is a warning stream. Used by F and O. Checks for WriteVerboseStream property on object, indicating that it is a verbose stream. Used by F and O. Checks for WriteDebugStream property on object, indicating that it is a debug stream. Used by F and O. Retrieve the display name. It looks for a well known property and, if not found, it uses some heuristics to get a "close" match shell object to process expression factory to create MshExpression resolved MshExpression; null if no match was found it gets the display name value shell object to process expression factory to create MshExpression MshExpressionResult if successful; null otherwise This is necessary only to consider IDictionaries as IEnumerables, since LanguagePrimitives.GetEnumerable does not. object to extract the IEnumerable from helper to convert an PSObject into a string It takes into account eumerations (use display name) shell object to process expression factory to create MshExpression limit on IEnumerable enumeration stores errors during string conversion string representation format an object using a provided format string directive format directive object to use object to format limit on IEnumerable enumeration formatting error object, if present expression factory to create MshExpression string representation helper to retrieve the default property set of a shell object shell object to process resolved expression; empty list if not found helper to retrieve the value of an MshExpression and to format it shell object to process limit on IEnumerable enumeration expression to use for retrieval format directive to use for formatting expression factory to create MshExpression not null if an error condition arose formatted string Queries PSObject and determines if ComputerName property should be shown. helper class to create MshExpression's from format.ps1xml data structures create an expression from an expression token expression token to use constructed expression create an expression from an expression token expression token to use The context from which the file was loaded constructed expression class to hold results NOTE: we should make it an PSObject eventually constructor expression constructor expression true if no further attempts should be made to resolve wildcards constructor base exception to be used for all the exceptions that this framework will generate exception thrown by the loader when the maximum number of errors is exceeded error count that triggered the exception entry logged by the loader and made available to external consumers type of information being logged path of the file the info refers to XPath location inside the file message to be displayed to the user indicate whether we fail to load the file due to the security reason logger object used by the loader (class XmlLoaderBase) to write log entries. It logs to a memory buffer and (optionally) to a text file log an entry entry to log IDisposable implementation This method calls GC.SuppressFinalize if true, log entries to memory list of entries logged if saveInMemory is true true if we ever logged an error base class providing XML loading basic functionality (stack management and logging facilities) NOTE: you need to implement to load an actual XML document and traverse it as see fit IDisposable implementation This method calls GC.SuppressFinalize to be called when starting a stack frame. The returned IDisposable should be used in a using(){...} block node to push on the stack object to dispose when exiting the frame to be called when starting a stack frame. The returned IDisposable should be used in a using(){...} block node to push on the stack index of the node of the same name in a collection object to dispose when exiting the frame called by the Dispose code of the XmlLoaderStackFrame object to pop a frame off the stack helper to compare node names, e.g. "foo" in it uses case sensitive, culture invariant compare. This is because XML tags are case sensitive. XmlNode whose name is to compare string to compare the node name to if true, accept the presence of attributes on the node true if there is a match For tracing purposes only, don't add to log trace message, non-localized string is OK. Report error when loading formatting data from object model get the list of logg entries list of entries logged during a load check if there were errors true of the log entry list has errors file system path for the file we are loading from class representing a stack frame for the XML document tree traversal IDisposable implementation back pointer to the loader, used to pop a stack frame node the stack frame refers to node index for enumerations, valid only if != -1 NOTE: this allows to express the XPath construct "foo[0]" process core only, ignore IEumerable process IEnumerable, ignore core process both core and IEnumerable, core first cache for resource strings in format.ps1xml string to display in the formatted display (e.g. cell in a table) when the evaluation of an MshExpression fails string to display in the formatted display (e.g. cell in a table) when a format operation on a value fails if true, display error messages if true, display an error string in the formatted display (e.g. cell in a table) optional expression for conditional binding item associated with this frame definition frame info assocated with this frame definition left indentation for a frame is relative to the parent frame. it must be a value >=0 right indentation for a frame is relative to the parent frame. it must be a value >=0 it can have the following values: 0 : ignore greater than 0 : it represents the indentation for the first line (i.e. "first line indent"). The first line will be indented by the indicated number of characters. less than 0 : it represents the hanging of the first line WRT the following ones (i.e. "first line hanging"). optional expression for conditional binding an inline control or a reference to a control definition root class for all the control types Returns a Shallow Copy of the current object. reference to a control name of the control we refer to, it cannot be null type of the control we refer to, it cannot be null base class for all control definitions NOTE: this is an extensibility point, if a new control needs to be created, it has to be derived from this class RULE: valid only for table and wide only class to hold a definition of a control name of the control we define, it cannot be null body of the control we define, it cannot be null expression to be used to select the grouping an inline control or a reference to a control definition alternative (and simpified) representation for the control RULE: if the control object is null, use this one container for control definitions list of control definitions definition of a view the name of this view. Must not be null applicability of the view. Mandatory optional grouping directive container for optional local formatting directives main control for the view (e.g. reference to a control or a control body RULE: only valid for list and complex base class for all the "shape"-Directive classes in line definition of a complex control default list entry definition It's mandatory optional list of list entry definition overrides. It can be empty if there are no overrides applicability clause Only valid if not the default definition item associated with this entry definition list of tokens the item can contain in line definition of a list control default list entry definition It's mandatory optional list of list entry definition overrides. It can be empty if there are no overrides definition of the data to be displayed in a list entry applicability clause Only valid if not the default definition mandatory list of list view items. It cannot be empty Returns a Shallow Copy of the current object. cell definition inside a row optional expression for conditional binding optional label If not present, use the name of the property from the matching mandatory item description format directive body telling how to format the cell RULE: the body can only contain * TextToken * PropertyToken * NOTHING (provide an empty cell) Defines a list control Defines a control for the formatting types defined by PowerShell Overridden ToString() method "ListControl" Indicates if this control does not have any script blocks and is safe to export true if exportable, false otherwise Initiate an instance of ListControl Public constructor for ListControl Entrie in this list control Defines one entry in a list control Initiate an instance of ListControlEntry Public constructor for ListControlEntry Public constructor for ListControlEntry List of items in the entry List of typenames which select this entry Defines one row in a list control entry Public constructor for ListControlEntryItem Lable and Entry could be null Gets the label for this List Control Entry Item If nothing is specified, then it uses the property name Display entry in line definition of a format string control alignment values NOTE: we do not use an enum because this will have to be serialized and ERS/serialization do not support enumerations definition of a table control optional, if not present, use data off the default table row definition default row definition It's mandatory optional list of row definition overrides. It can be empty if there are no overrides information about the table header NOTE: if an instance of this class is present, the list must not be empty if true, direct the outputter to suppress table header printing mandatory list of column header definitions Returns a Shallow Copy of the current object. optional label If not present, use the name of the property from the matching mandatory row description general alignment for the column If not present, either use the one from the row definition or the data driven heuristics width of the column definition of the data to be displayed in a table row applicability clause Only valid if not the default definition if true, the current table row should be allowed to wrap to multiple lines, else truncated mandatory list of column items. It cannot be empty Returns a Shallow Copy of the current object. cell definition inside a row optional aligment to override the default one at the header level format directive body telling how to format the cell RULE: the body can only contain * TextToken * PropertyToken * NOTHING (provide an empty cell) Defines the header for a particular column in a table control Public constructor for TableControlColumnHeader. Could be null if no label to specify The Value should be non-negative The default value is Alignment.Undefined Label for the column Alignment of the string within the column Width of the column - in number of display cells Defines a particular column within a row in a table control Returns the value of the entry Public constructor for TableControlColumn. Alignment of the particular column Display Entry Defines a single row in a table control Public constructor for TableControlRow Public constructor for TableControlRow. Collection of column definitions for this row Defines a table control Public default constructor for TableControl Overridden ToString() method "TableControl" Writes a table control to an XML stream XML writer to write to whether to export script blocks Determines if this object is safe to be written true if safe, false otherwise public constructor for TableControl that only takes 'tableControlRows'. public constructor for TableControl that takes both 'tableControlRows' and 'tableControlColumnHeaders'. Collection of column header definitions for this table control Collection of row definitions for this table control Defines a formatting view for a particular type Overloaded ToString() method - specifies name and type of control. Used for display from the console Public constructor for FormatViewDefinition Name of the formatting view as defined in the formatting file The control defined by this formatting view can be one of table,list or wide instance id of the original view this will be used to distinguish two views with the same name and control types Specifies additional type definitions for an object Overloaded to string method for better display Constructor for the ExtendedTypeDefinition Initiate an instance of ExtendedTypeDefinition with the type name Typename The formatting view definition for the specified type Specifies possible alignment enumerations for display cells not defined left of the cell, contents will trail with a ... if exceeded - ex "Display..." center of the cell right of the cell, contents will lead with a ... if exceeded - ex "...456" Specifies the type of entry value The value is a property. Look for a property with the specified name The value is a scriptblock. Evaluate the script block and fill the entry with the result One entry in a format display unit Public constructor for DisplayEntry writes this value to the specified XML writer stream XML writer to write to true - to export script blocks overriden for display purposes returns the value Returns the type of this value Returns the value as a string in line definition of a wide control number of columns to use for wide display general alignment for the whole view If not present, either use the one from the row definition or the data driven heuristics default wide entry definition It's mandatory optional list of list entry definition overrides. It can be empty if there are no overrides definition of the data to be displayed in a list entry applicability clause Only valid if not the default definition format directive body telling how to format the cell RULE: the body can only contain * TextToken * PropertyToken * NOTHING (provide an empty cell) Defines a list control Overridden ToString() method "ListControl" Indicates if this control does not have any script blocks and is safe to export true if exportable, false otherwise Default constructor for WideControl Public constructor for WideControl Public constructor for WideControl Initiate an instance with columns Entrie in this list control Alignment of this wide control Number of columns in the control Defines one item in a wide control entry Public constructor for WideControlEntryItem. Public constructor for WideControlEntryItem. Display entry Selected by typenames Get a reference to an assembly object by looking up the currently loaded assemblies the string resource reference object containing the name of the assembly to load true if assembly was found in the GAC. NOTE: the current implementation always return FALSE helper class to resolve an assembly name to an assembly reference The class caches previous results for faster lookup resolve the assembly name against the set of loaded assemblies This exception is used by Formattable constructor to indicate errors occured during construction time. This is the default constructor. This constructor takes a localized error message. A localized error message. This constructor takes a localized message and an inner exception. Localized error message. Inner exception. This constructor takes a colletion of errors occurred during construction time. The errors that occured This constructor is required by serialization. Serializes the exception data. serialization information streaming context Set the default ErrorRecord. The specific Formattable load errors. A class that keeps the information from format.ps1xml files in a cache table Default Constructor Constructor that creates a FormatTable from a set of format files. Format files to load for format information. 1. Path {0} is not fully qualified. Specify a fully qualified type file path. 1. There were errors loading Formattable. Look in the Errors property to get detailed error messages. Append the formatData to the list of formatting configurations, and update the entire formatting database. The formatData is of type 'ExtendedTypeDefinition'. It defines the View configuration including TableControl, ListControl, and WideControl. 1. There were errors loading Formattable. Look in the Errors property to get detailed error messages. Prepend the formatData to the list of formatting configurations, and update the entire formatting database. The formatData is of type 'ExtendedTypeDefinition'. It defines the View configuration including TableControl, ListControl, and WideControl. 1. There were errors loading Formattable. Look in the Errors property to get detailed error messages. Constructor that creates a FormatTable from a set of format files. Format files to load for format information. Authorization manager to perform signature checks before reading ps1xml files (or null of no checks are needed) Host passed to . Can be null if no interactive questions should be asked. 1. Path {0} is not fully qualified. Specify a fully qualified type file path. 1. There were errors loading Formattable. Look in the Errors property to get detailed error messages. Adds the to the current FormatTable's file list. The FormatTable will not reflect the change until Update is called. if true, is prepended to the current FormatTable's file list. if false, it will be appended. Removes the from the current FormatTable's file list. The FormatTable will not reflect the change until Update is called. Returns a format table instance with all default format files loaded class to manage the database instances, do the reloading, etc. instance of the object holding the format.ps1xml in memory database If set to true, disables any updates to format table. This includes disabling format table updates throught Update-FormatData, Import-Module etc. All the disabling happens silently ie., the user will not get any exception. By default, this is set to False. Authorization manager to perform signature checks before reading ps1xml files (or null of no checks are needed) Host passed to . Can be null if no interactive questions should be asked. 1. FormatFile is not rooted. 1. There were errors loading Formattable. Look in the Errors property to get detailed error messages. Adds the to the current FormatTable's file list. The FormatTable will not reflect the change until Update is called. if true, is prepended to the current FormatTable's file list. if false, it will be appended. Removes the from the current FormatTable's file list. The FormatTable will not reflect the change until Update is called. Update a shared formatting database with formatData of 'ExtendedTypeDefinition' type. This method should only be called from the FormatTable, where are shared formatting database is created. The format data to update the database Specify the order in which the format data will be loaded Update the current formattable with the existing formatFileList. New files might have been added using Add() or Files might have been removed using Remove. Authorization manager to perform signature checks before reading ps1xml files (or null of no checks are needed) Host passed to . Can be null if no interactive questions should be asked. Update the format data database. If there is any error in loading the format xml files, the old database is unchanged. The reference returned should NOT be modified by any means by the caller files to be loaded and errors to be updated Authorization manager to perform signature checks before reading ps1xml files (or null of no checks are needed) Host passed to . Can be null if no interactive questions should be asked. True if the format data has been pre-validated (build time, manual testing, etc) so that validation can be skipped at runtime. database instance load the database NOTE: need to be protected by lock since not thread safe per se *.formal.xml files to be loaded expression factory to validate script blocks if true, load the database even if there are loading errors Authorization manager to perform signature checks before reading ps1xml files (or null of no checks are needed) Host passed to . Can be null if no interactive questions should be asked. True if the format data has been pre-validated (build time, manual testing, etc) so that validation can be skipped at runtime. Trace and error logs from loading the format Xml files. true if we had a successful load it loads a database from file(s). *.formal.xml files to be loaded expression factory to validate script blocks Authorization manager to perform signature checks before reading ps1xml files (or null of no checks are needed) Host passed to . Can be null if no interactive questions should be asked. True if the format data has been pre-validated (build time, manual testing, etc) so that validation can be skipped at runtime. list of logger entries (errors, etc.) to return to the caller true if no error occurred a database instance loaded from file(s) helper to to add any pre-load intrinsics to the db db being iniitalized helper to to add any post-load intrinsics to the db db being iniitalized helper object holding a generic object and the related "applies to" object. It is used in by the inheritance based type match algorithm algorithm to execute a type match on a list of entities having an "applies to" associated object given an appliesTo list, it finds all the types that are contained (following type group references) database to use object to lookup class to load the XML document into data structures. It encapsulates the file format specific code class to load the XML document into data structures. It encapsulates the file format specific code class to load the XML document into data structures. It encapsulates the file format specific code class to load the XML document into data structures. It encapsulates the file format specific code class to load the XML document into data structures. It encapsulates the file format specific code class to load the XML document into data structures. It encapsulates the file format specific code entry point for the loader algorithm information needed to load the file database instance to load the file into expression factory to validate script blocks Authorization manager to perform signature checks before reading ps1xml files (or null of no checks are needed) Host passed to . Can be null if no interactive questions should be asked. True if the format data has been pre-validated (build time, manual testing, etc) so that validation can be skipped at runtime. true if successful entry point for the loader algorithm to load formatting data from ExtendedTypeDefinition the ExtendedTypeDefinition instance to load formatting data from database instance to load the formatting data into expression factory to validate the script block load the content of the XML document into the data instance. It assumes that the XML document has been successfully loaded XML document to load from, cannot be null instance of the databaseto load into load teh content of the ExtendedTypeDefinition instance into the db. Only support following view controls: TableControl ListControl WideControl ExtendedTypeDefinition instances to load from, cannot be null instance of the database to load into Load the view into a ViewDefinition the TypeName tag under SelectedBy tag Load the TableControl to ControlBase. Load the headers defined for columns Load row enties, set the defaultDefinition of the TableControlBody. Load the column items into the TableRowDefinition Load the expression information from DisplayEntry Load EntrySelectedBy (TypeName) into AppliesTo Load LoisControl into the ListControlBody Load ListEntry into ListControlEntryDefinition Load ListItems into ListControlItemDefinition Load the WideControl into the WideContolBody Load WideEntries Load WideEntry into WieControlEntryDefinition helper to verify the text of a string block and log an error if an exception is thrown script block string to verify true if parsed correctly, false if failed table of XML node tags used in the file format table of miscellanea string constant values for XML nodes helper class to wrap the loading of a script block/property name alternative tag helper class to wrap the loading of an expression (using ExpressionNodeMatch) plus the formatting string and an alternative text node Provides a set of possible completions for given input. The input to complete The index of the cursor in the input Optional options to configure how completion is performed Ast for pre-parsed input Tokens for pre-parsed input Optional options to configure how completion is performed Invokes the script function TabExpansion2. For legacy support, TabExpansion2 will indirectly call TabExpansion if it exists. The input script to complete The offset in where completion is requested Optional parameter that specifies configurable options for completion. The powershell to use to invoke the script function TabExpansion2 A collection of completions with the replacement start and length. Invokes the script function TabExpansion2. For legacy support, TabExpansion2 will indirectly call TabExpansion if it exists. The ast for pre-parsed input Optional options to configure how completion is performed The powershell to use to invoke the script function TabExpansion2 Get the next result, moving forward or backward. Supports wraparound, so if there are any results at all, this method will never fail and never return null. True if we should move forward through the list, false if backwards. The next completion result, or null if no results. Current index in . Returns the starting replacement index from the original input. Returns the length of the text to replace from the original input. Gets all the completion results. PSv2CompletionCompleter implements the algorithm we use to complete cmdlet/file names in PowerShell v2. This class exists for legacy purpose only. It is used only in a remote interactive session from Win8 to Win7. V3 and forward uses completely different completers. The implementation of file name completion is completely different on V2 and V3 for remote scenarios. On PSv3, the CompletionResults are generated always on the target machine, and Used when remoting from a win8 machine to a win7 machine Used when remoting from a win8 machine to a win7 machine. Complete command names. LastWordFinder implements the algorithm we use to search for the last word in a line of input taken from the console. This class exists for legacy purposes only - V3 and forward uses a slightly different interface. Locates the last "word" in a string of text. A word is a conguous sequence of characters that are not whitespace, or a contiguous set grouped by single or double quotes. Can be called by at most 1 thread at a time per LastWordFinder instance. Receives the character index (from the front of the string) of the starting point of the located word, or 0 if the word starts at the beginning of the sentence. Receives the quote character that would be needed to end the sentence with a balanced pair of quotes. For instance, if sentence is "foo then " is returned, if sentence if "foo" then nothing is resturned, if sentence is 'foo then ' is returned, if sentence is 'foo' then nothing is returned. The last word located, or the empty string if no word could be found. Check if we should complete file names for "switch -file" Complete file name as command Contains the pseudo commands that only work in the script workflow. Get the parameter completion results when the pseudo binding was successful Get the parameter completion results by using the given valid parameter sets and available parameters Get completion results for operators that start with The starting text of the operator to complete A list of completion results Get the argument completion results when the pseudo binding was not successful Get the argument completion results when the pseudo binding was successful Get the positional argument completion results based on the position it's in the command line Process a parameter to get the argument completion results If the argument completion falls into these pre-defined cases: 1. The matching parameter is of type Enum 2. The matching parameter is of type SwitchParameter 3. The matching parameter is declared with ValidateSetAttribute 4. Falls into the native command argument completion a null instance of CompletionResult is added to the end of the "result" list, to indicate that this particular argument completion has been processed already. If the "result" list is still empty, we will not go through the default argument completion steps anymore. Find the positional argument at the specific position from the parsed argument list If the command line after the [tab] will not be truncated, the return value could be non-null: Get-Cmdlet [tab] abc If the command line after the [tab] is truncated, the return value will always be null Find the location where 'tab' is typed based on the line and colum. the argument that is right before the 'tab' location the number of positional arguments before the 'tab' location Find the location where 'tab' is typed based on the expressionAst. Complete a typename Turn on the "LiteralPaths" option. Indicate whether the "LiteralPaths" option needs to be removed after operation Return whether we need to add ampersand when it's necessary This class is very similar to the restricted langauge checker, but it is meant to allow more things, yet still be considered "safe", at least in the sense that tab completion can rely on it to not do bad things. The primary use is for intellisense where you don't want to run arbitrary code, but you do want to know the values of various expressions so you can get the members. Auxilliary class to the execution of commands as needed by CommandCompletion Converts an object to a string safely... The object to convert The result of the conversion... Converts an object to a string adn, if the string is not empty, adds it to the list The list to update The object to convert to a string... Possible types of CompletionResults An unknown result type, kept as text only A history result type like the items out of get-history A command result type like the items out of get-command A provider item A provider container A property result type like the property items out of get-member A method result type like the method items out of get-member A parameter name result type like the Parameters property out of get-command items A parameter value result type A variable result type like the items out of get-childitem variable: A namespace A type name Class used to store a tab completion or Intellisense result Text to be used as the auto completion result Text to be displayed in a list The text for the tooltip with details to be displayed about the object Type of completion result Private member for null instance Initializes a new instance of the CompletionResult class the text to be used as the auto completion result he text to be displayed in a list the type of completion result the text for the tooltip with details to be displayed about the object Initializes a new instance of this class internally if the result out of TabExpansion is a string completion text An null instance of CompletionResult. This can be used in argument completion, to indicate that the completion attempt has gone through the native command argument completion methods. Gets the text to be used as the auto completion result Gets the text to be displayed in a list Gets the type of completion result Gets the text for the tooltip with details to be displayed about the object Gets the null instance of type CompletionResult The types for AstParameterArgumentPair The base class for parameter argument pair The parameter Ast The argument type Indicate if the parameter is specified Indicate if the parameter is specified The parameter name The parameter text The argument type Represent a parameter argument pair. The argument is a pipeline input object Represent a parameter argument pair. The argument is an array of ExpressionAst (remaining arguments) Get the argument Represent a parameter argument pair. The argument is a fake object. Represent a parameter argument pair. The parameter is a switch parameter. Get the argument Represent a parameter argument pair. It could be a pure argument (no parameter, only argument available); it could be a CommandParameterAst that contains its argument; it also could be a CommandParameterAst with another CommandParameterAst as the argument. Indicate if the argument is contained in the CommandParameterAst Indicate if the argument is of type CommandParameterAst Get the argument The pseudo binding succeeded The pseudo binding failed with parameter set confliction Get the parameter binding metadata Indicate the type of the piped-in argument The CommandParameterAst the cursor is pointing at Indicate if the pseudo binding is for argument completion. Different positioanl binding algorithms are used for parameter completion and argument completion Initialize collection/dictionary members when it's necessary Parse the arguments to process switch parameters and parameters without a value specified. We always eat the error (such as parameter without value) and continue to do the binding. For parameter completion, if the cursor is pointing at a CommandParameterAst, we should not try exact matching for that CommandParameterAst. This is to handle the following case: Add-Computer -domain(tab) Add-Computer has an alias "Domain" that can exactly match this partial input, but since the user is typing 'tab', the partial input 'domain' should not be considered as an exact match. In this case, we don't try exact matching when calling GetMatchingParameter(..) so as to preserve other possibilities. Information about invocation of a method in an object model wrapped by an instance of Creates a new instance of MethodInvocationInfo Name of the method to invoke Method parameters Return value of the method (ok to pass null if the method doesn't return anything) Name of the method to invoke Method parameters Return value of the method. Can be null if the method doesn't return anything. Describes how to handle the method parameter. Bind value of a method parameter based on arguments of a cmdlet parameter Method invocation is expected to set the value of the method parameter. Cmdlet should emit the value of method parameter to the downstream pipe. Method invocation is expected to set the value of the method parameter. Cmdlet should emit a non-terminating error when the value evaluates to $true. Parameter of a method in an object model wrapped by Name of the method parameter Type of the parameter (as seen in the PowerShell layer on the client) Contents of the ETS type attribute in the CDXML file (or null if that attribute was not specified). The expectation is that the CmdletAdapter will stamp this value onto PSTypeNames of emitted objects. Bindings of the method parameter (in/out/error) Value of the argument of the method parameter Whether the value is 1) an explicit default (*) or 2) has been bound from cmdlet parameter (*) explicit default = whatever was in DefaultValue attribute in Cmdletization XML Collection of method parameters and their arguments used to invoke a method in an object model wrapped by Creates an empty collection of method parameters Gets key for a method parameter Describes whether to report errors when a given filter doesnt match any objects Default behavior is to be consistent with the built-in cmdlets: - When a wildcard is specified, then no errors are reported (i.e. Get-Process -Name noSuchProcess*) - When no wildcard is specified, then errors are reported (i.e. Get-Process -Name noSuchProcess) Note that the following conventions are adpoted: - Min/max queries ( and ) are treated as wildcards - Exclusions () are treated as wildcards - Associations () are treated as not a wildcard ReportErrors forces reporting of errors that in other circumstances would be reported if no objects matched the filters SilentlyContinue suppresses errors that in other circumstances would be reported if no objects matched the filters QueryBuilder supports building of object model queries in an object-model-agnostic way Modifies the query, so that it only returns objects with a given property value Property name to query on Property values to accept in the query true if should be treated as a containing a wildcard pattern; false otherwise Describes how to handle filters that didn't match any objects Modifies the query, so that it does not return objects with a given property value Property name to query on Property values to reject in the query true if should be treated as a containing a wildcard pattern; false otherwise Describes how to handle filters that didn't match any objects Modifies the query, so that it returns only objects that have a property value greater than or equal to a threshold Property name to query on Minimum property value Describes how to handle filters that didn't match any objects Modifies the query, so that it returns only objects that have a property value less than or equal to a threshold Property name to query on Maximum property value Describes how to handle filters that didn't match any objects Modifies the query, so that it returns only objects associated with object that query results have to be associated with name of the association name of the role that has in the association name of the role that query results have in the association Describes how to handle filters that didn't match any objects Sets a query option ObjectModelWrapper integrates OM-specific operations into generic cmdletization framework. For example - CimCmdletAdapter knows how to invoke a static method "Foo" in the CIM OM. Type that represents instances of objects from the wrapped object model Class constructor When overridden in the derived class, creates a query builder for a given object model Query builder for a given object model Queries for object instances in the object model. Query parameters A lazy evaluated collection of object instances When overridden in the derived class, performs initialization of cmdlet execution. Default implementation in the base class just returns. When overridden in the derived class, performs cleanup after cmdlet execution. Default implementation in the base class just returns. When overridden in the derived class, interrupts currently running code within the . Default implementation in the base class just returns. The PowerShell engine will call this method on a separate thread from the pipeline thread where BeginProcessing, EndProcessing and other methods are normally being executed. Invokes an instance method in the object model. The object on which to invoke the method Method invocation details true if successful method invocations should emit downstream the being operated on Combines and . Query parameters Method invocation details true if successful method invocations should emit downstream the object instance being operated on Invokes a static method in the object model. Method invocation details Cmdlet that this ObjectModelWrapper is associated with. Name of the class (from the object model handled by this ObjectModelWrapper) that is wrapped by the currently executing cmdlet Name of the class (from the object model handled by this ObjectModelWrapper) that is wrapped by the currently executing cmdlet. This value can be null (i.e. when ClassVersion attribute is omitted in the ps1xml) Module version Private data from Cmdlet Definition XML (from <ObjectModelWrapperPrivateData> element) Translates a into a like-operand for WQL. Documentation on MSDN (http://msdn.microsoft.com/en-us/library/aa392263(VS.85).aspx) is 1) rather slim / incomplete 2) sometimes incorrect (i.e. says that '=' is used for character ranges, when it should have said '-') The code below is therefore mainly based on reverse engineering of admin\wmi\wbem\winmgmt\wbecomn\like.cpp Converts into a value of a right-hand-side operand of LIKE operator of a WQL query. Return value still has to be string-escaped (i.e. by doubling '\'' character), before embedding it into a query. Adapter that deals with CimInstance objects. Implementing the PropertyOnlyAdapter for the time being as CimInstanceTypeAdapter currently supports only properties. If method support is needed in future, this should derive from Adapter class. The Adapter registration is done in monad\src\singleshell\installer\MshManagementMshSnapin.cs A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Do you want to run software from this untrusted publisher?. Looks up a localized string similar to File {0} is published by {1} and is not trusted on your system. Only run scripts from trusted publishers.. Looks up a localized string similar to Software {0} is published by an unknown publisher. It is recommended that you do not run this software.. Looks up a localized string similar to Cannot sign code. The specified certificate is not suitable for code signing.. Looks up a localized string similar to &Always run. Looks up a localized string similar to Run the script from this publisher now, and do not prompt me to run this script in the future.. Looks up a localized string similar to &Do not run. Looks up a localized string similar to Do not run the script from this publisher now, and continue to prompt me to run this script in the future.. Looks up a localized string similar to Ne&ver run. Looks up a localized string similar to Do not run the script from this publisher now, and do not prompt me to run this script in future. Future attempts to run this script will result in a silent failure.. Looks up a localized string similar to &Run once. Looks up a localized string similar to Run the script from this publisher now, and continue to prompt me to run this script in the future.. Looks up a localized string similar to &Suspend. Looks up a localized string similar to Pause the current pipeline and return to the command prompt. Type exit to resume operation when you are done.. Looks up a localized string similar to Cannot sign code. The hash algorithm is not supported.. Looks up a localized string similar to File {0} cannot be loaded because its operation is blocked by software restriction policies. For more information, contact your system administrator.. Looks up a localized string similar to File {0} cannot be loaded because you have elected to not run this software now.. Looks up a localized string similar to File {0} cannot be loaded because its content could not be read.. Looks up a localized string similar to File {0} cannot be loaded because you have elected to never run software from this publisher.. Looks up a localized string similar to File {0} is published by {1}. This publisher is explicitly untrusted on your system. The script will not run on the system. Please see "get-help about_signing" for more details.. Looks up a localized string similar to File {0} cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at http://go.microsoft.com/fwlink/?LinkID=135170.. Looks up a localized string similar to File {0} cannot be loaded. {1}.. Looks up a localized string similar to Security warning. Looks up a localized string similar to Run only scripts that you trust. While scripts from the internet can be useful, this script can potentially harm your computer. Do you want to run {0}?. Looks up a localized string similar to Cannot sign code. The TimeStamp server URL must be fully qualified in the form of http://<server url>. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Cannot process argument because the value of argument "{0}" is not valid. Change the value of the "{0}" argument and run the operation again.. Looks up a localized string similar to Cannot process argument because the value of argument "{0}" is null. Change the value of argument "{0}" to a non-null value.. Looks up a localized string similar to Cannot process argument because the value of argument "{0}" is out of range. Change argument "{0}" to a value that is within range.. Looks up a localized string similar to The script block cannot be converted because it contains more than one clause. Expressions or control structures are not permitted. Make sure the script block contains exactly one pipeline or command.. Looks up a localized string similar to The script block cannot be converted to a Windows PowerShell object because it contains forbidden redirection operators.. Looks up a localized string similar to Can only convert a script block that contains exactly one pipeline or command. Expressions or control structures are not permitted. Make sure the script block contains exactly one pipeline or command.. Looks up a localized string similar to Cannot convert an empty script block. Make sure the script block contains exactly one pipeline or command. Looks up a localized string similar to Cannot generate a Windows PowerShell object for a ScriptBlock that starts a pipeline with an expression.. Looks up a localized string similar to The script block cannot be converted to an open generic type. Please define an appropriate closed generic type and retry.. Looks up a localized string similar to Cannot generate a Windows PowerShell object for a ScriptBlock that does not have an associated operation context.. Looks up a localized string similar to Cannot convert a script block with a top-level trap statement.. Looks up a localized string similar to Cannot generate a Windows PowerShell object for a ScriptBlock which invokes pipelines, commands or functions to evaluate arguments of the main pipeline.. Looks up a localized string similar to Cannot generate a Windows PowerShell object for a ScriptBlock that uses dot sourcing.. Looks up a localized string similar to Cannot generate a Windows PowerShell object for a ScriptBlock that invokes other script blocks.. Looks up a localized string similar to Cannot generate a Windows PowerShell object for a ScriptBlock that tries to pass other script blocks inside argument values.. Looks up a localized string similar to Cannot generate a Windows PowerShell object for a ScriptBlock dereferencing variables undeclared in the param(...) block. Name of undeclared variable: {0}.. Looks up a localized string similar to Cannot get the value of the Using expression '{0}' in the specified variable dictionary. When creating a PowerShell instance from a script block, the Using expression cannot contain an indexing operation or member-accessing operation.. Looks up a localized string similar to Cannot create workflow. The type '{0}' from the '{1}' module could not be loaded.. Looks up a localized string similar to Object "{0}" is the wrong type to return from the dynamicparam block. The dynamicparam block must return either $null or an object with type [System.Management.Automation.RuntimeDefinedParameterDictionary]. Looks up a localized string similar to Command halted by user.. Looks up a localized string similar to Cannot perform operation because operation "{0}" is not valid. Remove operation "{0}", or investigate why it is not valid.. Looks up a localized string similar to Cannot perform operation because operation "{0}" is not implemented.. Looks up a localized string similar to Cannot perform operation because operation "{0}" is not supported.. Looks up a localized string similar to Cannot perform operation because object "{0}" has already been disposed.. Looks up a localized string similar to The script block cannot be invoked because it contains more than one clause. The Invoke() method can only be used on script blocks containing a single clause.. Looks up a localized string similar to The value of the using variable '$using:{0}' cannot be retrieved because it has not been set in the local session.. Looks up a localized string similar to The Using variable is not supported in the script function or filter.. Looks up a localized string similar to Windows PowerShell Workflow is not supported in a Windows PowerShell x86-based console. Open a Windows PowerShell x64-based console, and then try again.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Cannot convert "{0}" to an object of type "{1}".. Looks up a localized string similar to "{0}" is a ReadOnly property.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Value of EnumName attribute doesn't translate to a valid C# identifier: {0}. Verify EnumName attribute in Cmdlet Definition XML and try again.. Looks up a localized string similar to Value of Name attribute is not a valid C# identifier: {0}. Verify Name attribute in Cmdlet Definition XML and try again.. Looks up a localized string similar to Cannot process Cmdlet Definition XML for the following file: {0}. {1}. Looks up a localized string similar to Remote computer returned an invalid cdxml file. The following cmdlet adapter is not supported for importing a cdxml module from a remote computer: {0}. Looks up a localized string similar to {0} {1}. Looks up a localized string similar to The {0} cmdlet defines the {1} parameter set more than once. Verify that the Cmdlet Definition XML does not have duplicate parameter set names and retry.. Looks up a localized string similar to Two cmdlet parameters defined within the {0} element have the same name: {1}. Resolve the conflict in the Cmdlet Definition XML and retry.. Looks up a localized string similar to Cannot process <Enum EnumName="{0}" ...> element. {1}. Looks up a localized string similar to Cmdlets over '{0}' class. Looks up a localized string similar to Cannot process the ObjectModelWrapper attribute. The {0} type defines multiple parameter sets. Verify that the Cmdlet Definition XML specifies a valid type in the ObjectModelWrapper attribute and retry.. Looks up a localized string similar to Cannot process the ObjectModelWrapper attribute. The {0} type is an open generic type. Verify that the Cmdlet Definition XML specifies a valid type in the ObjectModelWrapper attribute and retry.. Looks up a localized string similar to Cannot process the ObjectModelWrapper attribute. The {0} type is not derived from the following class: {1}. Verify that the Cmdlet Definition XML specifies a valid type in the ObjectModelWrapper attribute and retry.. Looks up a localized string similar to Cannot process the ObjectModelWrapper attribute. The {0} type defines the {1} cmdlet parameter with a {2} attribute parameter that is ignored. Verify that the Cmdlet Definition XML specifies a valid type in the ObjectModelWrapper attribute and retry.. Looks up a localized string similar to Cannot define the {0} parameter for the {1} cmdlet. The parameter name is already defined by the {2} class. Change the name of the parameter in Cmdlet Definition XML and retry.. Looks up a localized string similar to Cannot define the {0} parameter for the {1} cmdlet. The parameter name is already defined within the {2} xml element. Change the name of the parameter in Cmdlet Definition XML and retry.. Looks up a localized string similar to <?xml version="1.0" encoding="utf-8"?> <!-- ################################################################## Copyright (c) Microsoft Corporation. All rights reserved. ################################################################### --> <!DOCTYPE schema [ <!ENTITY csharpIdentifierLetterCharacterRegex "\p{Lu}\p{Ll}\p{Lt}\p{Lm}\p{Lo}\p{Nl}"> <!ENTITY csharpIdentifierFirstCharacterRegex "&csharpIdentifierLetterCharacterRegex;_"> <!ENTITY csharpIdentifierOtherCharacterRegex "&csharpIdentifierL [rest of string was truncated]";. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Cmdlets derived from PSCmdlet cannot be invoked directly. . Looks up a localized string similar to Continue with all the steps of the operation.. Looks up a localized string similar to Yes to &All. Looks up a localized string similar to Continue with only the next step of the operation.. Looks up a localized string similar to &Yes. Looks up a localized string similar to Command execution stopped because the preference variable "{0}" or common parameter is set to Stop: {1}. Looks up a localized string similar to Halt this command.. Looks up a localized string similar to &Halt Command. Looks up a localized string similar to Confirm. Looks up a localized string similar to Command execution stopped because the user interrupted the command.. Looks up a localized string similar to Command execution stopped because the user selected the Halt option.. Looks up a localized string similar to Total count: {0}. Looks up a localized string similar to Estimated total count: {0}. Looks up a localized string similar to Unknown total count. Looks up a localized string similar to Cmdlet '{0}' does not support parameter '{1}' in a remote session.. Looks up a localized string similar to Pause the current pipeline and return to the command prompt. Type "{0}" to resume the pipeline.. Looks up a localized string similar to &Suspend. Looks up a localized string similar to Command execution stopped because the preference variable "{0}" or common parameter is set to an invalid value "{1}".. Looks up a localized string similar to Command execution stopped because the preference variable "{0}" or common parameter is set to Stop.. Looks up a localized string similar to Continue with this operation?. Looks up a localized string similar to Performing operation "{0}" on Target "{1}".. Looks up a localized string similar to Are you sure you want to perform this action? {0}. Looks up a localized string similar to What if: {0}. Looks up a localized string similar to Skip this operation and all subsequent operations.. Looks up a localized string similar to No to A&ll. Looks up a localized string similar to Skip this operation and proceed with the next operation.. Looks up a localized string similar to &No. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Cannot serialize the credential. If this command is starting a workflow, the credentials cannot be persisted, because the process in which the workflow is started does not have permission to serialize credentials. -- If the workflow was started in a PSSession to the local computer, add the EnableNetworkAccess parameter to the command that created the session. -- If the workflow was started in a PSSession to a remote computer, add the Authentication parameter with a value of CredSSP to the command that [rest of string was truncated]";. Looks up a localized string similar to UserName is not in correct format.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Enter your credentials.. Looks up a localized string similar to Windows PowerShell Credential Request. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Incorrect Windows PowerShell version {0}. Windows PowerShell version {1} is supported in the current console.. Looks up a localized string similar to Bad console file extension. Console file extension must be psc1.. Looks up a localized string similar to Required element "ConsoleSchemaVersion" in {0} is missing or incorrect.. Looks up a localized string similar to Incorrect Windows PowerShell version {0}. Windows PowerShell version {1} is supported on this computer.. Looks up a localized string similar to Unknown element {0} found. "{1}" should have "{2}" and "{3}" elements only.. Looks up a localized string similar to Bad Console file. Multiple entries found for element PSConsoleFile. Only one entry supported for this version.. Looks up a localized string similar to This is a system Windows PowerShell Snap-In that is loaded by Windows PowerShell.. Looks up a localized string similar to An error occurred when loading the system Windows PowerShell Snap-Ins. Please contact Microsoft Support Services.. Looks up a localized string similar to Cannot remove the Windows PowerShell Snap-In {0} because it is a system snap-in. Verify the name of the snap-in being removed and try again.. Looks up a localized string similar to Cannot remove the Windows PowerShell Snap-In {0} because it is not loaded. Verify the name of the snap-in being removed and try again.. Looks up a localized string similar to The cmdlet is not supported by the custom shell.. Looks up a localized string similar to Cannot save the file because the file name format is not valid. Specify a file name using the command: export-console -path.. Looks up a localized string similar to Cannot export to a console because no console is loaded or no name is specified.. Looks up a localized string similar to Cannot export to this file because file {0} is read-only. Change the read-only attribute of the file to read-write, or export to a different file.. Looks up a localized string similar to Cannot save the console file because wildcard characters were used. Specify a console file without wildcard characters.. Looks up a localized string similar to The following errors occurred when loading console {0}: {1}. Looks up a localized string similar to Cannot set the ConsoleFileName variable to {0}. File {0} was saved.. Looks up a localized string similar to Save operation failed. Cannot remove file {0}.. Looks up a localized string similar to File {0} already exists and {1} was specified.. Looks up a localized string similar to Cmdlet {0}. Looks up a localized string similar to Cannot save file. Save operation cancelled.. Looks up a localized string similar to Supply values for the following parameters:. Looks up a localized string similar to The console file is not valid because the Windows PowerShell Snap-In name is missing.. Looks up a localized string similar to Required element "PSConsoleFile" in {0} is missing or incorrect.. Looks up a localized string similar to Required element "PSVersion" in {0} is missing or incorrect.. Looks up a localized string similar to Console file not valid. Only one instance of element "{0}" is allowed.. Looks up a localized string similar to Path {0} is not an absolute path.. Looks up a localized string similar to Cannot export a console file because no console file has been specified. Do you want to continue with export?. Looks up a localized string similar to Can only save a file when you are in a file provider. Current provider is not a file provider.. Looks up a localized string similar to Cannot add Windows PowerShell Snap-In {0} because it is already added. Verify the name of the snap-in and try again.. Looks up a localized string similar to The Windows PowerShell Snap-In module {0} does not have required Windows PowerShell Snap-In strong name {1}.. Looks up a localized string similar to Cannot find any Windows PowerShell Snap-In information for {0}.. Looks up a localized string similar to Cmdlet '{0}' is present more than once in Windows PowerShell Snap- In '{1}'.. Looks up a localized string similar to Windows PowerShell provider '{0}' is present more than once in Windows PowerShell Snap-In '{1}'.. Looks up a localized string similar to Cannot load Windows PowerShell Snap-In {0} because of the following error: {1}. Looks up a localized string similar to Windows PowerShell Snap-In "{0}" is loaded with the following warnings: {1}. Looks up a localized string similar to Bad console file. Element {0} is not valid.. Looks up a localized string similar to Cannot load the Windows PowerShell Snap-In because an error occurred while reading the registry information for the snap-in.. Looks up a localized string similar to Attempting to save a console file with no name. Use export-console with the Path parameter to save the console file.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to This Windows PowerShell snap-in contains cmdlets used to manage components of Windows PowerShell.. Looks up a localized string similar to Core Windows PowerShell Snap-In. Looks up a localized string similar to Microsoft Corporation. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Windows PowerShell Credential Request . Looks up a localized string similar to Enter your credentials. . Looks up a localized string similar to Enter your credentials.. Looks up a localized string similar to The length of the caption should be less than {0}.. Looks up a localized string similar to The length of the message should be less than {0}.. Looks up a localized string similar to The length of the UserName should be less than {0}.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to {0} cannot be null or empty.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to The alias "{0}" is declared multiple times.. Looks up a localized string similar to Cannot resolve alias '{0}' because it refers to term '{1}', which is not recognized as a cmdlet, function, operable program, or script file. Verify the term and try again.. Looks up a localized string similar to The argument '{0}' is not recognized as a cmdlet, possibly because it does not derive from the Cmdlet or PSCmdlet classes: {1}. Looks up a localized string similar to The cmdlet name "{0}" cannot be validated because it is not in the correct format. Cmdlet names must include a verb and a noun separated by a "-", such as "Get-Process".. Looks up a localized string similar to Argument '{0}' is not recognized as a cmdlet: {1}. Looks up a localized string similar to The command could not be retrieved because the ArgumentList parameter can be specified only when retrieving a single cmdlet or script.. Looks up a localized string similar to Cannot retrieve an instance of CommandDiscovery.. Looks up a localized string similar to Parameter '{0}' with value '{1}' cannot be processed because it is not a cmdlet and cannot be processed by the CommandProcessor.. Looks up a localized string similar to The term '{0}' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.. Looks up a localized string similar to No matching commands include a parameter named '{0}'. Check the spelling of the parameter name, and then try again.. Looks up a localized string similar to Parameter could not be declared. Parameters can be declared only on fields and properties.. Looks up a localized string similar to The '{0}' command was found in the module '{1}', but the module could not be loaded. For more information, run 'Import-Module {1}'.. Looks up a localized string similar to The module '{0}' could not be loaded. For more information, run 'Import-Module {0}'.. Looks up a localized string similar to Cannot dot-source this command because it was defined in a different language mode. To invoke this command without importing its contents, omit the '.' operator.. Looks up a localized string similar to '{0}' already exists as an assembly. Only one assembly can exist for a given name.. Looks up a localized string similar to '{0}' already exists as a cmdlet. Only one cmdlet can exist for a given name.. Looks up a localized string similar to '{0}' already exists as a cmdlet Provider. Only one cmdlet Provider can exist for a given name.. Looks up a localized string similar to '{0}' already exists as a script. Only one script can exist for a given name.. Looks up a localized string similar to An ExecutionContext has not been set.. Looks up a localized string similar to Cannot process the cmdlet. A cmdlet name must consist of a verb and noun pair separated by '-'.. Looks up a localized string similar to The parameter "{0}" is declared in parameter-set "{1}" multiple times.. Looks up a localized string similar to {0} (Version {1}). Looks up a localized string similar to The script '{0}' cannot be run because it contained a "#requires" statement with a shell ID of {1} that is incompatible with the current shell. To run this script you must use the shell located at '{2}'.. Looks up a localized string similar to The script '{0}' cannot be run because it contained a "#requires" statement with a shell ID of {1} that is incompatible with the current shell.. Looks up a localized string similar to The script '{0}' cannot be run because the following modules that are specified by the "#requires" statements of the script are missing: {1}.. Looks up a localized string similar to The script '{0}' cannot be run because the following snap-ins that are specified by the "#requires" statements of the script are missing: {1}.. Looks up a localized string similar to The script '{0}' cannot be run because it contained a "#requires" statement for Windows PowerShell version {1}. The version required by the script does not match the currently running version of Windows PowerShell version {2}.. Looks up a localized string similar to #Requires has specified only a shellID. #Requires needs to specify a required Windows PowerShell Snap-In when running in Windows PowerShell.. Looks up a localized string similar to The parameter name "{0}" is reserved for future use.. Looks up a localized string similar to Cannot process the #requires statement because it is not in the correct format. The #requires statement must be in one of the following formats: "#requires -shellid <shellID>" "#requires -version <major.minor>" "#requires -pssnapin <psSnapInName> [-version <major.minor>]" "#requires -modules <ModuleSpecification>". A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to The input expression must not be empty. Specify at least one identifier name in each input expression. . Looks up a localized string similar to Unable to match an empty identifier name to a valid enumerator name. Specify one of the following enumerator names and retry: {0}.. Looks up a localized string similar to The generic type specified for the expression must represent an enum. Specify a valid enum type. . Looks up a localized string similar to The identifier name {0} cannot be processed due to the inability to differentiate between the following enumerator names: {1}. Try a more specific identifier name.. Looks up a localized string similar to Unable to match the identifier name {0} to a valid enumerator name. Specify one of the following enumerator names and try again: {1}. Looks up a localized string similar to Use of parentheses is not valid in the expression because identifier grouping is not allowed. Try removing the parentheses, or if a subexpression is enclosed, try expanding the expression.. Looks up a localized string similar to Unable to parse the expression due to an unexpected token. Only an OR (,) operator or AND (+) operator is expected after an identifier name.. Looks up a localized string similar to Unable to parse the expression due to an unexpected token after a NOT (!) operator. An identifier name is expected after a NOT (!) operator.. Looks up a localized string similar to Unable to parse the expression due to an unexpected token. An identifier name or a NOT (!) operator is expected at the start of the expression, or after an OR (,) operator or an AND (+) operator. Also, an expression must not end with an OR (,), AND (+) or NOT (!) operator.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to AuthenticationError: ({1}:{2}) [{0}], {3}. Looks up a localized string similar to CloseError: ({1}:{2}) [{0}], {3}. Looks up a localized string similar to ConnectionError: ({1}:{2}) [{0}], {3}. Looks up a localized string similar to Deadlock detected: ({1}:{2}) [{0}], {3}. Looks up a localized string similar to DeviceError: ({1}:{2}) [{0}], {3}. Looks up a localized string similar to FromStdErr: ({1}:{2}) [{0}], {3}. Looks up a localized string similar to InvalidArgument: ({1}:{2}) [{0}], {3}. Looks up a localized string similar to InvalidData: ({1}:{2}) [{0}], {3}. Looks up a localized string similar to Unrecognized error category {4}: ({1}:{2}) [{0}], {3}. Looks up a localized string similar to InvalidOperation: ({1}:{2}) [{0}], {3}. Looks up a localized string similar to InvalidResult: ({1}:{2}) [{0}], {3}. Looks up a localized string similar to InvalidType: ({1}:{2}) [{0}], {3}. Looks up a localized string similar to LimitsExceeded: ({1}:{2}) [{0}], {3}. Looks up a localized string similar to MetadataError: ({1}:{2}) [{0}], {3}. Looks up a localized string similar to NotEnabled: ({1}:{2}) [{0}], {3}. Looks up a localized string similar to NotImplemented: ({1}:{2}) [{0}], {3}. Looks up a localized string similar to NotInstalled: ({1}:{2}) [{0}], {3}. Looks up a localized string similar to NotSpecified: ({1}:{2}) [{0}], {3}. Looks up a localized string similar to ObjectNotFound: ({1}:{2}) [{0}], {3}. Looks up a localized string similar to OpenError: ({1}:{2}) [{0}], {3}. Looks up a localized string similar to OperationStopped: ({1}:{2}) [{0}], {3}. Looks up a localized string similar to OperationTimeout: ({1}:{2}) [{0}], {3}. Looks up a localized string similar to ParserError: ({1}:{2}) [{0}], {3}. Looks up a localized string similar to PermissionDenied: ({1}:{2}) [{0}], {3}. Looks up a localized string similar to ProtocolError: ({1}:{2}) [{0}], {3}. Looks up a localized string similar to QuotaExceeded: ({1}:{2}) [{0}], {3}. Looks up a localized string similar to ReadError: ({1}:{2}) [{0}], {3}. Looks up a localized string similar to ResourceBusy: ({1}:{2}) [{0}], {3}. Looks up a localized string similar to ResourceExists: ({1}:{2}) [{0}], {3}. Looks up a localized string similar to ResourceUnavailable: ({1}:{2}) [{0}], {3}. Looks up a localized string similar to SecurityError: ({1}:{2}) [{0}], {3}. Looks up a localized string similar to SyntaxError: ({1}:{2}) [{0}], {3}. Looks up a localized string similar to WriteError: ({1}:{2}) [{0}], {3}. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to {0}...{1}. Looks up a localized string similar to Error text is empty for error "{0}" : "{1}". Looks up a localized string similar to Object "{0}" is reported as an error.. Looks up a localized string similar to The value {0} is not supported for an ActionPreference variable. It should be used only as a value for a preference parameter. It has been replaced by the default.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Command {0} is {1}.. Looks up a localized string similar to Engine state changed from {0} to {1}.. Looks up a localized string similar to Fully Qualified Error ID = {0}. Looks up a localized string similar to Error Message = {0}. Looks up a localized string similar to Recommended Action = {0}. Looks up a localized string similar to Execution Policy. Looks up a localized string similar to Job Command = {0}. Looks up a localized string similar to Job Id = {0}. Looks up a localized string similar to Job Instance Id = {0}. Looks up a localized string similar to Job Location = {0}. Looks up a localized string similar to Job Name = {0}. Looks up a localized string similar to Job State = {0}. Looks up a localized string similar to Command Name = . Looks up a localized string similar to Command Path = . Looks up a localized string similar to Command Type = . Looks up a localized string similar to Engine Version = . Looks up a localized string similar to Host ID = . Looks up a localized string similar to Host Name = . Looks up a localized string similar to Host Version = . Looks up a localized string similar to Pipeline ID = . Looks up a localized string similar to Runspace ID = . Looks up a localized string similar to Script Name = . Looks up a localized string similar to Sequence Number = . Looks up a localized string similar to Severity = . Looks up a localized string similar to Shell ID = . Looks up a localized string similar to Time = . Looks up a localized string similar to User = . Looks up a localized string similar to NULL Job. Looks up a localized string similar to Provider name. Looks up a localized string similar to Provider {0} changed state to {1}.. Looks up a localized string similar to Script execution is {0}.. Looks up a localized string similar to Variable {0} changed from {1} to {2}.. Looks up a localized string similar to Variable {0} changed to {1}.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to The action is not supported when you are forwarding events.. Looks up a localized string similar to Cannot register for event. An event with name '{0}' does not exist.. Looks up a localized string similar to Cannot register for event. Events that require a return value are not supported.. Looks up a localized string similar to This operation is not supported on remote instances.. Looks up a localized string similar to Cannot register for event. Source identifier '{0}' is reserved for the Windows PowerShell engine.. Looks up a localized string similar to Cannot subscribe to event. A subscriber with source identifier '{0}' already exists.. Looks up a localized string similar to Windows PowerShell cannot subscribe to WinRT events.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Cannot access member "{0}" outside of a PSObject.. Looks up a localized string similar to A PSProperty or PSMethod object cannot be added to this collection.. Looks up a localized string similar to "{0}" cannot be changed.. Looks up a localized string similar to The value "{0}" cannot be converted to a string array.. Looks up a localized string similar to Cannot invoke static methods or access static properties on the open generic type {0}. Specify the type parameters and retry. For example, instead of [System.Collections.Generic.HashSet``1]::CreateSetComparer() use [System.Collections.Generic.HashSet[int]]::CreateSetComparer().. Looks up a localized string similar to Cannot set the value for property "{0}" because the object has type "{1}" instead of "{2}".. Looks up a localized string similar to Cannot set the Value property for PSMemberInfo object of type "{0}".. Looks up a localized string similar to Cannot change the member created from the type configuration: "{0}".. Looks up a localized string similar to Cannot create a code method because of the method format. The method should be public, static, and have one parameter of type PSObject.. Looks up a localized string similar to CodeProperty should have getter or setter.. Looks up a localized string similar to The getter method should be public, non void, static, and have one parameter of type PSObject.. Looks up a localized string similar to The setter method should be public, void, static, and have two parameters. The first parameter should be of type PSObject. The second parameter is needed if a getter method is also available, and should have the same type as the return type for the getter method.. Looks up a localized string similar to Could not compare "{0}" to "{1}". Error: "{2}". Looks up a localized string similar to An exception was thrown when trying to call "{0}" to extract the contents of an object of type "{1}": "{2}". Looks up a localized string similar to The alias with name "{0}" contains a cycle.. Looks up a localized string similar to The following exception occurred while trying to enumerate the collection: "{0}".. Looks up a localized string similar to The following exception occurred while constructing the attribute "{1}": "{0}". Looks up a localized string similar to The following exception occurred while retrieving member "{1}": "{0}". Looks up a localized string similar to The following exception occurred while retrieving members: "{0}". Looks up a localized string similar to The following exception occurred while retrieving the definitions for method "{1}": "{0}". Looks up a localized string similar to The following exception occurred while retrieving the string representation for method "{1}": "{0}". Looks up a localized string similar to The following exception occurred while retrieving the definitions for parameterized property "{1}": "{0}". Looks up a localized string similar to The following exception occurred while retrieving the read state for parameterized property "{1}": "{0}". Looks up a localized string similar to The following exception occurred while retrieving the string representation for parameterized property "{1}": "{0}". Looks up a localized string similar to The following exception occurred while retrieving the type for parameterized property "{1}": "{0}". Looks up a localized string similar to The following exception occurred while retrieving the write state for parameterized property "{1}": "{0}". Looks up a localized string similar to The following exception occurred while retrieving the attributes for property "{1}": "{0}". Looks up a localized string similar to The following exception occurred while retrieving the read state for property "{1}": "{0}". Looks up a localized string similar to The following exception occurred while retrieving the string representation for property "{1}" : "{0}". Looks up a localized string similar to The following exception occurred while retrieving the type for property "{1}": "{0}". Looks up a localized string similar to The following exception occurred while retrieving the write state for property "{1}": "{0}". Looks up a localized string similar to The following exception occurred while retrieving the type name hierarchy: "{0}".. Looks up a localized string similar to Exception getting "{0}": "{1}". Looks up a localized string similar to Exception setting "{0}": "{1}". Looks up a localized string similar to The adapter cannot get the properties of "{0}".. Looks up a localized string similar to The adapter cannot get property "{0}" for "{1}".. Looks up a localized string similar to The adapter cannot get the type hierarchy of "{0}".. Looks up a localized string similar to Get accessor for property "{0}" is unavailable.. Looks up a localized string similar to Cannot convert value to type System.String.. Looks up a localized string similar to Cannot convert the "{0}" value of type "{1}" to type "{2}".. Looks up a localized string similar to Cannot convert value "{0}" to type "{1}" because at least two matches were found ({2}, {3}) and only one match is allowed for this enumeration.. Looks up a localized string similar to Cannot convert value "{0}" to type "{1}" because no commas are allowed for this enumeration.. Looks up a localized string similar to Cannot convert value "{0}" to type "{1}" due to enumeration values that are not valid. Specify one of the following enumeration values and try again. The possible enumeration values are "{2}".. Looks up a localized string similar to Cannot convert null to type "{0}" due to enumeration values that are not valid. Specify one of the following enumeration values and try again. The possible enumeration values are "{1}".. Looks up a localized string similar to Cannot convert value "{0}" to type "{1}". Boolean parameters accept only Boolean values and numbers, such as $True, $False, 1 or 0.. Looks up a localized string similar to Cannot convert value to type "{0}". Only core types are supported in this language mode.. Looks up a localized string similar to Cannot convert value to type "{0}". Error: "{1}". Looks up a localized string similar to Cannot convert value "{0}" to type "{1}". Error: "{2}". Looks up a localized string similar to Cannot convert null to type "{0}".. Looks up a localized string similar to Cannot get or set the property value. The "{0}" argument should be of type "{1}" or "{2}".. Looks up a localized string similar to {0} is not a valid class path.. Looks up a localized string similar to {0} is not a valid path.. Looks up a localized string similar to , . Looks up a localized string similar to The member "{0}" is already present.. Looks up a localized string similar to The member "{0}" is already present from the extended type data file.. Looks up a localized string similar to The member "{0}" is not present.. Looks up a localized string similar to Multiple ambiguous overloads found for "{0}" and the argument count: "{1}".. Looks up a localized string similar to Cannot convert argument "{0}", with value: "{1}", for "{2}" to type "{3}": "{4}". Looks up a localized string similar to Cannot find an overload for "{0}" and the argument count: "{1}".. Looks up a localized string similar to Exception calling "{0}" with "{1}" argument(s): "{2}". Looks up a localized string similar to Argument: '{0}' should be a {1}. Use {2}.. Looks up a localized string similar to The field/property: "{0}" for type: "{1}" differs only in case from the field/property: "{2}". Failed to use non CLS compliant type.. Looks up a localized string similar to Cannot compare "{0}" because it is not IComparable.. Looks up a localized string similar to Cannot compare "{0}" to "{1}" because the objects are not the same type or the object "{0}" does not implement "{2}".. Looks up a localized string similar to "{0}" returned a null value.. Looks up a localized string similar to Cannot create object of type "{0}". {1}. Looks up a localized string similar to The adapter cannot get the value of property "{0}".. Looks up a localized string similar to The adapter cannot determine whether property "{0}" is gettable.. Looks up a localized string similar to The adapter cannot determine whether property "{0}" can be changed.. Looks up a localized string similar to The {0} property was not found for the {1} object. The available property is: {2}. Looks up a localized string similar to The property "{0}" has not been found.. Looks up a localized string similar to The adapter cannot set the value of property "{0}".. Looks up a localized string similar to The adapter cannot get the type of property "{0}".. Looks up a localized string similar to "{0}" is a ReadOnly property.. Looks up a localized string similar to Argument: '{0}' should not be a {1}. Do not use {2}.. Looks up a localized string similar to Reference type is expected in argument.. Looks up a localized string similar to The member name "{0}" is reserved.. Looks up a localized string similar to Set accessor for property "{0}" is unavailable.. Looks up a localized string similar to The following exception occurred while retrieving the string: "{0}". Looks up a localized string similar to The following error occurred while loading the extended type data file: {0}. Looks up a localized string similar to Exception calling "{0}" : "{1}". Looks up a localized string similar to Cannot get property value because "{0}" is a write-only property.. Looks up a localized string similar to Cannot set "{0}" because only unique attributes or unique non-attributed leaf nodes can be set.. Looks up a localized string similar to Cannot set "{0}" because only strings can be used as values to set XmlNode properties.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Could not open alternate data stream '{0}' of file '{1}'.. Looks up a localized string similar to The attribute cannot be set because attributes are not supported. Only the following attributes can be set: Archive, Hidden, Normal, ReadOnly, or System.. Looks up a localized string similar to The path length is too short. The length of a path cannot be less than the length of the basePath.. Looks up a localized string similar to Cannot proceed with byte encoding. When using byte encoding the content must be of type byte.. Looks up a localized string similar to The property cannot be cleared because the property is not supported. Only the Attributes property can be cleared.. Looks up a localized string similar to Cannot remove item {0}: {1}. Looks up a localized string similar to Cannot restore attributes on item {0}: {1}. Looks up a localized string similar to Clear Content. Looks up a localized string similar to Item: {0}. Looks up a localized string similar to Clear property directory. Looks up a localized string similar to Clear Property File. Looks up a localized string similar to Item: {0} Property: {1}. Looks up a localized string similar to Cannot copy item {0} onto itself.. Looks up a localized string similar to Copy directory. Looks up a localized string similar to Copy File. Looks up a localized string similar to Item: {0} Destination: {1}. Looks up a localized string similar to Delimiter cannot be specified when reading the stream one byte at a time.. Looks up a localized string similar to Directory: . Looks up a localized string similar to Item with specified name {0} already exists.. Looks up a localized string similar to Directory {0} cannot be removed because it is not empty.. Looks up a localized string similar to {0} is a NTFS junction point. Use the Force parameter to delete or modify.. Looks up a localized string similar to Drive root "{0}" does not exist or it is not a folder.. Looks up a localized string similar to Cannot process file because file {0} was not found.. Looks up a localized string similar to If you are using the -Persist switch parameter, the drive name must be supported by the operating system (for example, A-Z).. Looks up a localized string similar to Invoke Item. Looks up a localized string similar to Item: {0}. Looks up a localized string similar to An object at the specified path {0} does not exist.. Looks up a localized string similar to Could not find item {0}.. Looks up a localized string similar to Move Directory. Looks up a localized string similar to Move File. Looks up a localized string similar to Item: {0} Destination: {1}. Looks up a localized string similar to Create directory. Looks up a localized string similar to Create file. Looks up a localized string similar to Destination: {0}. Looks up a localized string similar to The '{0}' parameter and the '{1}' parameter cannot both be specified.. Looks up a localized string similar to Cannot process path because the specified path refers to an item that is outside the basePath.. Looks up a localized string similar to Not Enough permission to perform operation.. Looks up a localized string similar to When you use the Persist parameter, the root must be a file system location on a remote computer.. Looks up a localized string similar to Property {0} does not exist.. Looks up a localized string similar to The parameters -Raw and -Wait cannot be specified at the same time.. Looks up a localized string similar to Cannot detect the encoding of the file. The specified encoding {0} is not supported when the content is read in reverse.. Looks up a localized string similar to Remove Directory. Looks up a localized string similar to Remove file. Looks up a localized string similar to Cannot rename because the target specified represents a path or device name.. Looks up a localized string similar to Rename directory. Looks up a localized string similar to Rename File. Looks up a localized string similar to Item: {0} Destination: {1}. Looks up a localized string similar to Set property directory. Looks up a localized string similar to Set Property File. Looks up a localized string similar to Item: {0} Property: {1} Value: {2}. Looks up a localized string similar to Stream '{0}' of file '{1}'.. Looks up a localized string similar to Cannot process path '{0}' because the target represents a reserved device name.. Looks up a localized string similar to The type is not a known type for the file system. Only "file" and "directory" can be specified.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to (Global Assembly Cache) {0}. Looks up a localized string similar to Error at XPath {0} in file {1}: Assembly {2} is not found.. Looks up a localized string similar to Error at XPath {0} in file {1}: The XML Element {2} does not allow attributes.. Looks up a localized string similar to Error at XPath {0} in file {1}: Cannot have control and Label at the same time.. Looks up a localized string similar to Error at XPath {0} in file {1}: Cannot have control or Label without an expression.. Looks up a localized string similar to Error at XPath {0} in file {1}: Duplicated node.. Looks up a localized string similar to Error at XPath {0} in file {1}: No type or condition is specified for applying the view.. Looks up a localized string similar to Error at XPath {0} in file {1}: {2} is an empty attribute.. Looks up a localized string similar to Error at XPath {0} in file {1}: Empty custom control token list.. Looks up a localized string similar to Error at XPath {0} in file {1}: {2} is an empty node.. Looks up a localized string similar to Error in file {0}: {1}. Looks up a localized string similar to Error in formatting data "{0}": {1}. Looks up a localized string similar to Error at XPath {0} in file {1}: A Boolean value is expected.. Looks up a localized string similar to Error at XPath {0} in file {1}: An expression is expected.. Looks up a localized string similar to Error at XPath {0} in file {1}: An integer is expected.. Looks up a localized string similar to Error at XPath {0} in file {1}: A non-negative integer is expected.. Looks up a localized string similar to Error at XPath {0} in file {1}: A positive integer is expected.. Looks up a localized string similar to Path {0} is not fully qualified. Specify a fully qualified format file path.. Looks up a localized string similar to There were errors in loading the format data file: {0}. Looks up a localized string similar to Shared format table cannot be updated with more than one entry.. Looks up a localized string similar to There were errors loading FormatTable. Look in the Errors property to get detailed error messages.. Looks up a localized string similar to Error at XPath {0} in file {1}: Header item count = {2} does not match default row item count = {3}.. Looks up a localized string similar to Error in view data with type name {0} at index {1}: Header item count = {2} does not match default row item count = {3}.. Looks up a localized string similar to Error at XPath {0} in file {1}: Row item count = {2} on alternative set #{3} does not match default row item count = {4}.. Looks up a localized string similar to Error at XPath {0} in file {1}: "{2}" is not an valid alignment value.. Looks up a localized string similar to Error at XPath {0} in file {1}: Column header definition is not valid; all headers are discarded.. Looks up a localized string similar to Error at XPath {0} in file {1}: Out Of Band views can only have CustomControl or ListControl.. Looks up a localized string similar to Error in view data with type name {0} at index {1}: Formatting data "{2}" is not valid.. Looks up a localized string similar to Error at XPath {0} in file {1}: {2} is not valid.. Looks up a localized string similar to Error at XPath {0} in file {1}: {2} value not valid.. Looks up a localized string similar to Error at XPath {0} in file {1}: Property entry is not valid.. Looks up a localized string similar to Error at XPath {0} in file {1}: Script block "{2}" not valid.. Looks up a localized string similar to Error in view data with type name {0} at index {1}: Script block "{2}" is not valid.. Looks up a localized string similar to Error at XPath {0} in file {1}: {2} failed to load.. Looks up a localized string similar to Error in view data with type name {0} at index {1}: {2} failed to load.. Looks up a localized string similar to Error at XPath {0} in file {1}: {2} is a missing attribute.. Looks up a localized string similar to Error at XPath {0} in file {1}: Missing inner text value.. Looks up a localized string similar to Error at XPath {0} in file {1}: Missing Node {2}.. Looks up a localized string similar to Error at XPath {0} in file {1}: Missing Node from {2}.. Looks up a localized string similar to {0}, {1}. Looks up a localized string similar to Error in view data with type name {0} at index {1}: TableControl should contain only one {2}.. Looks up a localized string similar to Error at XPath {0} in file {1}: {2} and {3} are mutually exclusive.. Looks up a localized string similar to Error at XPath {0} in file {1}: Node {2} cannot have children.. Looks up a localized string similar to Error at XPath {0} in file {1}: There must be at least one default {2}.. Looks up a localized string similar to Error in view data with type name {0} at index {1}: There must be at least one default {2}.. Looks up a localized string similar to Error at XPath {0} in file {1}: Missing definition list.. Looks up a localized string similar to Error at XPath {0} in file {1}: {2} cannot be specified with an expression.. Looks up a localized string similar to Error at XPath {0} in file {1}: {2} cannot be specified without an expression.. Looks up a localized string similar to Error at XPath {0} in file {1}: Missing a format string.. Looks up a localized string similar to Error at XPath {0} in file {1}: At least one list view item must be specified.. Looks up a localized string similar to Error in view data with type name {0} at index {1}: At least one list view item must be specified.. Looks up a localized string similar to Error at XPath {0} in file {1}: Node should be an XmlElement.. Looks up a localized string similar to Error at XPath {0} in file {1}: Missing property.. Looks up a localized string similar to Error at XPath {0} in file {1}: Missing script block text.. Looks up a localized string similar to Error at XPath {0} in file {1}: Control cannot have a null name.. Looks up a localized string similar to Error at XPath {0} in file {1}: An Out Of Band view cannot have GroupBy.. Looks up a localized string similar to Error at XPath {0} in file {1}: Resource {2} in assembly {3} is not found.. Looks up a localized string similar to Error at XPath {0} in file {1}: Cannot have SelectionSetName and TypeName at the same time.. Looks up a localized string similar to The FormatTable cannot be updated because the FormatTable might have been created outside of the Runspace.. Looks up a localized string similar to Error at XPath {0} in file {1}: String {2} from resource {3} in assembly {4} is not found.. Looks up a localized string similar to Error at XPath {0} in file {1}: {2}, {3} and {4} are mutually exclusive.. Looks up a localized string similar to Error at XPath {0} in file {1}: There cannot be more than one default {2}.. Looks up a localized string similar to Error in view data with type name {0} at index {1}: There cannot be more than one default {2}.. Looks up a localized string similar to Too many errors in file {0}.. Looks up a localized string similar to Too many errors in the formatting data for type "{0}".. Looks up a localized string similar to Error at XPath {0} in file {1}: {2} is an unknown attribute.. Looks up a localized string similar to Error at XPath {0} in file {1}: {2} is an unknown node.. Looks up a localized string similar to Error at XPath {0} in file {1}: View cannot be loaded.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Command execution stopped due to the Stop policy.. Looks up a localized string similar to Cannot retrieve message "{0}" "{1}" "{2}" because assembly was not registered.. Looks up a localized string similar to Cannot retrieve message "{0}" "{1}" "{2}". Template string format is not valid in template string "{3}".. Looks up a localized string similar to Cannot retrieve message "{0}" "{1}" "{2}". Template string exists but is blank.. Looks up a localized string similar to The pipeline failed due to call depth overflow.. Looks up a localized string similar to The pipeline has been stopped.. Looks up a localized string similar to Cannot load resource with base name "{0}".. Looks up a localized string similar to Cannot load resource string with ID "{0}".. Looks up a localized string similar to The script failed due to call depth overflow.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to An error of type "{0}" has occurred.. Looks up a localized string similar to A command that prompts the user failed because the host program or the command type does not support user interaction. Try a host program that supports user interaction, such as the Windows PowerShell Console or Windows PowerShell ISE, and remove prompt-related commands from command types that do not support user interaction, such as Windows PowerShell workflows.. Looks up a localized string similar to A command that prompts the user failed because the host program or the command type does not support user interaction. The host was attempting to request confirmation with the following message: {0}. Looks up a localized string similar to The method cannot be invoked because the pool has been closed or has failed.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Cannot add history because input object has invalid format.. Looks up a localized string similar to Note: {0} entries were cleared from the session history.. Looks up a localized string similar to This command will clear all the entries from the session history.. Looks up a localized string similar to The identifier {0} is invalid. Specify a positive number and try again.. Looks up a localized string similar to The identifier {0} is invalid for a History identifier. Specify a positive number and try again.. Looks up a localized string similar to The Invoke-History cmdlet is getting called in loop.. Looks up a localized string similar to Cannot process multiple history commands. Only a single command can be executed by invoke-history.. Looks up a localized string similar to Count cannot be combined with multiple CommandLine parameters.. Looks up a localized string similar to Count cannot be combined with multiple Ids.. Looks up a localized string similar to Cannot locate history for commandline {0}.. Looks up a localized string similar to Cannot locate history for Id {0}.. Looks up a localized string similar to Cannot locate history.. Looks up a localized string similar to Cannot locate last history.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to EnterNestedPrompt has not been called as many times as ExitNestedPrompt.. Looks up a localized string similar to Cannot exit nested prompt because no nested prompts exist.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Choice[{0}]: . Looks up a localized string similar to (default is "{0}"). Looks up a localized string similar to (default choices are {0}). Looks up a localized string similar to "{0}" should have at least one element.. Looks up a localized string similar to Cannot process the hot key because a question mark ("?") cannot be used as a hot key.. Looks up a localized string similar to "{0}" must be a valid index into "{1}". "{2}" is not a valid index.. Looks up a localized string similar to The "{0}" parameter must contain at least one value.. Looks up a localized string similar to End the operation with an error.. Looks up a localized string similar to &No. Looks up a localized string similar to End the operation with an error. Do not request to resume operation for this session.. Looks up a localized string similar to No to A&ll. Looks up a localized string similar to Continue with this operation?. Looks up a localized string similar to Pause the current operation and enter a command prompt. Type "exit" to resume the paused operation.. Looks up a localized string similar to &Suspend. Looks up a localized string similar to Continue.. Looks up a localized string similar to &Yes. Looks up a localized string similar to Continue, and do not ask again whether to continue in this session.. Looks up a localized string similar to Yes to &All. Looks up a localized string similar to The value {0} is not a supported ActionPreference value.. Looks up a localized string similar to WriteDebug stopped because the value of the DebugPreference variable was 'Stop'.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to ExceptionClass=[ExceptionClass] ErrorCategory=[ErrorCategory] ErrorId=[ErrorId] ErrorMessage=[ErrorMessage] Severity=[Severity] SequenceNumber=[SequenceNumber] HostName=[HostName] HostVersion=[HostVersion] HostId=[HostId] EngineVersion=[EngineVersion] RunspaceId=[RunspaceId] PipelineId=[PipelineId] CommandName=[CommandName] CommandType=[CommandType] ScriptName=[ScriptName] CommandPath=[CommandPath] CommandLine=[CommandLine]. Looks up a localized string similar to NewCommandState=[NewCommandState] SequenceNumber=[SequenceNumber] HostName=[HostName] HostVersion=[HostVersion] HostId=[HostId] EngineVersion=[EngineVersion] RunspaceId=[RunspaceId] PipelineId=[PipelineId] CommandName=[CommandName] CommandType=[CommandType] ScriptName=[ScriptName] CommandPath=[CommandPath] CommandLine=[CommandLine]. Looks up a localized string similar to ExceptionClass=[ExceptionClass] ErrorCategory=[ErrorCategory] ErrorId=[ErrorId] ErrorMessage=[ErrorMessage] Severity=[Severity] SequenceNumber=[SequenceNumber] HostName=[HostName] HostVersion=[HostVersion] HostId=[HostId] EngineVersion=[EngineVersion] RunspaceId=[RunspaceId] PipelineId=[PipelineId] CommandName=[CommandName] CommandType=[CommandType] ScriptName=[ScriptName] CommandPath=[CommandPath] CommandLine=[CommandLine] AdditionalInfo: Name=[AdditionalInfo_Nam [rest of string was truncated]";. Looks up a localized string similar to NewEngineState=[NewEngineState] PreviousEngineState=[PreviousEngineState] SequenceNumber=[SequenceNumber] HostName=[HostName] HostVersion=[HostVersion] HostId=[HostId] EngineVersion=[EngineVersion] RunspaceId=[RunspaceId] PipelineId=[PipelineId] CommandName=[CommandName] CommandType=[CommandType] ScriptName=[ScriptName] CommandPath=[CommandPath] CommandLine=[CommandLine]. Looks up a localized string similar to DetailSequence=[DetailSequence] DetailTotal=[DetailTotal] SequenceNumber=[SequenceNumber] UserId=[User] HostName=[HostName] HostVersion=[HostVersion] HostId=[HostId] EngineVersion=[EngineVersion] RunspaceId=[RunspaceId] PipelineId=[PipelineId] ScriptName=[ScriptName] CommandLine=[CommandLine]. Looks up a localized string similar to ProviderName=[ProviderName] ExceptionClass=[ExceptionClass] ErrorCategory=[ErrorCategory] ErrorId=[ErrorId] ErrorMessage=[ErrorMessage] Severity=[Severity] SequenceNumber=[SequenceNumber] HostName=[HostName] HostVersion=[HostVersion] HostId=[HostId] EngineVersion=[EngineVersion] RunspaceId=[RunspaceId] PipelineId=[PipelineId] CommandName=[CommandName] CommandType=[CommandType] ScriptName=[ScriptName] CommandPath=[CommandPath] CommandLine=[CommandLine]. Looks up a localized string similar to ProviderName=[ProviderName] NewProviderState=[NewProviderState] SequenceNumber=[SequenceNumber] HostName=[HostName] HostVersion=[HostVersion] HostId=[HostId] EngineVersion=[EngineVersion] RunspaceId=[RunspaceId] PipelineId=[PipelineId] CommandName=[CommandName] CommandType=[CommandType] ScriptName=[ScriptName] CommandPath=[CommandPath] CommandLine=[CommandLine]. Looks up a localized string similar to VariableName=[VariableName] NewValue=[NewValue] PreviousValue=[PreviousValue] SequenceNumber=[SequenceNumber] HostName=[HostName] HostVersion=[HostVersion] HostId=[HostId] EngineVersion=[EngineVersion] RunspaceId=[RunspaceId] PipelineId=[PipelineId] CommandName=[CommandName] CommandType=[CommandType] ScriptName=[ScriptName] CommandPath=[CommandPath] CommandLine=[CommandLine]. Looks up a localized string similar to UNKNOWN. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Parameter alias cannot be specified because an alias with the name '{0}' was defined multiple times for the command.. Looks up a localized string similar to Cannot process argument because the argument value is a non-string. Arguments to parameters with the ArgumentTransformationAttribute specified should be strings.. Looks up a localized string similar to Attribute cannot be added because it would cause the variable {0} with value {1} to become invalid.. Looks up a localized string similar to The variable cannot be validated because the value {1} is not a valid value for the {0} variable.. Looks up a localized string similar to Job conversion type must derive from IAstToScriptBlockConverter.. Looks up a localized string similar to Cannot initialize attributes for "{0}": "{1}". Looks up a localized string similar to A parameter with the name '{0}' was defined multiple times for the command.. Looks up a localized string similar to Parameter '{0}' cannot be specified because it conflicts with the parameter alias of the same name for parameter '{1}'.. Looks up a localized string similar to Cannot get or execute command. The maximum number of parameter sets for this command is exceeded.. Looks up a localized string similar to The number of supplied arguments ({1}) exceeds the maximum number of allowed arguments ({0}). Specify less than {0} arguments and then try the command again.. Looks up a localized string similar to The specified maximum number of arguments for a parameter is smaller than the specified minimum number of arguments. Update the ValidateCount attribute for the parameter.. Looks up a localized string similar to The number of supplied arguments ({1}) is less than the minimum number of allowed arguments ({0}). Specify more than {0} arguments and then try the command again.. Looks up a localized string similar to The ValidateCount attribute cannot be applied to a non-array parameter. Either remove the attribute from the parameter or make the parameter an array parameter.. Looks up a localized string similar to "{0}" failed on property "{1}" {2}. Looks up a localized string similar to The argument length of {1} is too long. Shorten the length of the argument to less than or equal to "{0}" and then try the command again.. Looks up a localized string similar to The specified maximum argument length is smaller than the specified minimum argument length. Update the ValidateLength attribute for the parameter.. Looks up a localized string similar to The number of characters ({1}) in the argument is too small. Specify an argument whose length is greater than or equal to "{0}" and then try the command again.. Looks up a localized string similar to The ValidateLength attribute cannot be applied to a parameter that is not a string or string[] parameter. Make the parameter a string or string[] parameter.. Looks up a localized string similar to The argument is null, or an element of the argument collection contains a null value. Supply a collection that does not contain any null values and then try the command again.. Looks up a localized string similar to The argument is null. Supply a non-null argument and try the command again.. Looks up a localized string similar to The argument is null, empty, or an element of the argument collection contains a null value. Supply a collection that does not contain any null values and then try the command again.. Looks up a localized string similar to The argument is null or empty. Supply an argument that is not null or empty and then try the command again.. Looks up a localized string similar to The argument "{0}" does not match the "{1}" pattern. Supply an argument that matches "{1}" and try the command again.. Looks up a localized string similar to The argument cannot be validated because its type "{0}" is not the same type ({1}) as the maximum and minimum limits of the parameter. Make sure the argument is of type {1} and then try the command again.. Looks up a localized string similar to The {0} argument is greater than the maximum allowed range of {1}. Supply an argument that is less than or equal to {1} and then try the command again.. Looks up a localized string similar to The specified maximum range cannot be accepted because it is less than the specified minimum range. Update the ValidateRange attribute for the parameter.. Looks up a localized string similar to The specified minimum range ({0}) cannot be accepted because it is not the same type as the specified maximum range ({1}). Update the ValidateRange attribute for the parameter.. Looks up a localized string similar to Cannot accept the MaxRange and MinRange parameter type. Both parameters must be objects that implement IComparable interface.. Looks up a localized string similar to The {0} argument is less than the minimum allowed range of {1}. Supply an argument that is greater than or equal to {1} and then try the command again.. Looks up a localized string similar to The "{1}" validation script for the argument with value "{0}" did not return true. Determine why the validation script failed and then try the command again.. Looks up a localized string similar to The argument "{0}" does not belong to the set "{1}" specified by the ValidateSet attribute. Supply an argument that is in the set and then try the command again.. Looks up a localized string similar to ,. Looks up a localized string similar to Cannot validate argument '{0}' because it is not a valid variable name.. Looks up a localized string similar to The "{0}" argument does not contain a valid Windows PowerShell version. Supply a valid version number and then try the command again.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to All strings are null or empty.. Looks up a localized string similar to "{0}" cannot be greater than or equal to "{1}".. Looks up a localized string similar to "{0}" needs to be a positive number.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to The contents of file {0} may have been tampered because the hash of the file does not match the hash stored in the digital signature. The script will not execute on the system. Please see "get-help about_signing" for more details.. Looks up a localized string similar to The signature cannot be verified because it is incompatible with the current system.. Looks up a localized string similar to The signature cannot be verified because it is incompatible with the current system. The hash algorithm is invalid.. Looks up a localized string similar to The file {0} is not digitally signed. The script will not execute on the system. For more information, see about_Execution_Policies at http://go.microsoft.com/fwlink/?LinkID=135170. Looks up a localized string similar to Cannot sign file because the system does not support signing operations on {0} files.. Looks up a localized string similar to Cannot sign file because the system does not support signing operations on files without a file extension.. Looks up a localized string similar to File {0} is signed but the signer is not trusted on this system.. Looks up a localized string similar to Signature verified.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Cannot process xml from '{0}' stream of '{1}': {2}. Looks up a localized string similar to ScriptBlock should only be specified as value to the Command parameter.. Looks up a localized string similar to Incorrect value {6} specified for the {7} parameter. Legal values are Text and Xml.. Looks up a localized string similar to No value was specified for the Command parameter.. Looks up a localized string similar to No value specified for the InputFormat parameter. Legal values are Text and Xml.. Looks up a localized string similar to No value is specified for the OutputFormat parameter. Legal values are text and XML.. Looks up a localized string similar to No value specified for the Args parameter.. Looks up a localized string similar to Parameter {6} is specified already.. Looks up a localized string similar to {6} parameter requires a string.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Parameter cannot be processed because the parameter name '{1}' is ambiguous. Possible matches include:{6}.. Looks up a localized string similar to Parameter set cannot be resolved using the specified named parameters.. Looks up a localized string similar to Cannot bind positional parameters '{1}'.. Looks up a localized string similar to Cannot bind positional parameters because no names were given.. Looks up a localized string similar to Cannot convert '{6}' to the type '{2}' required by parameter '{1}'. {7}. Looks up a localized string similar to Cannot bind parameter '{1}'. {6}. Looks up a localized string similar to Cannot bind cmdlet {0} because parameter '{1}' is of type '{2}' and the Add() method cannot be identified, or multiple Add() methods exist. {6}. Looks up a localized string similar to {6} This failure might be caused by applying the default parameter binding. You can disable the default parameter binding in $PSDefaultParameterValues by setting $PSDefaultParameterValues["Disabled"] to be $true, and retry. The following default parameters were successfully bound for this cmdlet when the error occurred:{7}. Looks up a localized string similar to {6} This failure might be caused by applying the default parameter binding. You can disable the default parameter binding in $PSDefaultParameterValues by setting $PSDefaultParameterValues["Disabled"] to be $true, and retry. The following default parameter was successfully bound for this cmdlet when the error occurred:{7}. Looks up a localized string similar to Multiple different default values are defined in $PSDefaultParameterValues for the parameter matching the following name or alias: {0}. These defaults have been ignored.. Looks up a localized string similar to Cannot process command. The parameter '{0}' is defined multiple times.. Looks up a localized string similar to Cannot retrieve dynamic parameters for the cmdlet. Dynamic parameter '{1}' specified parameter set '{6}' which was not statically defined for this cmdlet. New parameter sets may not be defined as dynamic parameters, although dynamic parameters may join parameter sets which were statically defined.. Looks up a localized string similar to The binding of default value '{0}' to parameter '{1}' failed: {2}. Looks up a localized string similar to Pipeline input cannot be processed because the default value of parameter '{1}' cannot be retrieved. {6}. Looks up a localized string similar to Cannot retrieve the dynamic parameters for the cmdlet. {6}. Looks up a localized string similar to The input object cannot be bound because it did not contain the information required to bind all mandatory parameters: {6}. Looks up a localized string similar to The input object cannot be bound to any parameters for the command either because the command does not take pipeline input or the input and its properties do not match any of the parameters that take pipeline input.. Looks up a localized string similar to The automatic variable $PSDefaultParameterValues is ignored because it is not a valid Hashtable object. It must be of the type IDictionary.. Looks up a localized string similar to Cannot bind argument to parameter '{1}', because PSTypeNames of the argument do not match the PSTypeName required by the parameter: {6}.. Looks up a localized string similar to Missing an argument for parameter '{1}'. Specify a parameter of type '{2}' and try again.. Looks up a localized string similar to Cannot process command because of one or more missing mandatory parameters:{1}.. Looks up a localized string similar to The keys '{0}' have invalid formats. For information about the correct format, see about_Parameters_Default_Values at http://go.microsoft.com/fwlink/?LinkId=228266.. Looks up a localized string similar to The following name or alias defined in $PSDefaultParameterValues for this cmdlet resolves to multiple parameters: {0}. The default has been ignored.. Looks up a localized string similar to A parameter cannot be found that matches parameter name '{1}'.. Looks up a localized string similar to Cannot bind parameter because parameter '{1}' is specified more than once. To provide multiple values to parameters that can accept multiple values, use the array syntax. For example, "-parameter value1,value2,value3".. Looks up a localized string similar to Cannot process argument transformation on parameter '{1}'. {6}. Looks up a localized string similar to {6}. Looks up a localized string similar to Cannot validate argument on parameter '{1}'. {6}. Looks up a localized string similar to Cannot bind argument to parameter '{1}' because it is an empty array.. Looks up a localized string similar to Cannot bind argument to parameter '{1}' because it is an empty collection.. Looks up a localized string similar to Cannot bind argument to parameter '{1}' because it is an empty string.. Looks up a localized string similar to Cannot bind argument to parameter '{1}' because it is null.. Looks up a localized string similar to Cannot bind parameter '{1}' to the target. {6}. Looks up a localized string similar to Parameter '{1}' cannot be specified in parameter set '{6}'.. Looks up a localized string similar to A positional parameter cannot be found that accepts argument '{1}'.. Looks up a localized string similar to cmdlet {0} at command pipeline position {1}. Looks up a localized string similar to Supply values for the following parameters:. Looks up a localized string similar to A parameter binding error occurred for object {0}; the message string cannot be formatted for {1}.{2} : {3}. Looks up a localized string similar to A parameter binding error occurred for object {0}; the message string cannot be loaded for {1}.{2} : {3}. Looks up a localized string similar to Cannot bind cmdlet {0} because runtime-defined parameter '{1}' was added to the RuntimeDefinedParameterDictionary with key '{6}'. The key must be the same as RuntimeDefinedParameter.Name.. Looks up a localized string similar to The input to the script block for parameter '{1}' failed. {6}. Looks up a localized string similar to Cannot evaluate parameter '{1}' because its argument is specified as a script block and there is no input. A script block cannot be evaluated without input.. Looks up a localized string similar to Cannot evaluate parameter '{1}' because its argument input did not produce any output.. Looks up a localized string similar to The key '{0}' has an invalid format. For information about the correct format, see about_Parameters_Default_Values at http://go.microsoft.com/fwlink/?LinkId=228266.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to A hash table can only be added to another hash table.. Looks up a localized string similar to * stream. Looks up a localized string similar to Ambiguous parameter '-{0}' Possible matches are. Looks up a localized string similar to {0} ({1}). Looks up a localized string similar to Path cannot be processed because it resolved to more than one file; can process only one file at a time.. Looks up a localized string similar to Ampersand not allowed. The & operator is reserved for future use; use "&" to pass ampersand as a string.. Looks up a localized string similar to Array assignment to [{0}] failed: {1}.. Looks up a localized string similar to Array multiplication resulting in more than {0} elements is not allowed in restricted language mode or a Data section.. Looks up a localized string similar to Array references are not allowed in restricted language mode or a Data section.. Looks up a localized string similar to Array assignment to [{0}] failed because assignment to slices is not supported.. Looks up a localized string similar to The right operand of '-as' must be a type.. Looks up a localized string similar to Assignment statements are not allowed in restricted language mode or a Data section.. Looks up a localized string similar to An ast cannot be used as the child of more than one ast.. Looks up a localized string similar to Attributes are not allowed in restricted language mode or a Data section.. Looks up a localized string similar to An error '{0}' occurred while processing this script. Text describing this error could not be loaded.. Looks up a localized string similar to An error '{0}' occurred while processing this script. Text describing this error could not be loaded due to error '{1}'.. Looks up a localized string similar to An error occurred while enumerating through a collection: {0}.. Looks up a localized string similar to The expression after '{0}' in a pipeline element produced a object that was not valid. It must result in a command name, script block or CommandInfo object.. Looks up a localized string similar to Could not process combined Begin/Process/End clauses with command text. A script or function can either have begin/process/end clauses or command text but not both.. Looks up a localized string similar to Bad numeric constant: {0}.. Looks up a localized string similar to Bad argument to operator '{0}': {1}.. Looks up a localized string similar to Bad regular expression supplied to '{0}': {1}.. Looks up a localized string similar to The {0} operator only permits 2 elements on the right-hand side, not {1}.. Looks up a localized string similar to Do not continue processing, throw the exception instead.. Looks up a localized string similar to &Break. Looks up a localized string similar to Cannot find an appropriate constructor to instantiate the custom attribute object for type '{0}'.. Looks up a localized string similar to Unable to index into an object of type {0}.. Looks up a localized string similar to The method cannot be invoked.. Looks up a localized string similar to Cannot run a document in the middle of a pipeline: {0}.. Looks up a localized string similar to Cannot use '&' to invoke in the context of binary module '{0}'. Specify a non-binary module after the '&' and try the operation again.. Looks up a localized string similar to Cannot use '&' to invoke in the context of module '{0}' because it is not imported. Import the module '{0}' and try the operation again.. Looks up a localized string similar to The command '{0}' is not allowed in restricted language mode or a Data section.. Looks up a localized string similar to An unhandled COM interop exception occurred: {0}. Looks up a localized string similar to Report the error then continue with the next script statement.. Looks up a localized string similar to &Continue. Looks up a localized string similar to Control cannot leave a finally block.. Looks up a localized string similar to Cannot find the type for custom attribute '{0}'. Make sure that the assembly that contains this type is loaded.. Looks up a localized string similar to The Data section variable "{0}" has already been used for an existing variable or another Data section.. Looks up a localized string similar to The data statement is not allowed in restricted language mode or another Data section.. Looks up a localized string similar to Debug stream. Looks up a localized string similar to Dot sourcing is not allowed in restricted language mode or a Data section.. Looks up a localized string similar to The Do and While statements are not allowed in restricted language mode or a Data section.. Looks up a localized string similar to Duplicate parameter ${0} in parameter list.. Looks up a localized string similar to Duplicate keys '{0}' are not allowed in hash literals.. Looks up a localized string similar to Duplicate named arguments '{0}' are not allowed.. Looks up a localized string similar to Script command clause '{0}' has already been defined.. Looks up a localized string similar to Braced variable name cannot be empty.. Looks up a localized string similar to Catch block must be the last catch block.. Looks up a localized string similar to An empty pipe element is not allowed.. Looks up a localized string similar to Empty ${} variable reference, there should be a name between the braces.. Looks up a localized string similar to Missing } at end of variable name.. Looks up a localized string similar to Missing ) at end of subexpression.. Looks up a localized string similar to Missing ] at end of attribute or type literal.. Looks up a localized string similar to Missing ] at end of type token.. Looks up a localized string similar to You can only use the '=' operator when assigning to a list of variables.. Looks up a localized string similar to Parser errors were detected.. Looks up a localized string similar to error stream. Looks up a localized string similar to Action to take for this exception:. Looks up a localized string similar to Exception type {0} is already handled by a previous handler.. Looks up a localized string similar to Expandable strings are not allowed in restricted language mode or a Data section.. Looks up a localized string similar to Expandable strings are not allowed in the list of supported commands for the Data section.. Looks up a localized string similar to Expected ';', '}}' or end-of-line, not {0}.. Looks up a localized string similar to An expression was expected after '('.. Looks up a localized string similar to You must provide a value expression on the right-hand side of the '{0}' operator.. Looks up a localized string similar to Expressions are only allowed as the first element of a pipeline.. Looks up a localized string similar to No files matching '{0}' were found.. Looks up a localized string similar to The current provider ({0}) cannot open a file.. Looks up a localized string similar to The file could not be read: {0}.. Looks up a localized string similar to Flow control statements such as Break, Continue, Return, Exit, and Throw are not allowed in restricted language mode or a Data section.. Looks up a localized string similar to Foreach statements are not allowed in restricted language mode or a Data section.. Looks up a localized string similar to Error formatting a string: {0}.. Looks up a localized string similar to For and While statements are not allowed in restricted language mode or a Data section.. Looks up a localized string similar to The 'from' keyword is not supported in this version of the language.. Looks up a localized string similar to Function declarations are not allowed in restricted language mode or a Data section.. Looks up a localized string similar to Cannot convert hashtable to an object of the following type: {0}. Hashtable-to-Object conversion is not supported in restricted language mode or a Data section.. Looks up a localized string similar to host stream. Looks up a localized string similar to Missing condition in if statement after '{0} ('.. Looks up a localized string similar to $(subexpression) is missing the closing ')'.. Looks up a localized string similar to ${{variable}} reference starting is missing the closing '}}'.. Looks up a localized string similar to The hash literal was incomplete.. Looks up a localized string similar to Incomplete string token.. Looks up a localized string similar to The switch statement was incomplete.. Looks up a localized string similar to Incomplete variable reference token.. Looks up a localized string similar to Assigning to array element at index [{0}] failed: {1}.. Looks up a localized string similar to Array assignment failed because index '{0}' was out of range.. Looks up a localized string similar to Variable reference is not valid. The variable name is missing.. Looks up a localized string similar to A COM object was accessed after it was already released: {0}. Looks up a localized string similar to The custom attribute type '{0}' is not derived from System.Attribute.. Looks up a localized string similar to The body of the Data section is not valid. The Data section body can be only a convert-* command invocation optionally enclosed by an If statement.. Looks up a localized string similar to The token '{0}' is not a valid statement separator in this version.. Looks up a localized string similar to Filename argument to -file in switch statement is not valid.. Looks up a localized string similar to The parameter {0} is not valid for the foreach statement.. Looks up a localized string similar to Parameter declarations are a comma-separated list of variable names with optional initializer expressions.. Looks up a localized string similar to Character '{0}' is not valid, labels can only contain characters, numbers and '_'.. Looks up a localized string similar to Assignment expression is not valid. The left hand side of an assignment operator needs to be something that can be assigned to like a variable or a property.. Looks up a localized string similar to A null key is not allowed in a hash literal.. Looks up a localized string similar to Parameter '{0}' is not valid. Looks up a localized string similar to The "{0}" parameter of the Data section is not valid. The valid Data section parameter is SupportedCommand.. Looks up a localized string similar to Regular expression pattern is not valid: {0}.. Looks up a localized string similar to A Begin statement block, Process statement block, or parameter statement is not allowed in a Data section.. Looks up a localized string similar to Combination of options to -split are not valid. Looks up a localized string similar to Options are not allowed on -split operator with a predicate. Looks up a localized string similar to The parameter {0} is not valid for the switch statement.. Looks up a localized string similar to A token that is not valid was found in the list of supported commands for the Data section.. Looks up a localized string similar to Expression is not allowed in a Using expression.. Looks up a localized string similar to Variable reference is not valid. '$' was not followed by a valid variable name character. Consider using ${} to delimit the name.. Looks up a localized string similar to Variable reference is not valid. ':' was not followed by a valid variable name character. Consider using ${} to delimit the name.. Looks up a localized string similar to Cannot invoke method. Method invocation is supported only on core types in this language mode.. Looks up a localized string similar to You cannot call a method on a null-valued expression.. Looks up a localized string similar to The right operand of '-is' must be a type.. Looks up a localized string similar to Unable to assign to a dictionary of type {0} when the key is of type {1}.. Looks up a localized string similar to Method calls are not allowed in restricted language mode or a Data section.. Looks up a localized string similar to Method invocation failed because [{0}] doesn't contain a method named '{1}'.. Looks up a localized string similar to Missing argument in parameter list.. Looks up a localized string similar to Array index expression is missing or not valid.. Looks up a localized string similar to The type name is missing the assembly name specification.. Looks up a localized string similar to The Catch block is missing its statement block.. Looks up a localized string similar to The Try statement is missing its Catch or Finally block.. Looks up a localized string similar to Missing close brace in data section statement.. Looks up a localized string similar to Missing '{' in switch statement.. Looks up a localized string similar to Missing closing '}' in statement block.. Looks up a localized string similar to The terminator '{0}' is missing from the multiline comment.. Looks up a localized string similar to Missing closing ')' after expression part of foreach loop.. Looks up a localized string similar to Missing closing ')' after expression in '{0}' statement.. Looks up a localized string similar to Missing closing ')' in expression.. Looks up a localized string similar to Missing ')' in function parameter list.. Looks up a localized string similar to Missing ')' in method call.. Looks up a localized string similar to Missing closing ')' in subexpression.. Looks up a localized string similar to Missing ')' after expression in switch statement.. Looks up a localized string similar to Missing ']' after array index expression.. Looks up a localized string similar to Missing '=' operator after key in hash literal.. Looks up a localized string similar to The "=" operator is missing after a named argument.. Looks up a localized string similar to Missing expression after '{0}' in pipeline element.. Looks up a localized string similar to Missing expression after '{0}' in loop.. Looks up a localized string similar to Missing expression after unary operator '{0}'.. Looks up a localized string similar to Missing expression after '{0}'.. Looks up a localized string similar to Missing statement after '=' in named argument.. Looks up a localized string similar to Cannot process 'switch' statement because of missing filename argument to -file option.. Looks up a localized string similar to Missing file specification after redirection operator.. Looks up a localized string similar to The Finally block is missing its statement block.. Looks up a localized string similar to Missing expression in foreach loop.. Looks up a localized string similar to Missing statement body in foreach loop.. Looks up a localized string similar to Missing function body in function declaration.. Looks up a localized string similar to Missing 'in' after variable in foreach loop.. Looks up a localized string similar to Missing key before '=' in hash literal.. Looks up a localized string similar to Missing statement body in {0} loop.. Looks up a localized string similar to Missing name after {0} keyword.. Looks up a localized string similar to Missing statement block after '{0}'.. Looks up a localized string similar to Missing the opening brace "{" in the Data section.. Looks up a localized string similar to Missing opening '(' after keyword '{0}'.. Looks up a localized string similar to Missing '(' after '{0}' in if statement.. Looks up a localized string similar to Missing property name after reference operator.. Looks up a localized string similar to Property reference or expression is missing or not valid.. Looks up a localized string similar to Missing statement body after keyword '{0}'.. Looks up a localized string similar to Missing statement block after {0} ( condition ).. Looks up a localized string similar to Missing statement block after 'else' keyword.. Looks up a localized string similar to The Data section is missing its statement block.. Looks up a localized string similar to Missing statement after '=' in hash literal.. Looks up a localized string similar to Missing condition in switch statement clause.. Looks up a localized string similar to Missing statement block in switch statement clause.. Looks up a localized string similar to Missing expression after '(' in switch statement.. Looks up a localized string similar to The terminator '#>' is missing from the multiline comment.. Looks up a localized string similar to The 'trap' statement was incomplete. A trap statement requires a body.. Looks up a localized string similar to Incomplete 'try' statement. A try statement requires a body.. Looks up a localized string similar to The Try statement is missing its statement block.. Looks up a localized string similar to Missing type literal.. Looks up a localized string similar to Missing type name after '['.. Looks up a localized string similar to The SupportedCommand parameter of the Data section is missing a value. Supply a cmdlet or function name to the parameter.. Looks up a localized string similar to Missing variable name after foreach.. Looks up a localized string similar to Missing while or until keyword in do loop.. Looks up a localized string similar to A switch statement can have only one default clause.. Looks up a localized string similar to You cannot index into a {0} dimensional array with index [{1}].. Looks up a localized string similar to [ref] cannot be applied to a variable that does not exist.. Looks up a localized string similar to Cannot expand the splatted variable '@{0}'. Splatted variables cannot be used as part of a property or array expression. Assign the result of the expression to a temporary variable then splat the temporary variable instead.. Looks up a localized string similar to The operation '[{0}] {1} [{2}]' is not defined.. Looks up a localized string similar to Unable to assign to an index into an object of type {0}.. Looks up a localized string similar to Cannot index into a null array.. Looks up a localized string similar to Index operation failed; the array index evaluated to null.. Looks up a localized string similar to A number cannot be both a long and floating point.. Looks up a localized string similar to A command is referenced that is not allowed. Only convertfrom-* commands are supported in restricted language mode or a Data section.. Looks up a localized string similar to The param statement cannot be used if arguments were specified in the function declaration.. Looks up a localized string similar to Use `{ instead of { in variable names.. Looks up a localized string similar to The '{0}' operator failed: {1}.. Looks up a localized string similar to Operator '{0}' is not supported for type '{1}'.. Looks up a localized string similar to The '{0}' operator is not allowed in restricted language mode or a Data section.. Looks up a localized string similar to The '{0}' operator works only on numbers. The operand is a '{1}'.. Looks up a localized string similar to The '{0}' operator works only on variables or on properties.. Looks up a localized string similar to The {0} attribute can be specified only on a hash literal node.. Looks up a localized string similar to output stream. Looks up a localized string similar to Parallel and sequence blocks are not allowed in restricted language mode or a Data section.. Looks up a localized string similar to The '-parallel' parameter can be used only within a workflow.. Looks up a localized string similar to Parameter attributes need to be a constant or a script block.. Looks up a localized string similar to Parameter declarations are not allowed in restricted language mode or a Data section.. Looks up a localized string similar to Assignment failed because [{0}] doesn't contain a settable property '{1}()'.. Looks up a localized string similar to Parameter {0} requires an argument.. Looks up a localized string similar to A switch statement must have one of '-file filename' or '( expression )'.. Looks up a localized string similar to Program '{0}' failed to run: {1}{2}.. Looks up a localized string similar to '{0}' is a ReadOnly property.. Looks up a localized string similar to Property '{0}' cannot be found on this object; make sure it exists and is settable.. Looks up a localized string similar to Property '{0}' cannot be found for type '{1}'.. Looks up a localized string similar to Property '{0}' cannot be found on this object. Make sure that it exists.. Looks up a localized string similar to Property references are not allowed in restricted language mode or a Data section.. Looks up a localized string similar to Cannot set property. Property setting is supported only on core types in this language mode.. Looks up a localized string similar to Redirection to '{0}' failed: {1}. Looks up a localized string similar to The '{0}' operator is reserved for future use.. Looks up a localized string similar to Redirection is not allowed in restricted language mode or a Data section.. Looks up a localized string similar to Cannot use [ref] with other types in a type constraint.. Looks up a localized string similar to Cannot have two [ref] in a type sequence.. Looks up a localized string similar to [ref] can only be the final type in type conversion sequence.. Looks up a localized string similar to Argument must be constant.. Looks up a localized string similar to The argument for the {0} parameter is not valid. Specify a valid string argument.. Looks up a localized string similar to The argument for the Module parameter is not valid. {0}. Looks up a localized string similar to The argument for the Version parameter is not valid. Specify a valid Windows PowerShell version, in the format major.minor version.. Looks up a localized string similar to The '{0}' keyword is not supported in this version of the language.. Looks up a localized string similar to There is no Runspace available to run scripts in this thread. You can provide one in the DefaultRunspace property of the System.Management.Automation.Runspaces.Runspace type. The script block you attempted to invoke was: {0}. Looks up a localized string similar to Script block literals are not allowed in restricted language mode or a Data section.. Looks up a localized string similar to The syntax is not supported by this runspace. This might be because it is in no-language mode.. Looks up a localized string similar to Processing halted; script was too complicated. Looks up a localized string similar to Do not report this error, just continue with the next script statement.. Looks up a localized string similar to S&ilently Continue. Looks up a localized string similar to The splatting operator '@' cannot be used to reference variables in an expression. '@{0}' can be used only as an argument to a command. To reference variables in an expression use '${0}'.. Looks up a localized string similar to Splatted variables like '@{0}' cannot be part of a comma-separated list of arguments.. Looks up a localized string similar to The {0} for this command is already redirected.. Looks up a localized string similar to The function or command was called as if it were a method. Parameters should be separated by spaces. For information about parameters, see the about_Parameters Help topic.. Looks up a localized string similar to String multiplication results with more than "{0}" characters are not allowed in restricted language mode or a Data section.. Looks up a localized string similar to Pause the current pipeline and return to the command prompt. Type exit to resume operation when you are done.. Looks up a localized string similar to &Suspend. Looks up a localized string similar to The switch statement is not allowed in restricted language mode or a Data section.. Looks up a localized string similar to The string is missing the terminator: {0}.. Looks up a localized string similar to At char:{0}. Looks up a localized string similar to At {0}:{1} char:{2} + {3}. Looks up a localized string similar to line. Looks up a localized string similar to Executable script code found in signature block.. Looks up a localized string similar to Not all parse errors were reported. Correct the reported errors and try again.. Looks up a localized string similar to ! CALL function '{0}'. Looks up a localized string similar to ! CALL function '{0}' (defined in file '{1}'). Looks up a localized string similar to ! CALL script '{0}'. Looks up a localized string similar to ! CALL scriptblock.. Looks up a localized string similar to ! CALL method '{0}'. Looks up a localized string similar to ! Setting parameterized property '{0}'. Looks up a localized string similar to {0,4}+ {1}. Looks up a localized string similar to ! SET-MULTIPLE ${0} = '{1}'.. Looks up a localized string similar to ! SET-MULTIPLE ${0} assigned remaining {1} values.. Looks up a localized string similar to ! SET ${0} = '{1}'.. Looks up a localized string similar to ! Trap or Catch on matching exception [{0}]. Looks up a localized string similar to ! Trap or Catch generic; caught [{0}]. Looks up a localized string similar to ! Trap or Catch on [{0}]; subclass of exception [{1}]. Looks up a localized string similar to The Trap statement is not allowed in restricted language mode or a Data section.. Looks up a localized string similar to The Try statement is not allowed in restricted language mode or a Data section.. Looks up a localized string similar to Unexpected type [{0}] on the parameter statement.. Looks up a localized string similar to The type {0} is not allowed in restricted language mode or a Data section.. Looks up a localized string similar to Unable to find type [{0}]: make sure that the assembly containing this type is loaded.. Looks up a localized string similar to Unable to find type [{0}]: Make sure that the assembly containing this type is loaded. Details: {1}. Looks up a localized string similar to Unexpected attribute '{0}'.. Looks up a localized string similar to The character is not allowed after a here string header but before the end of the line.. Looks up a localized string similar to Unexpected keyword '{0}'.. Looks up a localized string similar to Unexpected token '{0}' in expression or statement.. Looks up a localized string similar to Internal error - unexpected unary operator {0}.. Looks up a localized string similar to Unknown assignment operator '{0}'.. Looks up a localized string similar to Unrecognized token in source text.. Looks up a localized string similar to Unrecoverable error in Windows PowerShell.. Looks up a localized string similar to A Using variable cannot be retrieved. A Using variable can be used only with Invoke-Command, Start-Job, or InlineScript in the script workflow. When it is used with Invoke-Command, the Using variable is valid only if the script block is invoked on a remote computer.. Looks up a localized string similar to The variable '${0}' cannot be retrieved because it has not been set.. Looks up a localized string similar to A variable that cannot be referenced in restricted language mode or a Data section is being referenced. Variables that can be referenced include the following: $PSCulture, $PSUICulture, $true, $false, and $null.. Looks up a localized string similar to verbose stream. Looks up a localized string similar to [void] cannot be used as a parameter type, or on the left side of an assignment.. Looks up a localized string similar to Warning stream. Looks up a localized string similar to White space is not allowed before the string terminator.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Input name "{0}" is ambiguous. It can be resolved to multiple matched methods. Possible matches include:{1}.. Looks up a localized string similar to Input name "{0}" is ambiguous. It can be resolved to multiple matched members. Possible matches include:{1}.. Looks up a localized string similar to Retrieve the value for key '{0}'. Looks up a localized string similar to Invoke method '{0}' with arguments: {1}. Looks up a localized string similar to Invoke method '{0}'. Looks up a localized string similar to Retrieve the value for property '{0}'. Looks up a localized string similar to InputObject: {0}. Looks up a localized string similar to Cannot operate on a 'null' input object.. Looks up a localized string similar to Input name "{0}" cannot be resolved to a method.. Looks up a localized string similar to Cannot invoke a method in the restricted language mode.. Looks up a localized string similar to The -WhatIf and -Confirm parameters are not supported for script blocks.. Looks up a localized string similar to The '{0}' operation is not allowed in the RestrictedLanguage mode.. Looks up a localized string similar to An operator is required to compare the two specified values. Include a valid operator and retry.. Looks up a localized string similar to Input name "{0}" cannot be resolved to a property.. Looks up a localized string similar to Input name "{0}" can be resolved to no member.. Looks up a localized string similar to The specified operator requires both the -Property and -Value parameters. Supply both parameters and retry.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Cannot create the module {0} due to the following: {1}. Use a different argument for the -OutputModule parameter and retry.. Looks up a localized string similar to The directory '{0}' already exists. Use the -Force parameter if you want to overwrite the directory and files within the directory.. Looks up a localized string similar to The module cannot be loaded because it has been generated with an incompatible version of {0} cmdlet. Generate the module with the {0} cmdlet from the current session and retry.. Looks up a localized string similar to Cannot perform operation because the wildcard path {0} did not resolve to a file.. Looks up a localized string similar to Cannot perform operation because the path resolved to more than one file. This command cannot operate on multiple files.. Looks up a localized string similar to Cannot open file because the current provider ({0}) cannot open a file.. Looks up a localized string similar to unknown Encoding {0}; legal values are {1}.. Looks up a localized string similar to File {0} already exists and {1} was specified.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Cannot continue to run cmdlet because all cmdlet execution was stopped by the Stop policy. Determine why cmdlet run was stopped.. Looks up a localized string similar to An error occurred creating the pipeline. Looks up a localized string similar to Cannot process the cmdlet instance because the cmdlet instances is being used by another pipeline. Please contact Microsoft Support Services.. Looks up a localized string similar to This pipeline does not support disconnect-connect semantics.. Looks up a localized string similar to Cannot perform the operation because the pipeline is started. Stop the pipeline and try the operation again.. Looks up a localized string similar to Cannot run the pipeline because the first cmdlet in the pipeline is trying to read input from a previous cmdlet. Either modify the first cmdlet, remove the first cmdlet, or add the cmdlet whose output is needed by the first cmdlet, then execute the pipeline again.. Looks up a localized string similar to Cannot process the cmdlet number. The ReadFromCommand function must specify the Id of a cmdlet that has already been added to the pipeline. Please contact Microsoft Support Services.. Looks up a localized string similar to Runspace object has a null remote command associated with it. A disconnected RemotePipeline object cannot be created because there is no remote command to connect to.. Looks up a localized string similar to Cannot read the output specified by the ReadFromCommand and ReadErrorQueue functions because another cmdlet is already reading that output. Please contact Microsoft Support Services.. Looks up a localized string similar to Cannot run pipeline because there are no commands. Add at least one command to the pipeline and run it again.. Looks up a localized string similar to Information({0}): "{1}". Looks up a localized string similar to NonTerminatingError({0}): "{1}". Looks up a localized string similar to ParameterBinding({0}): name="{1}"; value="{2}". Looks up a localized string similar to TerminatingError({0}): "{1}". Looks up a localized string similar to Cannot connect this pipeline because it is not in the disconnected state.. Looks up a localized string similar to Cannot complete pipeline operation because it hasn't been started yet. You must call the Begin() method before calling End() on a steppable pipeline.. Looks up a localized string similar to A cmdlet threw an exception after calling ThrowTerminatingError. The first exception was "{0}" with stack trace "{1}". The second exception was "{2}" with stack trace "{3}". Determine why these exceptions were thrown and try again.. Looks up a localized string similar to The WriteObject and WriteError methods cannot be called from outside the overrides of the BeginProcessing, ProcessRecord, and EndProcessing methods, and only from that same thread. Validate that the cmdlet makes these calls correctly, or please contact Microsoft Support Services.. Looks up a localized string similar to The WriteObject and WriteError methods cannot be called after the pipeline has been closed. Please contact Microsoft Support Services.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to When the runspace is set to re-use thread, the apartment state in the invocation settings must match the runspace.. Looks up a localized string similar to When the runspace is set to use the current thread, the apartment state in the invocation settings must match that of the current thread.. Looks up a localized string similar to This {0} object was not created by calling {1} on this Windows PowerShell instance.. Looks up a localized string similar to This Windows PowerShell object cannot be connected because it is not associated with a remote run space or run space pool.. Looks up a localized string similar to The PSJobProxy object can only be used for remote commands that return a job object.. Looks up a localized string similar to There is no Runspace available to run commands in this thread. You can provide one in the DefaultRunspace property of the System.Management.Automation.Runspaces.Runspace type. The command you attempted to invoke was: {0}. Looks up a localized string similar to There is no Runspace available to run commands in this thread. You can provide one in the DefaultRunspace property of the System.Management.Automation.Runspaces.Runspace type. The current Windows PowerShell instance contains no command to invoke.. Looks up a localized string similar to Connection attempt to remote command failed.. Looks up a localized string similar to The running command has been disconnected but is still running on the remote server. Reconnect to get command operation status and output data.. Looks up a localized string similar to The operation cannot be performed because a command has already been started. Wait for the command to complete, or stop it, and then try the operation again.. Looks up a localized string similar to The operation cannot be performed because the current Windows PowerShell is in the Disconnected state. First connect this Windows PowerShell and wait for the command to complete or stop it.. Looks up a localized string similar to The operation cannot be performed because a command is currently stopping. Wait for the command to complete stopping, and then try the operation again.. Looks up a localized string similar to GetJobForCommand is not supported when there is more than one command in the Windows PowerShell instance. Looks up a localized string similar to The Command property of a PowerShell object cannot be empty.. Looks up a localized string similar to The state of the current Windows PowerShell instance is not valid for this operation.. Looks up a localized string similar to Cannot perform operation because the runspace is not in the '{0}' state. Current state of runspace is '{1}'.. Looks up a localized string similar to State of Windows PowerShell instance is not valid to create a nested Windows PowerShell instance. Nested Windows PowerShell should be created only for a running Windows PowerShell instance.. Looks up a localized string similar to The operation cannot be performed because the current Windows PowerShell is in the Disconnected state. First connect this Windows PowerShell and then try again.. Looks up a localized string similar to A job object cannot be reused.. Looks up a localized string similar to A job cannot be started when it is already running.. Looks up a localized string similar to A job object can only be used once. Looks up a localized string similar to A command with AsJob equal to false cannot be run through a PSJobProxy.. Looks up a localized string similar to You can only begin receiving data on a PSJobProxy instance when it has been created with data streaming disabled. This operation can run only once.. Looks up a localized string similar to The keys in the dictionary must be strings.. Looks up a localized string similar to Nested Windows PowerShell cannot be invoked asynchronously. Use Invoke method.. Looks up a localized string similar to No commands are specified.. Looks up a localized string similar to A Windows PowerShell object cannot be created that uses the current runspace because there is no current runspace available. The current runspace may be in the process of being initialized, such as when it is created with an Initial Session State.. Looks up a localized string similar to PSJobProxy currently supports only PSWorkflowInvocationSettings.. Looks up a localized string similar to This operation is currently not supported in the remoting scenario.. Looks up a localized string similar to A command is required to add a parameter. A command must be added to the Windows PowerShell instance before adding a parameter.. Looks up a localized string similar to PSChildJobProxy does not support control methods.. Looks up a localized string similar to PSJobProxy does not support the Unblock operation.. Looks up a localized string similar to The runspace pool specified is not in an opened state.. Looks up a localized string similar to Either a runspace or runspace pool must be assigned to PSJobProxy before it can be started.. Looks up a localized string similar to Support for interactive jobs is not available. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Cannot process the argument because {0} may not be a negative value.. Looks up a localized string similar to Cannot process the argument because {0} may not be null or an empty string value.. Looks up a localized string similar to ParentActivityId cannot be the same as the ActivityId.. Looks up a localized string similar to Cannot set percent because {0} cannot be greater than 100.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Cannot use the interface because the ISecurityDescriptorCmdletProvider interface is not supported by this provider.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to The proxy command cannot be generated because the CommandMetadata has no name.. Looks up a localized string similar to The 'help' parameter is not recognized as a valid HelpInfo object created by the 'get-help' command.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to A command is required to add a parameter. A command must be added to {0} before adding a parameter.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Cannot convert value from type {0} to type {1}.. Looks up a localized string similar to The index specified is less than zero or greater than the number of items in the buffer. Index should be in the range {0}-{1}.. Looks up a localized string similar to The SerializeInput property can only be set for PSDataCollections of PSObject. Set the SerializeInput property to false or change the collection type to be of PSObject.. Looks up a localized string similar to Cannot convert a null reference to a value type.. Looks up a localized string similar to Objects cannot be added to a closed buffer. Make sure the buffer is open for Add and Insert operations to succeed.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to The following unknown list modifier was detected: '{0}'. Valid list modifiers are Add, Remove, and Replace.. Looks up a localized string similar to Cannot apply update, object is not a supported collection type.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to The security identifier is not allowed to be the primary group of this object.. Looks up a localized string similar to Handle specified is not valid.. Looks up a localized string similar to The security identifier is not allowed to be the owner of this object.. Looks up a localized string similar to Unable to perform a security operation on an object that has no associated security. This can happen when trying to get an ACL of an anonymous kernel object.. Looks up a localized string similar to Method failed with unexpected error code {0}.. Looks up a localized string similar to Add Property Value At. Looks up a localized string similar to Item: {0} Property: {1} At: {2}. Looks up a localized string similar to Illegal enum value: {0}.. Looks up a localized string similar to A name argument must be specified.. Looks up a localized string similar to The specified RegistryValueKind is a value that is not valid.. Looks up a localized string similar to Registry key name must start with a valid base key name.. Looks up a localized string similar to The specified registry key does not exist.. Looks up a localized string similar to A non-empty subkey name must be specified.. Looks up a localized string similar to Registry subkeys should not be greater than 255 characters.. Looks up a localized string similar to RegistryKey.SetValue does not support arrays of type '{0}'. Only Byte[] and String[] are supported.. Looks up a localized string similar to The type of the value object did not match the specified RegistryValueKind or the object could not be properly converted.. Looks up a localized string similar to RegistryKey.SetValue does not allow a String[] that contains a null String reference.. Looks up a localized string similar to Cannot delete a subkey tree because the subkey does not exist.. Looks up a localized string similar to No value exists with that name.. Looks up a localized string similar to The length of the specified value name exceeds the maximum of 16383 characters.. Looks up a localized string similar to A value argument must be specified.. Looks up a localized string similar to The length of the specified value data exceeds the maximum of 1 MB.. Looks up a localized string similar to The subkey argument is not valid.. Looks up a localized string similar to The specified privilege name is not valid.. Looks up a localized string similar to The specified RegistryKeyPermissionCheck value is not valid.. Looks up a localized string similar to The SafeHandle is not valid.. Looks up a localized string similar to The specified registry subkey does not exist.. Looks up a localized string similar to A transaction argument must be specified.. Looks up a localized string similar to The at parameter must be an integer to index a specific property value.. Looks up a localized string similar to Clear Item. Looks up a localized string similar to Item: {0}. Looks up a localized string similar to Clear Property. Looks up a localized string similar to Item: {0} Property: {1}. Looks up a localized string similar to Operation not processed. Location provided does not allow this operation.. Looks up a localized string similar to Copy Key. Looks up a localized string similar to Item: {0} Destination: {1}. Looks up a localized string similar to Copy property.. Looks up a localized string similar to Item: {0} SourceProperty: {1} DestinationItem: {2} DestinationProperty: {3}. Looks up a localized string similar to (default). Looks up a localized string similar to The operation cannot be performed because the destination path is subordinate to the source path.. Looks up a localized string similar to Operation not allowed on destination location.. Looks up a localized string similar to The software settings for the current user.. Looks up a localized string similar to The configuration settings for the local computer. Looks up a localized string similar to Incorrect thread for enabling or disabling a privilege.. Looks up a localized string similar to Privilege must be reverted before changing its state again.. Looks up a localized string similar to The specified transaction or Transaction.Current must match the transaction used to create or open this TransactedRegistryKey.. Looks up a localized string similar to Cannot create a KTM handle without a Transaction.Current or specified transaction.. Looks up a localized string similar to The object does not contain a security descriptor.. Looks up a localized string similar to The TransactedRegistryKey object is not associated with a transaction because it is for a predefined key.. Looks up a localized string similar to Registry key has subkeys and recursive removes are not supported by this method.. Looks up a localized string similar to Remote registry operations are not allowed with transactions.. Looks up a localized string similar to A key at this path already exists. Looks up a localized string similar to Key {0} has been created, however default value could not be set.. Looks up a localized string similar to The registry key at the specified path does not exist.. Looks up a localized string similar to Move Item. Looks up a localized string similar to Item: {0} Destination: {1}. Looks up a localized string similar to Move Property. Looks up a localized string similar to Item: {0} SourceProperty: {1} DestinationItem: {2} DestinationProperty: {3}. Looks up a localized string similar to Unable to create a drive with the specified root. The root path does not exist.. Looks up a localized string similar to New Item. Looks up a localized string similar to Item: {0}. Looks up a localized string similar to Item: {0} Type: {1}. Looks up a localized string similar to New Property. Looks up a localized string similar to Item: {0} Property: {1}. Looks up a localized string similar to Registry transactions are not supported on this platform.. Looks up a localized string similar to Cannot access a closed registry key.. Looks up a localized string similar to The property already exists.. Looks up a localized string similar to Property {0} does not exist at path {1}.. Looks up a localized string similar to The property is not a multi-valued property. To remove this property, use Remove-ItemProperty.. Looks up a localized string similar to The property is not a multi-valued property and values cannot be added to it. To change the value use Set-ItemProperty.. Looks up a localized string similar to Remove key.. Looks up a localized string similar to Item: {0}. Looks up a localized string similar to Remove Property. Looks up a localized string similar to Item: {0} Property: {1}. Looks up a localized string similar to Remove Property Value At. Looks up a localized string similar to Item: {0} Property: {1} At: {2}. Looks up a localized string similar to Rename Item. Looks up a localized string similar to The item cannot be renamed because an item with that name already exists in the same container.. Looks up a localized string similar to Item: {0} NewName: {1}. Looks up a localized string similar to Rename property.. Looks up a localized string similar to Item: {0} SourceProperty: {1} DestinationProperty: {2}. Looks up a localized string similar to Requested registry access is not allowed.. Looks up a localized string similar to Set Item. Looks up a localized string similar to Item: {0} Value: {1}. Looks up a localized string similar to Set Property. Looks up a localized string similar to Item: {0} Property: {1}. Looks up a localized string similar to Set Property Value At. Looks up a localized string similar to Item: {0} Property: {1} At: {2}. Looks up a localized string similar to Operation not allowed on source location.. Looks up a localized string similar to Transaction related error {0} occurred.. Looks up a localized string similar to Could not bind parameter 'Type'. Could not convert "{0}" to "{1}". The possible enumeration values are "String, ExpandString, Binary, DWord, MultiString, QWord, Unknown".. Looks up a localized string similar to Access to the registry key '{0}' is denied.. Looks up a localized string similar to Cannot write to the registry key.. Looks up a localized string similar to Unknown error: {0}.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to A SessionStateProxy method call is in progress. Concurrent SessionStateProxy method calls are not allowed.. Looks up a localized string similar to Cannot connect PSSession because it is not in Disconnected state or is not available for connection.. Looks up a localized string similar to Cannot open runspace because runspace is not in the BeforeOpen state. Current state of runspace is '{0}'.. Looks up a localized string similar to This property cannot be changed after the runspace has been opened.. Looks up a localized string similar to One or more errors occurred during processing the module '{0}' specified in the InitialSessionState object used to create this runspace. See the ErrorRecords property for a complete list of errors.. Looks up a localized string similar to Pipeline not run because a pipeline is already running. Pipelines cannot be run concurrently.. Looks up a localized string similar to The Connect operation is not supported on local runspaces.. Looks up a localized string similar to Debug stream redirection is not supported on the targeted remote computer.. Looks up a localized string similar to Disconnect and Connect operations are not supported on local run spaces.. Looks up a localized string similar to A non-remoted runspace cannot be disconnected.. Looks up a localized string similar to The disconnection operation is not supported on the remote computer. To support disconnecting, the remote computer must be running Windows PowerShell 3.0 or a later version of Windows PowerShell.. Looks up a localized string similar to One or more errors occurred processing the module '{0}' specified in the InitialSessionState object used to create this runspace. See the ErrorRecords property for a complete list of errors. The first error was: {1}. Looks up a localized string similar to Value for parameter cannot be PipelineResultTypes.None or PipelineResultTypes.Output.. Looks up a localized string similar to State of pipeline is not valid for this operation.. Looks up a localized string similar to Cannot construct RemoteRunspace. Passed in RunspacePool object is not valid.. Looks up a localized string similar to State of runspace is not valid for this operation.. Looks up a localized string similar to The thread options can only be changed if the apartment state is MTA, the current options are UseNewThread or UseCurrentThread and the new value is ReuseThread.. Looks up a localized string similar to Valid values for parameter are PipelineResultTypes.Output or PipelineResultTypes.Null. Looks up a localized string similar to Valid value for parameter is PipelineResultTypes.Output.. Looks up a localized string similar to Nested pipeline cannot be invoked asynchronously. Use Invoke method.. Looks up a localized string similar to Nested pipeline should run only from a running pipeline.. Looks up a localized string similar to Pipeline does not contain any command.. Looks up a localized string similar to There is no disconnected command associated with this runspace.. Looks up a localized string similar to Pipeline cannot be invoked while a SessionStateProxy method call is in progress.. Looks up a localized string similar to A pipeline is already running. Concurrent SessionStateProxy method call is not allowed.. Looks up a localized string similar to The command cannot be completed. Script invocation is not supported on this session configuration. This might be because it is in no-language mode.. Looks up a localized string similar to Parameter name or value must be specified.. Looks up a localized string similar to Cannot invoke pipeline because it has been invoked earlier.. Looks up a localized string similar to Runspace cannot be closed while a SessionStateProxy method call is in progress.. Looks up a localized string similar to Cannot perform operation because runspace is not in the Opened state. Current state of runspace is '{0}'.. Looks up a localized string similar to Cannot invoke pipeline because runspace is not in the Opened state. Current state of runspace is '{0}'.. Looks up a localized string similar to Cannot connect pipeline because runspace is not in the Opened state. Current state of runspace is '{0}'.. Looks up a localized string similar to The session is busy. You will be connected to the session as soon as it is available. To cancel the Enter-PSSession command, press Ctrl-C.. Looks up a localized string similar to {0} cannot be false when language mode is {1} or {2}.. Looks up a localized string similar to Verbose stream redirection is not supported on the targeted remote computer.. Looks up a localized string similar to Warning stream redirection is not supported on the targeted remote computer.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Dictates when confirmation should be requested. Confirmation is requested when the ConfirmImpact of the operation is equal to or greater than $ConfirmPreference. If $ConfirmPreference is None, actions will only be confirmed when Confirm is specified.. Looks up a localized string similar to Name of the current console file.. Looks up a localized string similar to Dictates action taken when an Debug message is delivered.. Looks up a localized string similar to Execution status of last command.. Looks up a localized string similar to Culture of the current Windows PowerShell Session.. Looks up a localized string similar to UI Culture of the current Windows PowerShell Session.. Looks up a localized string similar to Dictates action taken when an error message is delivered.. Looks up a localized string similar to Dictates the view mode to use when displaying errors.. Looks up a localized string similar to The execution objects available to cmdlets.. Looks up a localized string similar to Dictates the limit of enumeration on formatting IEnumerable objects.. Looks up a localized string similar to Folder containing the current user's profile.. Looks up a localized string similar to The ShellID identifies the current shell. This is used by #Requires.. Looks up a localized string similar to Dictates what type of prompt should be displayed for the current nesting level.. Looks up a localized string similar to The text encoding used when piping text to a native executable.. Looks up a localized string similar to Press Enter to continue.... Looks up a localized string similar to Current process ID.. Looks up a localized string similar to Parent process ID.. Looks up a localized string similar to Dictates action taken when Progress Records are delivered.. Looks up a localized string similar to Variable to hold all default <cmdlet:parameter, value> pairs.. Looks up a localized string similar to Variable to hold the Email Server. This can be used instead of HostName parameter in Send-MailMessage cmdlet.. Looks up a localized string similar to Parent folder of the host application of this Runspace.. Looks up a localized string similar to This is a reference to the host of this Runspace.. Looks up a localized string similar to Version information for current Windows PowerShell session.. Looks up a localized string similar to Causes errors to be displayed with a description of the error class.. Looks up a localized string similar to Causes errors to be displayed with the inner exceptions.. Looks up a localized string similar to Causes errors to be displayed with the source of the error.. Looks up a localized string similar to Causes errors to be displayed with a stack trace.. Looks up a localized string similar to Dictates the action taken when a Verbose message is delivered.. Looks up a localized string similar to Dictates the action taken when a Warning message is delivered.. Looks up a localized string similar to If true, WhatIf is considered to be enabled for all commands.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to This {0} object was not created by calling {1} on this RunspacePool instance.. Looks up a localized string similar to This runspace pool cannot be connected because the corresponding server side runspace pool is connected to another client.. Looks up a localized string similar to Cannot open the runspace pool because it is not in the 'BeforeOpen' state. The current state is '{0}'.. Looks up a localized string similar to This runspace pool {0} is not configured to provide disconnected Windows PowerShell objects for commands running on the remote server. Use the RunspacePool class GetRunspacePools() static method to query the server and return runspace pool objects that are configured to do this.. Looks up a localized string similar to Cannot set the TypeTable data unless runspace pool is in the Disconnected or BeforeOpen state. Current state is {0}.. Looks up a localized string similar to Cannot perform operation because the runspace pool is in the Disconnected state.. Looks up a localized string similar to This property cannot be changed after the runspace pool has been opened.. Looks up a localized string similar to The disconnect operation is not supported on the server. The server must be running Windows PowerShell version 3 or greater for remote runspace pool disconnect support.. Looks up a localized string similar to Cannot perform operation because the runspace pool is not in the '{0}' state. The current state is '{1}'.. Looks up a localized string similar to The state of the runspace pool is not valid for this operation.. Looks up a localized string similar to The maximum pool size cannot be less than 1.. Looks up a localized string similar to The minimum pool size cannot be greater than the maximum pool size.. Looks up a localized string similar to The minimum pool size cannot be less than 1.. Looks up a localized string similar to This runspace does not support disconnect and connect operations.. Looks up a localized string similar to Cannot release the runspace to this pool as the runspace does not belong to this pool.. Looks up a localized string similar to The runspace pool is closed.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to AuthorizationManager check failed.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to {0} attribute was expected.. Looks up a localized string similar to Value of depth parameter must be greater than or equal to 1.. Looks up a localized string similar to The data in the command exceeded the maximum permitted by the session configuration. The allowed maximum is {0}MB. Change the input, use a different session configuration, or change the "{1}" and "{2}" properties of the session configuration on the remote computer.. Looks up a localized string similar to Serialized xml is nested too deeply.. Looks up a localized string similar to Deserialization of Encrypted Secure String failed. Looks up a localized string similar to Key for dictionary entry is not specified.. Looks up a localized string similar to Value for dictionary entry is not specified.. Looks up a localized string similar to Name attribute for dictionary key is incorrectly specified.. Looks up a localized string similar to Name attribute for dictionary value is incorrectly specified.. Looks up a localized string similar to {0} XML tag is not recognized.. Looks up a localized string similar to The parameter value "{0}" is not a valid encrypted string.. Looks up a localized string similar to Could not decrypt data. The data was not encrypted with this key.. Looks up a localized string similar to The {0} is invalid. The valid {0} length should be 128 bits, 192 bits or 256 bits.. Looks up a localized string similar to Current Node type is {0}. Expected type is {1}.. Looks up a localized string similar to The contents of the {0} primitive type are not valid.. Looks up a localized string similar to No object found for referenceId {0}. Looks up a localized string similar to Cannot process names because no TypeNames were found for referenceId {0}.. Looks up a localized string similar to Version of PSObject is not valid.. Looks up a localized string similar to Null is specified as dictionary key.. Looks up a localized string similar to Invalid type of key: {0}. PSPrimitiveDictionary class accepts only keys of type System.String. Looks up a localized string similar to Invalid type of value: {0}. PSPrimitiveDictionary class accepts only values of types that are serializable in all major-version compatible versions of PowerShell remoting.. Looks up a localized string similar to There are no more objects to deserialize.. Looks up a localized string similar to Serializer was closed.. Looks up a localized string similar to Version of incoming PSObject is {0}. Expected value is 1.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Clear item.. Looks up a localized string similar to Item: {0}. Looks up a localized string similar to Copy Item. Looks up a localized string similar to Item: {0} Destination: {1}. Looks up a localized string similar to New Item. Looks up a localized string similar to Item: {0} Type: {1} Value: {2}. Looks up a localized string similar to Remove Item. Looks up a localized string similar to Item: {0}. Looks up a localized string similar to Rename Item. Looks up a localized string similar to Item: {0} NewName: {1}. Looks up a localized string similar to Set Item. Looks up a localized string similar to Item: {0} Value: {1}. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to The AllScope option cannot be removed from the alias '{0}'.. Looks up a localized string similar to The alias is not allowed, because an alias with the name '{0}' already exists.. Looks up a localized string similar to Alias {0} cannot be made constant after it has been created. Aliases can only be made constant at creation time.. Looks up a localized string similar to Drive containing a view of the aliases stored in session state.. Looks up a localized string similar to Alias {0} cannot be modified because it is constant.. Looks up a localized string similar to Alias {0} cannot be modified because it is read-only.. Looks up a localized string similar to Cannot find alias because alias '{0}' does not exist.. Looks up a localized string similar to Alias was not removed because alias {0} is constant or read-only.. Looks up a localized string similar to Alias is not writeable because alias {0} is read-only or constant and cannot be written to.. Looks up a localized string similar to Alias {0} cannot be created because alias capacity {1} has been exceeded for this scope.. Looks up a localized string similar to The alias is not allowed, because a command with the name '{0}' and command type '{1}' already exists.. Looks up a localized string similar to Cannot rename alias because alias {0} is read-only or constant.. Looks up a localized string similar to Cannot rename filter because filter {0} is read-only or constant.. Looks up a localized string similar to Cannot rename function because function {0} is read-only or constant.. Looks up a localized string similar to Cannot rename variable because variable {0} is read-only or constant.. Looks up a localized string similar to The dynamic parameters for the ClearContent operation cannot be retrieved from the '{0}' provider for path '{1}'. {2}. Looks up a localized string similar to Attempting to perform the ClearContent operation on the '{0}' provider failed for path '{1}'. {2}. Looks up a localized string similar to The dynamic parameters for the ClearItem operation cannot be retrieved from the '{0}' provider for path '{1}'. {2}. Looks up a localized string similar to Attempting to perform the ClearItem operation on the '{0}' provider failed for path '{1}'. {2}. Looks up a localized string similar to The dynamic parameters for the ClearProperty operation cannot be retrieved from the '{0}' provider for path '{1}'. {2}. Looks up a localized string similar to Attempting to perform the ClearProperty operation on the '{0}' provider failed for path '{1}'. {2}. Looks up a localized string similar to Cmdlet {0} cannot be modified because it is read-only.. Looks up a localized string similar to Provider operation stopped because the provider does not support this operation.. Looks up a localized string similar to Cannot register Cmdlet provider because a Cmdlet provider with name '{0}' already exists.. Looks up a localized string similar to Cannot access command because it is private. Looks up a localized string similar to Provider methods not processed. The ContainerCmdletProvider methods are not supported by this provider.. Looks up a localized string similar to Container cannot be copied onto existing leaf item.. Looks up a localized string similar to Container cannot be copied to another container. The -Recurse or -Container parameter is not specified.. Looks up a localized string similar to Cannot copy item. Item at the path '{0}' does not exist.. Looks up a localized string similar to The dynamic parameters for the CopyItem operation cannot be retrieved from the '{0}' provider for path '{1}'. {2}. Looks up a localized string similar to Attempting to perform the CopyItem operation on the '{0}' provider failed for path '{1}'. {2}. Looks up a localized string similar to Source and destination path did not resolve to the same provider.. Looks up a localized string similar to The dynamic parameters for the CopyProperty operation cannot be retrieved for the '{0}' provider for path '{1}'. {2}. Looks up a localized string similar to Attempting to perform the CopyProperty operation on the '{0}' provider failed for path '{1}'. {2}. Looks up a localized string similar to The provider does not support the use of credentials. Perform the operation again without specifying credentials.. Looks up a localized string similar to References to the null variable always return the null value. Assignments have no effect.. Looks up a localized string similar to A drive with the name '{0}' already exists.. Looks up a localized string similar to DriveCmdletProvider methods are not supported by this provider.. Looks up a localized string similar to Cannot process drive name because the drive name contains one or more characters that are not valid; ~ / \ . :. Looks up a localized string similar to Cannot find drive. A drive with the name '{0}' does not exist.. Looks up a localized string similar to Drive {0} cannot be created because drive capacity {1} has been exceeded for this scope.. Looks up a localized string similar to Drive '{0}' cannot be removed because the provider '{1}' prevented it.. Looks up a localized string similar to The drive containing a view of the environment variables for the process.. Looks up a localized string similar to CmdletProvider could not stream the results because no Cmdlet was specified to stream the error through.. Looks up a localized string similar to The FileSystem provider supports credentials only on the New-PSDrive cmdlet. Perform the operation again without specifying credentials.. Looks up a localized string similar to Cannot call method. The provider does not support the use of filters.. Looks up a localized string similar to The AllScope option cannot be removed from the filter '{0}'.. Looks up a localized string similar to Existing filter {0} cannot be made constant. Filters can be made constant only at creation time.. Looks up a localized string similar to Filter {0} cannot be modified because it is constant.. Looks up a localized string similar to Filter {0} cannot be modified because it is read-only.. Looks up a localized string similar to The AllScope option cannot be removed from the function '{0}'.. Looks up a localized string similar to Existing function {0} cannot be made constant. Functions can be made constant only at creation time.. Looks up a localized string similar to The drive containing a view of the functions stored in session state.. Looks up a localized string similar to Cannot modify function {0} because it is constant.. Looks up a localized string similar to Cannot modify function {0} because it is read-only.. Looks up a localized string similar to Cannot remove function {0} because it is constant.. Looks up a localized string similar to Cannot write to function {0} because it is read-only or constant.. Looks up a localized string similar to Function {0} cannot be created because function capacity {1} has been exceeded for this scope.. Looks up a localized string similar to Attempting to perform the GetChildName operation on the '{0}' provider failed for path '{1}'. {2}. Looks up a localized string similar to The dynamic parameters for the GetChildNames operation cannot retrieved from the '{0}' provider for path '{1}'. {2}. Looks up a localized string similar to Attempting to perform the GetChildNames operation on the '{0}' provider failed for path '{1}'. {2}. Looks up a localized string similar to The dynamic parameters for the GetChildItems operation cannot be retrieved from the '{0}' provider for path '{1}'. {2}. Looks up a localized string similar to Attempting to perform the GetChildItems operation on the '{0}' provider failed for path '{1}'. {2}. Looks up a localized string similar to The parameters {0} and {1} cannot be used together. Please specify only one parameter.. Looks up a localized string similar to The Tail parameter currently is only supported for the FileSystemProvider. Looks up a localized string similar to The dynamic parameters for the GetContentReader operation cannot be retrieved for the '{0}' provider for path '{1}'. {2}. Looks up a localized string similar to Content reader cannot be retrieved for the '{0}' provider for the path '{1}'. {2}. Looks up a localized string similar to The dynamic parameters for the GetContentWriter operation cannot be retrieved for the '{0}' provider for path '{1}'. {2}. Looks up a localized string similar to Content writer cannot be retrieved for the '{0}' provider for the path '{1}'. {2}. Looks up a localized string similar to The dynamic parameters for the GetItem operation cannot be retrieved from the '{0}' provider for path '{1}'. {2}. Looks up a localized string similar to Attempting to perform the GetItem operation on the '{0}' provider failed for path '{1}'. {2}. Looks up a localized string similar to Attempting to perform the GetParentPath operation on the '{0}' provider failed for path '{1}'. {2}. Looks up a localized string similar to The dynamic parameters for the GetProperty operation cannot be retrieved from the '{0}' provider for path '{1}'. {2}. Looks up a localized string similar to Attempting to perform the GetProperty operation on the '{0}' provider failed for path '{1}'. {2}. Looks up a localized string similar to Attempting to perform the GetSecurityDescriptor operation on the '{0}' provider failed for path '{1}'. {2}. Looks up a localized string similar to Global scope cannot be removed.. Looks up a localized string similar to Attempting to perform the HasChildItems operation on the '{0}' provider failed for the path '{1}'. {2}. Looks up a localized string similar to Home location for this provider is not set. To set the home location, call "(get-psprovider '{0}').Home = 'path'".. Looks up a localized string similar to Cannot perform the ClearContent operation. The ClearContent operation is not supported by this provider.. Looks up a localized string similar to Cannot call method. The content Seek method is not supported by this provider.. Looks up a localized string similar to Cannot use interface. The IContentCmdletProvider interface is not implemented by this provider.. Looks up a localized string similar to Cannot use interface. The IDynamicPropertyCmdletProvider interface is not implemented by this provider.. Looks up a localized string similar to Attempting to perform the InitializeDefaultDrives operation on the '{0}' provider failed.. Looks up a localized string similar to Cannot process returned information because the information returned from the provider Start method was for a different provider than the one passed.. Looks up a localized string similar to Cannot process returned information because the information returned from the provider Start method was null.. Looks up a localized string similar to The dynamic parameters for the InvokeDefaultAction operation cannot be retrieved from the '{0}' provider for path '{1}'. {2}. Looks up a localized string similar to Attempting to perform the InvokeDefaultAction operation on the '{0}' provider failed for path '{1}'. {2}. Looks up a localized string similar to Cannot use interface. The IPropertyCmdletProvider interface is not supported by this provider.. Looks up a localized string similar to The dynamic parameters for the IsItemContainer cannot be retrieved from the '{0}' provider for path '{1}'. {2}. Looks up a localized string similar to Attempting to perform the IsItemContainer operation on the '{0}' provider failed for path '{1}'. {2}. Looks up a localized string similar to Attempting to perform the IsValidPath operation on the '{0}' provider failed for path '{1}'. {2}. Looks up a localized string similar to Cannot call methods. The ItemCmdletProvider methods are not supported by this provider.. Looks up a localized string similar to The dynamic parameters for the ItemExists operation cannot be retrieved from the '{0}' provider for path '{1}'. {2}. Looks up a localized string similar to Attempting to perform the ItemExists operation on the '{0}' provider failed for path '{1}'. {2}. Looks up a localized string similar to Attempting to perform the MakePath operation operation on the '{0}' provider failed for path '{1}'. {2}. Looks up a localized string similar to The maximum number of aliases allowed in a session.. Looks up a localized string similar to The maximum number of drives allowed in a session.. Looks up a localized string similar to The maximum number of errors to retain in a session.. Looks up a localized string similar to The maximum number of functions allowed in a session.. Looks up a localized string similar to The maximum number of history objects to retain in a session.. Looks up a localized string similar to The maximum number of variables allowed in a session.. Looks up a localized string similar to The dynamic parameters for the MoveItem operation cannot be retrieved from the '{0}' provider for path '{1}'. {2}. Looks up a localized string similar to Cannot move the item because the destination resolved to multiple paths. Specify a destination path that resolves to a single destination and try again.. Looks up a localized string similar to Cannot move the item because the source path points to one or more items and the destination path is not a container. Validate that the destination path is a container and try again.. Looks up a localized string similar to Attempting to perform the MoveItem operation on the '{0}' provider failed for path '{1}'. {2}. Looks up a localized string similar to Cannot move because the source and destination paths did not resolve to the same provider.. Looks up a localized string similar to Cannot move because the destination path can resolve only to a single path.. Looks up a localized string similar to The dynamic parameters for the MoveProperty operation cannot be retrieved for the '{0}' provider for path '{1}'. {2}. Looks up a localized string similar to Attempting to perform the MoveProperty operation on the '{0}' provider failed for path '{1}'. {2}. Looks up a localized string similar to The path does not refer to a file system path.. Looks up a localized string similar to Cannot access command '{0}' because it is a private command. Looks up a localized string similar to The NavigationCmdletProvider methods are not supported by this provider.. Looks up a localized string similar to Cannot create drive. The provider does not support the use of credentials.. Looks up a localized string similar to Dynamic parameters for NewDrive cannot be retrieved for the '{0}' provider. {1}. Looks up a localized string similar to Attempting to perform the NewDrive operation on the '{0}' provider failed for the drive with root '{1}'. {2}. Looks up a localized string similar to Creation failed because the provider does not allow the creation of the new drive.. Looks up a localized string similar to The item at path '{0}' already exists.. Looks up a localized string similar to The root of the drive '{0}' cannot be modified.. Looks up a localized string similar to Cannot create new drive because the name specified in the PSDriveInfo '{0}' does not match the drive name specified in the path '{1}'.. Looks up a localized string similar to The dynamic parameters for the NewItem operation cannot be retrieved from the '{0}' provider for path '{1}'. {2}. Looks up a localized string similar to Attempting to perform the NewItem operation on the '{0}' provider failed for the path '{1}'. {2}. Looks up a localized string similar to The provider name specified in the PSDriveInfo '{0}' does not match the provider name specified in the path '{1}'.. Looks up a localized string similar to Cannot create a new drive because type '{0}' is not of type "drive".. Looks up a localized string similar to Cannot create a new provider because type '{0}' is not of type "provider".. Looks up a localized string similar to Cannot set new item value because parameter "value" must be of type ProviderInfo when "type" is specified as "provider".. Looks up a localized string similar to Cannot set new item value because the parameter "value" must be of type PSDriveInfo when "type" is specified as "drive".. Looks up a localized string similar to Item '{0}' cannot be created because the value was not specified.. Looks up a localized string similar to The dynamic parameters for the NewProperty operation cannot be retrieved from the '{0}' provider for path '{1}'. {2}. Looks up a localized string similar to Attempting to perform the NewProperty operation on the '{0}' provider failed for path '{1}'. {2}. Looks up a localized string similar to The path '{0}' is shorter than the base path '{1}'.. Looks up a localized string similar to The path '{0}' referred to an item that was outside the base '{1}'.. Looks up a localized string similar to Attempting to perform the NormalizeRelativePath operation on the '{0}' provider failed for path '{1}'. {2}. Looks up a localized string similar to The path is not in the correct format. Provider paths must contain a provider Id, followed by "::", followed by a provider specific path.. Looks up a localized string similar to Cannot compare PSDriveInfo. A PSDriveInfo instance can be compared only to another PSDriveInfo instance.. Looks up a localized string similar to The Cmdlet provider cannot stream the results because no Cmdlet was specified to stream the output through.. Looks up a localized string similar to Cannot find path '{0}' because it does not exist.. Looks up a localized string similar to Cannot set the location because path '{0}' resolved to multiple containers. You can only the set location to a single container at a time.. Looks up a localized string similar to The provider '{0}' cannot be used to get or set data using the variable syntax. {2}. Looks up a localized string similar to The invocation of Close on the '{0}' provider's content reader or writer failed for path '{1}'. {2}. Looks up a localized string similar to The invocation of Read on the '{0}' provider's content reader failed for path '{1}'. {2}. Looks up a localized string similar to The invocation of Write on the '{0}' provider's content writer failed for path '{1}'. {2}. Looks up a localized string similar to An error occurred attempting to create an instance of the provider '{0}'. {1} . Looks up a localized string similar to The drive containing the list of loaded providers and their drives.. Looks up a localized string similar to The provider '{0}' cannot be used to resolve the path '{1}' because of an error in the provider.. Looks up a localized string similar to '{0}' resolved to a provider name that was ambiguous. Possible matches include:{1}.. Looks up a localized string similar to The specified provider name '{0}' cannot be used because it contains one or more characters that are not valid: \ [ ] ? * :. Looks up a localized string similar to Cannot find a provider with the name '{0}'.. Looks up a localized string similar to Cannot find a provider with the name '{0}'. The name is not in the proper format. A provider name may only be alpha-numeric characters or a Windows PowerShell snap-in name followed by a single '\' followed by alpha-numeric characters.. Looks up a localized string similar to An error occurred attempting to create an instance of the provider. The provider type name of '{0}' could not be found in the assembly.. Looks up a localized string similar to Cannot create provider because creation of new providers is not supported.. Looks up a localized string similar to Cannot remove provider because removal of providers is not supported.. Looks up a localized string similar to The path is not in the correct format. Paths may contain only provider and drive names separated by forwardslashes or backslashes.. Looks up a localized string similar to The invocation of Seek on the '{0}' provider's content writer failed for path '{1}'. {2}. Looks up a localized string similar to Attempting to perform the Start operation on the '{0}' provider failed. {1}. Looks up a localized string similar to The variable syntax cannot be used to get or set data in the provider. {2}. Looks up a localized string similar to The invocation of RemoveDrive on the '{0}' provider failed. {1}. Looks up a localized string similar to Cannot remove the drive root in this way. Use "Remove-PSDrive" to remove this drive.. Looks up a localized string similar to Cannot remove provider {0}. All drives associated with provider {0} must be removed before provider {0} can be removed.. Looks up a localized string similar to The dynamic parameters for the RemoveItem operation cannot be retrieved from the '{0}' provider for path '{1}'. {2}. Looks up a localized string similar to Attempting to perform the RemoveItem operation on the '{0}' provider failed for path '{1}'. {2}. Looks up a localized string similar to The dynamic parameters for the RemoveProperty operation cannot be retrieved from the '{0}' provider for path '{1}'. {2}. Looks up a localized string similar to Attempting to perform the RemoveProperty operation on the '{0}' provider failed for path '{1}'. {2}. Looks up a localized string similar to The item at the path '{0}' does not exist.. Looks up a localized string similar to The dynamic parameters for the RenameItem operation cannot be retrieved from the '{0}' provider for path '{1}'. {2}. Looks up a localized string similar to Attempting to perform the RenameItem operation on the '{0}' provider failed for path '{1}'. {2}. Looks up a localized string similar to Cannot rename item because the path resolved to multiple items. Only one item can be renamed at a time.. Looks up a localized string similar to Dynamic parameters for RenameProperty cannot be retrieved for the '{0}' provider for path '{1}'. {2}. Looks up a localized string similar to Attempting to perform the RenameProperty operation on the '{0}' provider failed for path '{1}'. {2}. Looks up a localized string similar to Cannot access session state resource because it is a private resource . Looks up a localized string similar to A Session State error occurred for object {0}, but the message string could not be formatted for {1}.{2} : {3}. Looks up a localized string similar to A Session State error occurred for object {0}, but the message string could not be loaded for {1}.{2} : {3}. Looks up a localized string similar to Too many scopes have been created.. Looks up a localized string similar to The function definition '{0}' contained a scope qualifier but no function name.. Looks up a localized string similar to The scope number '{0}' exceeds the number of active scopes.. Looks up a localized string similar to This provider does not support security descriptor related operations.. Looks up a localized string similar to The dynamic parameters for the SetItem operation cannot be retrieved from the '{0}' provider for path '{1}'. {2}. Looks up a localized string similar to Attempting to perform the SetItem operation on the '{0}' provider failed for path '{1}'. {2}. Looks up a localized string similar to The dynamic parameters for the SetProperty operation cannot be retrieved from the '{0}' provider for path '{1}'. {2}. Looks up a localized string similar to Attempting to perform the SetProperty operation on the '{0}' provider failed for path '{1}'. {2}. Looks up a localized string similar to Attempting to perform the SetSecurityDescriptor operation on the '{0}' provider failed for path '{1}'. {2}. Looks up a localized string similar to The '{0}' resolved to more than one location stack.. Looks up a localized string similar to Cannot find location stack '{0}'. It does not exist or it is not a container.. Looks up a localized string similar to Attempting to perform the StartDynamicParameters operation on the '{0}' provider failed for the path '{1}'. {2}. Looks up a localized string similar to Cannot find trace source with name '{0}'.. Looks up a localized string similar to The provider does not support transactions. Perform the operation again without the -UseTransaction parameter.. Looks up a localized string similar to The AllScope option cannot be removed from the variable '{0}'.. Looks up a localized string similar to A variable with name '{0}' already exists.. Looks up a localized string similar to Existing variable {0} cannot be made constant. Variables can be made constant only at creation time.. Looks up a localized string similar to The drive containing a view of those variables stored in session state.. Looks up a localized string similar to Cannot modify variable {0} because it is a constant.. Looks up a localized string similar to Cannot access the variable '${0}' because it is a private variable. Looks up a localized string similar to Cannot find a variable with name '{0}'.. Looks up a localized string similar to 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.. Looks up a localized string similar to Cannot remove variable {0} because the variable has been optimized and is not removable. Try using the Remove-Variable cmdlet (without any aliases) or dot the command trying to remove the variable.. Looks up a localized string similar to Cannot remove variable {0} because it is owned by the system.. Looks up a localized string similar to Cannot overwrite variable {0} because it is read-only or constant.. Looks up a localized string similar to Cannot overwrite variable {0} because the variable has been optimized. Try using the New-Variable or Set-Variable cmdlet (without any aliases) or dot the command trying to set the variable.. Looks up a localized string similar to Cannot set options on the local variable {0}. Use New-Variable to create a variable that allows options to be set.. Looks up a localized string similar to Cannot create variable {0} because variable capacity {1} is exceeded for this scope.. Looks up a localized string similar to Cannot process variable because variable path '{0}' resolved to multiple items. You can get or set the variable value only one item at a time.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to MatchType must be 'Command', 'Error', or 'Dynamic'.. Looks up a localized string similar to Rule must be a ScriptBlock for dynamic match types.. Looks up a localized string similar to "The command {0} was not found, but does exist in the current location. Windows PowerShell does not load commands from the current location by default. If you trust this command, instead type `"{1}`". See `"get-help about_Command_Precedence`" for more details.". Looks up a localized string similar to Once a transaction is started, only commands that get called with the -UseTransaction flag become part of that transaction.. Looks up a localized string similar to The Use-Transaction cmdlet is intended for scripting of transaction-enabled .NET objects. Its ScriptBlock should contain nothing else.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to The operation cannot be performed. This Cmdlet is not supported in custom shell.. Looks up a localized string similar to The format of the specified snap-in name was not valid. Windows PowerShell snap-in names can only contain alpha-numeric characters, dashes, underscores and periods. Correct the name and then try the operation again.. Looks up a localized string similar to Cannot add Windows PowerShell snap-in {0} because it is a system Windows PowerShell module. Use Import-Module to load the module.. Looks up a localized string similar to No Windows PowerShell snap-ins matching the pattern '{0}' were found. Check the pattern and then try the command again.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Cannot find required information in registry or missing key files. Cannot load some cmdlets.. Looks up a localized string similar to Mandatory value {0} is not in correct format for registry key {1}. Expected format is string.. Looks up a localized string similar to Mandatory value {0} is not in correct format for registry key {1}. Expected format is multistring.. Looks up a localized string similar to Mandatory value {0} not specified for registry key {1}.. Looks up a localized string similar to Unable to access Windows PowerShell PowerShellEngine registry information.. Looks up a localized string similar to Unable to access Windows PowerShell registry information.. Looks up a localized string similar to The Windows PowerShell snap-in '{0}' is not installed on this computer.. Looks up a localized string similar to No snap-ins have been registered for Windows PowerShell version {0}.. Looks up a localized string similar to No [PSVersion] attribute was found for Windows PowerShell type {0}. Add a PSVersion attribute to the type using [PSVersion(Windows PowerShell SnapinBase.PSEngineVersion)].. Looks up a localized string similar to Unable to access PublicKeyToken information.. Looks up a localized string similar to Cannot retrieve the string resource because the reader has been disposed.. Looks up a localized string similar to Version {0} of Windows PowerShell is not available on this computer.. Looks up a localized string similar to Version value {0} is not specified or is incorrect for registry key {1}.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to The tab completion result cannot be properly deserialized because the remote runspace doesn't contain a TypeTable instance.. Looks up a localized string similar to Cannot access properties on a null instance of the type CompletionResult.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to The base transaction cannot be set after other transactions have been created.. Looks up a localized string similar to The base transaction is not active.. Looks up a localized string similar to The base transaction has not been set.. Looks up a localized string similar to This cmdlet requires a transaction. Run the command again with the -UseTransaction parameter.. Looks up a localized string similar to Cannot commit transaction. The transaction has already been committed.. Looks up a localized string similar to Cannot roll back transaction. The transaction has already been committed.. Looks up a localized string similar to Cannot use transaction. No transaction is active.. Looks up a localized string similar to Cannot commit transaction. No transaction is active.. Looks up a localized string similar to Cannot roll back the transaction, because there is no active transaction.. Looks up a localized string similar to This cmdlet requires an active transaction. The current transaction has already been committed or rolled back.. Looks up a localized string similar to Cannot set active transaction. No transaction has been created.. Looks up a localized string similar to Cannot set active transaction. The active transaction has been rolled back or has timed out.. Looks up a localized string similar to Cannot use transaction. No transaction has been started.. Looks up a localized string similar to Cannot use transaction. The transaction has been committed.. Looks up a localized string similar to Cannot use transaction. The transaction has been rolled back or has timed out.. Looks up a localized string similar to Cannot commit transaction. The transaction has been rolled back or has timed out.. Looks up a localized string similar to Cannot roll back transaction. The transaction has already been rolled back or has timed out.. Looks up a localized string similar to Cannot use transaction. The transaction has timed out.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to ,. Looks up a localized string similar to Cannot find the registry key: {0}{1} using {2} to load the configuration files.. Looks up a localized string similar to Cannot find the path {0} specified in the registry key: {1}{2}. Using {3} to load the configuration files.. Looks up a localized string similar to The CodeProperty should have getter or setter.. Looks up a localized string similar to {0}, {1} : File skipped because it was already loaded by {2}.. Looks up a localized string similar to {0}: File skipped because it was already present.. Looks up a localized string similar to The member {0} is already present.. Looks up a localized string similar to More than one members with name "{0}" defined in the type file.. Looks up a localized string similar to {0}, {1} : File skipped because it does not have the ps1xml extension.. Looks up a localized string similar to Cannot convert note "{0}":"{1}".. Looks up a localized string similar to Exception: {0}. Looks up a localized string similar to Expected XML tag "{0}" instead of "{1}".. Looks up a localized string similar to Expected XML tag "{0}" instead of node of type "{1}".. Looks up a localized string similar to {0}, {1} : {2}. Looks up a localized string similar to {0}, {1}({2}) : Error: {3}. Looks up a localized string similar to {0}, {1}({2}) : Error in type "{3}": {4}. Looks up a localized string similar to {0}, {1} : File not found.. Looks up a localized string similar to The adapted type "{0}" is not valid.. Looks up a localized string similar to Node "{0}" should not have "{1}" attribute.. Looks up a localized string similar to Value should be "true" or "false" instead of "{0}" for "{1}" attribute.. Looks up a localized string similar to "{0}" must be present when the "{1}" is "{2}" and "{3}" is "{4}".. Looks up a localized string similar to Member "{0}" must be a note.. Looks up a localized string similar to member "{0}" must have type "{1}".. Looks up a localized string similar to Member "{0}" must not be present. Looks up a localized string similar to Node "{0}" was not found. It should be present at least once under "{1}". The parent node "{1}" will be ignored.. Looks up a localized string similar to Node "{0}" was not found. It should be present once under "{1}". The parent node "{1}" will be ignored.. Looks up a localized string similar to Node "{0}" should have an inner text.. Looks up a localized string similar to Node "{0}" should not have an inner text.. Looks up a localized string similar to "{0}" is not a standard member and will be ignored. Looks up a localized string similar to Node "{0}" should be present only once under "{1}". The parent node "{1}" will be ignored.. Looks up a localized string similar to Node "{0}" should be present zero or one time under "{1}". The parent node "{1}" will be ignored.. Looks up a localized string similar to The following member name is reserved: {0}. Looks up a localized string similar to The ScriptProperty should have getter or setter.. Looks up a localized string similar to A previous error caused all serialization settings to be ignored.. Looks up a localized string similar to The TypeTable cannot be updated because the TypeTable might have been created outside of the Runspace.. Looks up a localized string similar to The TypeAdapter was ignored since it is already present.. Looks up a localized string similar to The TypeConverter was ignored since it is already present.. Looks up a localized string similar to "{0}" should have a value for its property "{1}".. Looks up a localized string similar to The TypeData must have "Members", "TypeConverters", "TypeAdapters" or "StandardMembers".. Looks up a localized string similar to "{0}" should not have null or an empty string in its property "{1}".. Looks up a localized string similar to Error in TypeData "{0}": {1}. Looks up a localized string similar to The {0} path is not fully qualified. Specify a fully qualified type file path.. Looks up a localized string similar to Type "{0}" should be a PSPropertyAdapter.. Looks up a localized string similar to Type "{0}" should be a TypeConverter or an PSTypeConverter.. Looks up a localized string similar to The "Type" node must have "Members", "TypeConverters", or "TypeAdapters".. Looks up a localized string similar to The type "{0}" was not found. The type name value must be the full name of the type. Verify the type name and run the command again.. Looks up a localized string similar to Shared type table cannot be updated with more than one entry.. Looks up a localized string similar to There were errors loading TypeTable. Look in the Errors property to get detailed error messages.. Looks up a localized string similar to Windows PowerShell cannot create an instance of the type adapter for the type {0} because of the following exception: {1}.. Looks up a localized string similar to Cannot create an instance of the type converter for type {0} due to exception: {1}.. Looks up a localized string similar to Node of type "{0}" was not expected.. Looks up a localized string similar to The node {0} cannot be present. Nodes allowed are: {1}.. Looks up a localized string similar to {0}, {1} : File skipped because of the following validation exception: {2}.. Looks up a localized string similar to The value should be TRUE or FALSE instead of: {0}.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to The specified wildcard pattern is not valid: {0}. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Launching a program to show online help failed. No program is associated to launch URI {0}.. Looks up a localized string similar to ForwardHelpTargetName cannot refer to the function itself.. Looks up a localized string similar to To use the {0}, install the Windows PowerShell ISE feature from Server Manager and restart this application. ({1}). Looks up a localized string similar to Cannot process Help category because "{0}" is not a valid Help category.. Looks up a localized string similar to Cannot load Help file "{0}". Details: {1}.. Looks up a localized string similar to Cannot access Help file "{0}" because the current user is not authorized to access the file. Details: {1}.. Looks up a localized string similar to Help file "{0}" is not a valid xml document. Details: {1}.. Looks up a localized string similar to Cannot load Help file. The following {1} error(s) happened while loading help file "{0}".. Looks up a localized string similar to Get-Help could not find {0} in a help file in this session. To download updated help topics type: "Update-Help". To get help online, search for the help topic in the TechNet library at http://go.microsoft.com/fwlink/?LinkID=107116.. Looks up a localized string similar to Specified Uri {0} is not valid.. Looks up a localized string similar to Error loading help content for {0} from file {1}. Details: {2}. To download updated help topics type: "Update-Help". To get help online, search for the help topic in the TechNet library at http://go.microsoft.com/fwlink/?LinkID=107116.. Looks up a localized string similar to Node "{0}" can have at maximum {2} child node(s) of type "{1}". Node Path: {3}.. Looks up a localized string similar to Node "{0}" cannot have "{1}" as a child node. Node Path: {2}.. Looks up a localized string similar to Multiple help topics are found, use only one help topic with -{0} option.. Looks up a localized string similar to No parameter matches criteria {0}.. Looks up a localized string similar to The online version of this Help topic cannot be displayed because the Internet address (URI) of the Help topic is not specified in the command code or in the help file for the command.. Looks up a localized string similar to {0} is not supported by the requested help category.. Looks up a localized string similar to The protocol specified in the Uri "{0}" is not supported. Only "{1}" and "{2}" protocols are supported.. Looks up a localized string similar to Provider "{0}" cannot be loaded. Details: {1}.. Looks up a localized string similar to Cannot find the registry key: "{0}{1}", using "{2}" to load the help files.. Looks up a localized string similar to Cannot get help from remote runspace, because the runspace is not opened. Open the runspace by running one of implicit remoting commands and then try getting the help again.. Looks up a localized string similar to {0} does not work in a remote session.. Looks up a localized string similar to This command did not update help topics for the Windows PowerShell core commands or for any modules in the $pshome\Modules directory. To update these help topics, start Windows PowerShell with the "Run as Administrator" option and try the command again.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Accept pipeline input? . Looks up a localized string similar to Accept wildcard characters? . Looks up a localized string similar to ALIASES. Looks up a localized string similar to (All). Looks up a localized string similar to Answer. Looks up a localized string similar to This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer and OutVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). . Looks up a localized string similar to This cmdlet supports the workflow common parameters: PSComputerName, JobName, PSApplicationName, PSCredential, PSPort, PSConfigurationName, PSConnectionURI, PSSessionOption, PSAuthentication, PSAuthenticationLevel, PSCertificateThumbprint, PSConnectionRetryCount, PSConnectionRetryIntervalSec, PSRunningTimeoutSec, PSElapsedTimeoutSec, PSPersist, PSPrivateMetadata, InputObject, PSParameterCollection, AsJob, PSUseSSL, and PSAllowRedirection. For more information [rest of string was truncated]";. Looks up a localized string similar to No Windows PowerShell modules were found that match the following pattern: {0}. Verify the pattern and then try the command again.. Looks up a localized string similar to No UI culture was found that matches the following pattern: {0}. Verify the pattern and then try the command again.. Looks up a localized string similar to You must specify either the -DestinationPath or -LiteralPath parameters, but not both.. Looks up a localized string similar to The -Recurse parameter is only available if a source path is specified.. Looks up a localized string similar to You must specify either the -SourcePath or -LiteralPath parameters, but not both.. Looks up a localized string similar to CAPABILITIES. Looks up a localized string similar to (Category: . Looks up a localized string similar to Cmdlets Supported: . Looks up a localized string similar to CMDLETS SUPPORTED. Looks up a localized string similar to <CommonParameters>. Looks up a localized string similar to <WorkflowCommonParameters>. Looks up a localized string similar to Content:. Looks up a localized string similar to Definition:. Looks up a localized string similar to DESCRIPTION. Looks up a localized string similar to DRIVES. Looks up a localized string similar to DYNAMIC PARAMETERS. Looks up a localized string similar to Example. Looks up a localized string similar to To see the examples, type: . Looks up a localized string similar to EXAMPLES. Looks up a localized string similar to EXAMPLE. Looks up a localized string similar to Failed to save Help for the module(s) '{0}' : {1}. Looks up a localized string similar to Failed to save Help for the module(s) '{0}' with UI culture(s) {{{1}}} : {2}. Looks up a localized string similar to Failed to update Help for the module(s) '{0}' : {1}. Looks up a localized string similar to Failed to update Help for the module(s) '{0}' with UI culture(s) {{{1}}} : {2}. Looks up a localized string similar to false. Looks up a localized string similar to FILTERS. Looks up a localized string similar to For technical information, type: . Looks up a localized string similar to Get-Help cannot find the Help files for this cmdlet on this computer. It is displaying only partial help. -- To download and install Help files for the module that includes this cmdlet, use Update-Help. -- To view the Help topic for this cmdlet online, type: "Get-Help {0} -Online" or go to {1}.. Looks up a localized string similar to Get-Help cannot find the Help files for this cmdlet on this computer. It is displaying only partial help. -- To download and install Help files for the module that includes this cmdlet, use Update-Help.. Looks up a localized string similar to Help content contains files that are not valid. Only .txt and .xml files are supported.. Looks up a localized string similar to Help content must be in the namespace {0}.. Looks up a localized string similar to Help content cannot be found. Make sure the server is available and the help content location is properly defined in the HelpInfo XML.. Looks up a localized string similar to Help content is not valid. Specify a location containing valid Help Content.. Looks up a localized string similar to The Help content XSD file cannot be found in {0}. Make sure the file exists and retry.. Looks up a localized string similar to The specified culture is not supported: {0}. Specify a culture from the following list: {{{1}}}.. Looks up a localized string similar to The Update-Help command failed because the specified module does not support updatable help. Use Get-Help -Online or look online for help for the commands in this module.. Looks up a localized string similar to The HelpInfo XML is not valid. Specify a valid HelpInfo XML.. Looks up a localized string similar to INPUTS. Looks up a localized string similar to Error installing help content.. Looks up a localized string similar to The value of the HelpInfoUri key in the module manifest must resolve to a container or root URL on a website where the help files are stored. The HelpInfoUri '{0}' does not resolve to a container.. Looks up a localized string similar to HelpInfoURI {0} does not start with http.. Looks up a localized string similar to The ModuleBase directory cannot be found. Verify the directory and try again.. Looks up a localized string similar to The following parameter must not be null or empty: Module.. Looks up a localized string similar to NAME. Looks up a localized string similar to Named. Looks up a localized string similar to Newest help files already downloaded.. Looks up a localized string similar to Newest help files already installed. Looks up a localized string similar to None. Looks up a localized string similar to NON-TERMINATING ERRORS. Looks up a localized string similar to NOTES. Looks up a localized string similar to OUTPUT. Looks up a localized string similar to Output:. Looks up a localized string similar to Aliases . Looks up a localized string similar to Default value . Looks up a localized string similar to Dynamic? . Looks up a localized string similar to Position? . Looks up a localized string similar to Required? . Looks up a localized string similar to PARAMETERS. Looks up a localized string similar to Parameter set name . Looks up a localized string similar to The path {0} is not a valid directory. Make sure the directory exists and retry.. Looks up a localized string similar to The following parameter must not be null or empty: Path.. Looks up a localized string similar to ByPropertyName. Looks up a localized string similar to ByValue. Looks up a localized string similar to FromRemainingArguments. Looks up a localized string similar to The path {0} does not map to a FileSystem provider. Make sure the path is valid and retry.. Looks up a localized string similar to PROVIDER NAME. Looks up a localized string similar to Question:. Looks up a localized string similar to RELATED LINKS. Looks up a localized string similar to For online help, type: . Looks up a localized string similar to REMARKS. Looks up a localized string similar to OUTPUTS. Looks up a localized string similar to The root level element of the help content must be "helpItems".. Looks up a localized string similar to Saved {0}. Looks up a localized string similar to Help content has been successfully saved to the following location: {0}. Looks up a localized string similar to Saving Help. Looks up a localized string similar to Saving Help for module {0}. Looks up a localized string similar to Searching Help for {0} .... Looks up a localized string similar to SHORT DESCRIPTION. Looks up a localized string similar to {0}: {1}. Culture {2} Version {3}. Looks up a localized string similar to Suggested Action: . Looks up a localized string similar to SYNOPSIS. Looks up a localized string similar to SYNTAX. Looks up a localized string similar to Target Object Type: . Looks up a localized string similar to TASK: . Looks up a localized string similar to TASKS. Looks up a localized string similar to Term:. Looks up a localized string similar to TERMINATING ERRORS. Looks up a localized string similar to Title:. Looks up a localized string similar to A Help URI cannot contain more than 10 redirections. Specify a valid Help URI.. Looks up a localized string similar to true. Looks up a localized string similar to Type: . Looks up a localized string similar to Unable to connect to Help content. Make sure the server is available and then try the command again.. Looks up a localized string similar to Unable to retrieve the HelpInfo XML file for UI culture {0}. Make sure the HelpInfoUri property in the module manifest is valid or check your network connection and then try the command again.. Looks up a localized string similar to Error extracting Help content.. Looks up a localized string similar to Updated {0}. Looks up a localized string similar to Update-Help has completed successfully.. Looks up a localized string similar to The Update-Help cmdlet downloads the newest Help files for Windows PowerShell modules and installs them on your computer. For more details, see the help topic at http://go.microsoft.com/fwlink/?LinkId=210614.. Looks up a localized string similar to Do you want to run Update-Help?. Looks up a localized string similar to Updating Help. Looks up a localized string similar to Updating Help for module {0}. Looks up a localized string similar to Connecting to Help Content.... Looks up a localized string similar to Downloading Help Content.... Looks up a localized string similar to Installing Help content.... Looks up a localized string similar to Locating Help Content.... Looks up a localized string similar to Help was not saved for module {0}, because a Save-Help command was already run on this computer today. To save help, use the Force parameter.. Looks up a localized string similar to Help was not updated for module {0}, because an Update-Help command was already run on this computer today. To update help, use the Force parameter.. Looks up a localized string similar to For more information, type: . A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Cannot reflect on entry assembly to find out RunspaceConfigurationType. . Looks up a localized string similar to Cannot create RunspaceConfiguration object because there is more than one assembly attribute of type RunspaceConfigurationType defined in assembly {0}.. Looks up a localized string similar to Cannot create RunspaceConfiguration object because assembly attribute of type RunspaceConfigurationType is not defined in assembly {0}. . Looks up a localized string similar to RunspaceConfiguration-derived type {1} is not defined in assembly {0}.. Looks up a localized string similar to The following errors occurred when updating the assembly list for the runspace: {0}.. Looks up a localized string similar to Update is not supported for runspace configuration category {0}. . A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Invoke-Command does not support -AsJob and -Disconnected parameter switches together.. Looks up a localized string similar to "{0}", "{1}" must be specified in "{2}" section to dynamically load assembly.. Looks up a localized string similar to {0} authentication requires an explicit user name and password. Specify the user name and password by using the -Credential parameter and try the command again.. Looks up a localized string similar to The -AutoRemoveJob parameter cannot be used without the -Wait parameter. Looks up a localized string similar to A job could not be created from the {0} specification because the provided runspace is not a local runspace. Try again using a local runspace, or specify a RunspaceMode argument.. Looks up a localized string similar to Fragment blob length is out of range: {0}. Looks up a localized string similar to The -Wait parameter and -Keep parameter cannot be used together. Looks up a localized string similar to Cannot create runspace. The language mode for this configuration is incompatible with the system-wide language mode.. Looks up a localized string similar to The session {0} cannot be disconnected because the specified idle time-out value {1} (seconds) is either greater than the server maximum allowed {2} (seconds), or less than the minimum allowed {3} (seconds). Specify an idle time-out value that is within the allowed range, and try again.. Looks up a localized string similar to Cannot find session {0} to connect to. The session no longer exists on computer {1}.. Looks up a localized string similar to The call to Windows API GetStdHandle to get Standard Error handle resulted with error code: {0}.. Looks up a localized string similar to The call to Windows API GetStdHandle to get Standard Input handle resulted with error code: {0}.. Looks up a localized string similar to The call to Windows API GetStdHandle to get Standard Output handle resulted with error code: {0}.. Looks up a localized string similar to The command cannot remove the job because it does not exist or because it is a child job. Child jobs can be removed only by removing the parent job.. Looks up a localized string similar to Cannot start job. The language mode for this session is incompatible with the system-wide language mode.. Looks up a localized string similar to Unexpected type of encoded command (expected PSObject, got {0}).. Looks up a localized string similar to Unexpected type of encoded command parameter (expected PSObject, got {0}).. Looks up a localized string similar to Unexpected type of {0} property (expected {1}, got {2}).. Looks up a localized string similar to Unexpected type of remoting data (expected PSObject, got {0}).. Looks up a localized string similar to The server did not respond with an encrypted session key within the specified time-out period.. Looks up a localized string similar to Windows PowerShell client does not support the {0} {1} negotiated by the server. Make sure the server is compatible with the build {2} and the protocol version {3} of Windows PowerShell.. Looks up a localized string similar to The client negotiation timer has expired. The negotiation time-out interval is {0} milliseconds.. Looks up a localized string similar to {0}. Negotiation with the server failed. Make sure the server is compatible with the build {1} and the protocol version {2} of Windows PowerShell.. Looks up a localized string similar to Client side receive call failed.. Looks up a localized string similar to Client has requested to close the session.. Looks up a localized string similar to Client side send call failed.. Looks up a localized string similar to Close call completed.. Looks up a localized string similar to Closing remote server shell instance failed with the following error message : {0}. Looks up a localized string similar to The close call failed.. Looks up a localized string similar to Close is called.. Looks up a localized string similar to The command handle returned from the WinRS API WSManRunShellCommand is null.. Looks up a localized string similar to Processing data for a remote command failed with the following error message: {0}. Looks up a localized string similar to Receiving data for a remote command failed.. Looks up a localized string similar to Sending data to a remote command failed with the following error message: {0}. Looks up a localized string similar to Sending data to a remote command failed.. Looks up a localized string similar to The command cannot retrieve the jobs of the specified computers. The ComputerName parameter can be used only with jobs creating using Windows PowerShell remoting.. Looks up a localized string similar to Connecting to remote server {0} failed with the following error message : {1}. Looks up a localized string similar to Connecting to remote server {0} failed.. Looks up a localized string similar to Connection attempt failed.. Looks up a localized string similar to {0} is not valid value for parameter {1}. Value must be greater than or equal to 0.. Looks up a localized string similar to Session Configuration "{0}" not found.. Looks up a localized string similar to Session Configuration "{0}" is not a Windows PowerShell based shell.. Looks up a localized string similar to Either both "{0}" and "{1}" must be specified or both must not be specified.. Looks up a localized string similar to {0}. Looks up a localized string similar to Name: {0}. Looks up a localized string similar to Name: {0}. This will allow administrators to remotely run Windows PowerShell commands on this computer. Looks up a localized string similar to No Session Configuration matches criteria "{0}".. Looks up a localized string similar to Running command "{0}" to disable Session Configuration.. Looks up a localized string similar to Name: {0} SDDL: {1}. This will disable access to this session configuration for everyone. Looks up a localized string similar to Disabling the session configurations does not undo all the changes made by the Enable-PSRemoting or Enable-PSSessionConfiguration cmdlet. You might have to manually undo the changes by following these steps: 1. Stop and disable the WinRM service. 2. Delete the listener that accepts requests on any IP address. 3. Disable the firewall exceptions for WS-Management communications. 4. Restore the value of the LocalAccountTokenFilterPolicy to 0, which restricts remote access to members of the [rest of string was truncated]";. Looks up a localized string similar to Error in decoding ErrorRecord.. Looks up a localized string similar to Error in decoding Maximum runspaces.. Looks up a localized string similar to Error in decoding Minimum runspaces.. Looks up a localized string similar to Error in decoding PipelineStateInfo.. Looks up a localized string similar to Error in decoding Windows PowerShellStateInfo.. Looks up a localized string similar to Error in decoding RunspacePoolStateInfo.. Looks up a localized string similar to Error in decoding RunspaceStateInfo.. Looks up a localized string similar to An error of type "{0}" has occurred.. Looks up a localized string similar to Deserialized remoting data is null.. Looks up a localized string similar to Name: {0} SDDL: {1}. This will disable remote access to this session configuration. Looks up a localized string similar to Aliases defined in this session configuration. Looks up a localized string similar to Assemblies that will be loaded in this session configuration. Looks up a localized string similar to Author of this session configuration. Looks up a localized string similar to Version of the CLR used by this session configuration. Looks up a localized string similar to Company associated with this session configuration. Looks up a localized string similar to Copyright statement for this session configuration. Looks up a localized string similar to Description of the functionality provided by this session configuration. Looks up a localized string similar to Environment variables defined in this session configuration. Looks up a localized string similar to Error parsing configuration file {0} with the following message: {1}. Looks up a localized string similar to Specifies the execution policy for this session configuration. Looks up a localized string similar to Format files (.ps1xml) that will be loaded in this session configuration.. Looks up a localized string similar to Functions defined in this session configuration. Looks up a localized string similar to ID used to uniquely identify this session configuration.. Looks up a localized string similar to Initial state of this session configuration. Looks up a localized string similar to The key '{0}' contains an extension {1} that is not valid. Specify an extension from the following list: {{{2}}}.. Looks up a localized string similar to The member '{0}' is not a valid key. Please change the member to a valid key in the file {1}.. Looks up a localized string similar to The key '{0}' in the member '{1}' must be a script block. Change the key to the correct type in the file {2}.. Looks up a localized string similar to Specifies the language mode for this session configuration. Looks up a localized string similar to The member 'SchemaVersion' is not present in the configuration file. This member must exist and be assigned a version number of the form 'n.n.n.n'. Please add the missing member to the file {0}.. Looks up a localized string similar to Modules that will be imported.. Looks up a localized string similar to Disconnecting the remote server failed with the following error message : {0}. Looks up a localized string similar to Failed to disconnect from the remote server {0}.. Looks up a localized string similar to The member '{0}' is not an absolute path {1}. Change the member to an absolute path in the file {2}.. Looks up a localized string similar to Version of the Windows PowerShell engine used by this session configuration. Looks up a localized string similar to Processor architecture used by this session configuration.. Looks up a localized string similar to Version number of the schema used for this configuration file. Looks up a localized string similar to Specifies the scripts to run after the session is configured. Looks up a localized string similar to Specifies the transport options for this session configuration. Looks up a localized string similar to The key '{0}' in the member '{1}' is not valid. Change the key in the file {2}.. Looks up a localized string similar to The member '{0}' must be a hashtable. Change the member to the correct type in the file {1}.. Looks up a localized string similar to The member '{0}' must be a hashtable array. Change the member to the correct type in the file {1}.. Looks up a localized string similar to The member '{0}' must be a string. Change the member to the correct type in the file {1}.. Looks up a localized string similar to The member '{0}' must be a string array. Change the member to the correct type in the file {1}.. Looks up a localized string similar to The member '{0}' must be an array consisting of either string or hashtable elements.. Looks up a localized string similar to The member '{0}' must be an array consisting of either string or hashtable elements. Change the member to the correct type in the file {1}.. Looks up a localized string similar to The member '{0}' must be a valid enumeration type "{1}". Valid enumeration values are "{2}". Change the member to the correct type in the file {3}.. Looks up a localized string similar to The member '{0}' must contain the required key '{1}'. Add the require key to the file {2}.. Looks up a localized string similar to Types to add to this session configuration. Looks up a localized string similar to Type files (.ps1xml) that will be loaded in this session configuration. Looks up a localized string similar to Variables defined in this session configuration. Looks up a localized string similar to The cmdlet "{0}" or the alias "{1}" cannot be present when "{2}","{3}","{4}" or "{5}" keys are specified in the session configuration file.. Looks up a localized string similar to Aliases visible in this session configuration. Looks up a localized string similar to Cmdlets visible in this session configuration. Looks up a localized string similar to Functions visible in this session configuration. Looks up a localized string similar to Providers visible in this session configuration. Looks up a localized string similar to The {0} parameter is already specified in the {1} section. Contact your administrator to make sure that {0} is specified only once.. Looks up a localized string similar to Running command "{0}" to enable Session Configuration.. Looks up a localized string similar to Name: {0} SDDL: {1}. This will allow selected users to remotely run Windows PowerShell commands on this computer. Looks up a localized string similar to WinRM Quick Configuration. Looks up a localized string similar to Running command "{0}" to enable remote management of this computer by using the Windows Remote Management (WinRM) service. This includes: 1. Starting or restarting (if already started) the WinRM service 2. Setting the WinRM service startup type to Automatic 3. Creating a listener to accept requests on any IP address 4. Enabling Windows Firewall inbound rule exceptions for WS-Management traffic (for http only). Do you want to continue?. Looks up a localized string similar to Performing operation "{0}".. Looks up a localized string similar to Access is denied. To run this cmdlet, start Windows PowerShell with the "Run as administrator" option.. Looks up a localized string similar to PSSession {0} was created using the EnableNetworkAccess parameter and can only be reconnected from the local computer.. Looks up a localized string similar to Disconnected sessions are supported only when the remote computer is running Windows PowerShell 3.0 or a later version of Windows PowerShell.. Looks up a localized string similar to Cannot enter session {0} because it is not in the disconnected state or is not available for connection. Retrieve the remote session using Get-PSSession -ComputerName {1} -InstanceId {2}.. Looks up a localized string similar to Cannot enter session {0} because it is not in the disconnected state or is not available for connection. Reconnect using Connect-PSSession or Receive-PSSession.. Looks up a localized string similar to Registering session configuration. Looks up a localized string similar to Session configuration "{0}" is not found. Running command "{1}" to create "{0}" session configuration. This will restart WinRM service.. Looks up a localized string similar to Register-PSSessionConfiguration : The '{0}' key in the {1}. session configuration file contains a value that is not valid. Correct the file and try the command again. . Looks up a localized string similar to An error has occurred which Windows PowerShell is unable to handle. Remote session may have terminated.. Looks up a localized string similar to Path specified for FilePath parameter is not from FileSystem provider.. Looks up a localized string similar to The value of the FilePath parameter must be a Windows PowerShell script file. Enter the path to a file with a .ps1 file name extension and try the command again.. Looks up a localized string similar to The -Force parameter cannot be used without the -Wait parameter.. Looks up a localized string similar to Force Close: Windows PowerShell cannot close the remote session properly. The session is in an undefined state because it was not opened or connected after being disconnected. The session will be force-closed on the local computer, but might not be closed on the remote computer. To close a remote session properly, first open it or connect it.. Looks up a localized string similar to The job is suspended forcefully.. Looks up a localized string similar to The FragmentIDs of the same object must be in sequence, incrementally changing by 1. This can happen if the fragments are not properly constructed by the remote computer, or the data might have been corrupted or changed.. Looks up a localized string similar to Running command "{0}" to get Windows PowerShell based Session Configurations.. Looks up a localized string similar to Error with error code {0} occurred while calling method {1}.. Looks up a localized string similar to The host does not support Enter-PSSession and Exit-PSSession.. Looks up a localized string similar to Cannot run Enter-PSSession from a nested prompt. Looks up a localized string similar to The EndpointConfiguration with the {0} identifier does not give a valid initial session state on the remote computer. Contact your administrator.. Looks up a localized string similar to One or more computer names is not valid. If you are trying to pass a URI, use the -ConnectionUri parameter or pass URI objects instead of strings.. Looks up a localized string similar to The WS-Management service cannot process the request. Cannot find the {0} session configuration in the WSMan: drive on the {1} computer. For more information, see the about_Remote_Troubleshooting Help topic.. Looks up a localized string similar to "The transport option is not valid. Parameter "{0}" can be non-zero only if parameter "{1}" is set to true.". Looks up a localized string similar to The specified IdleTimeout session option {0} (seconds) is not a valid period. Specify an IdleTimeout value that is greater than or equal to the minimum allowed {1} (seconds).. Looks up a localized string similar to State of current Job instance is not valid for this operation.. Looks up a localized string similar to The state of the current job instance is {0}. This state is not valid for the attempted operation. {1}. Looks up a localized string similar to The session configuration file {0} is not valid. Specify a valid session configuration file and try the command again.. Looks up a localized string similar to The session configuration file {0} is not valid. Specify a valid session configuration file and try the command again. Error parsing configuration file: {1}.. Looks up a localized string similar to PSSession Configuration File path '{0}' is not valid. The path argument must resolve to a single file in the file system with a '.pssc' extension. Please fix the path specification and try again.. Looks up a localized string similar to Cannot find module path to import. The value of the ModulesToImport parameter {0} does not exist or is not a module directory. Correct the value and try the command again.. Looks up a localized string similar to {0} is not a valid scheme value. Valid values are "http" and "https".. Looks up a localized string similar to No computer names or connection Uris were specified. You must provide a computer name or connection Uri when invoking a command with the -Disconnected switch.. Looks up a localized string similar to The client did not receive a response for close operation in the specified time interval. This might happen when a command is not responding to a stop message in a timely manner.. Looks up a localized string similar to There is an error processing data from the background process. Error reported: {0}.. Looks up a localized string similar to There is an error launching the background process. Error reported: {0}.. Looks up a localized string similar to Not enough data is available to process the {0} element.. Looks up a localized string similar to A {0} message to a session is not supported. A {0} message must be sent only to a command.. Looks up a localized string similar to Node type "{0}" is unknown in the {1} element. Only the "{2}" node type is expected in the {1} element.. Looks up a localized string similar to The background process exited abnormally.. Looks up a localized string similar to The background process reported an error with the following message: {0}.. Looks up a localized string similar to The client did not receive a response for signal operation in the specified time interval. This might happen when a command is not responding to a stop message in a timely manner.. Looks up a localized string similar to The specified authentication mechanism "{0}" is not supported. Only "{1}" is supported for this operation.. Looks up a localized string similar to IPC transport does not support connect operation. Looks up a localized string similar to Data for the non active command with the identifier {0} was received. Received data: {1}.. Looks up a localized string similar to Unknown element "{0}" was received. This might happen if the remote process exited abnormally.. Looks up a localized string similar to Cannot process an element with node type "{0}". Only {1} and {2} node types are supported.. Looks up a localized string similar to The "{0}" executable is not present. Make sure that WOW64 components are installed.. Looks up a localized string similar to Expected only two attributes with the names "{0}" and "{1}" in the {2} element.. Looks up a localized string similar to Expected only one attribute with the name "{0}" in the {1} element.. Looks up a localized string similar to {0} does not contain item with id {1}.. Looks up a localized string similar to The command cannot complete because the ChildJobs property contains a value that is not valid. Please check the property value.. Looks up a localized string similar to Wait-Job cmdlet cannot complete, because one or more jobs are blocked waiting for user interaction. Process interactive job output using Receive-Job cmdlet and then try again.. Looks up a localized string similar to Unable to connect job "{0}" to remote server.. Looks up a localized string similar to The JobIdentifier provided must not be null. Please provide a valid JobIdentifier.. Looks up a localized string similar to Attempted to create a job with ID {0}. A job with this ID cannot be created now. Verify that the ID has already been assigned once on this computer.. Looks up a localized string similar to The following type cannot be instantiated because its constructor is not public: {0}.. Looks up a localized string similar to Cannot resume job with ID {0}. Resuming jobs is not supported for some job types. For information about support for resuming jobs, see the Help topic for the job type.. Looks up a localized string similar to Cannot create a job with an ID of {0}; this is not a valid Id. Please provide an integer for the job ID that is greater than 0.. Looks up a localized string similar to The job was null when trying to save identifiers. Specify a job to save its identifiers.. Looks up a localized string similar to A {1} job source adapter threw an exception with the following message: {0}. Looks up a localized string similar to The job operation (Create, Get, or Remove) could not be performed because the JobSourceAdapter type specified in the JobDefinition is not registered. Register the JobSourceAdapter type either via an explicit call or via calling the Import-Module cmdlet and specifying an assembly.. Looks up a localized string similar to One or more jobs are in a suspended or disconnected state, and cannot proceed without additional user input. Specify the -Force parameter to progress to a completed, failed, or stopped state.. Looks up a localized string similar to Cannot suspend job with Id {0}. Suspending is not supported on the job type of some jobs. For information about support for suspending jobs, see the help topic for the job type.. Looks up a localized string similar to The workflow job "{0}" was stopped. Receive-Job is only displaying partial results.. Looks up a localized string similar to The command cannot remove the job with the job ID {0} and the instance identifier {1} because the job is not finished. To remove the job, first stop the job or use the Force parameter.. Looks up a localized string similar to The command cannot find a job with the instance identifier {0}. Verify the value of the InstanceId parameter, and then try the command again.. Looks up a localized string similar to The command cannot remove the job with the job ID {0} and the name {1} because the job is not finished. To remove the job, first stop the job, or use the Force parameter.. Looks up a localized string similar to The command cannot find the job because the job name {0} was not found. Verify the value of the Name parameter, and then try the command again.. Looks up a localized string similar to The command cannot remove the job with the job ID {0} because the job is not finished. To remove the job, first stop the job, or use the Force parameter.. Looks up a localized string similar to The command cannot find a job with the job ID {0}. Verify the value of the Id parameter and then try the command again.. Looks up a localized string similar to Mandatory value {0} is not in correct format for registry key {1}. Expected format is string.. Looks up a localized string similar to The mandatory value {0} is not specified for the {1} registry key.. Looks up a localized string similar to Remoting data is missing CallId property.. Looks up a localized string similar to Remoting data is missing RemotingDataType property.. Looks up a localized string similar to Remote management data is missing the destination property.. Looks up a localized string similar to Last fragment's IsEndFragment flag is not set. This can happen if the fragments are not properly constructed by the remote computer, or the data might have been corrupted or changed.. Looks up a localized string similar to First fragment's IsStartFragment flag is not set.. Looks up a localized string similar to Remoting data is missing MethodName property.. Looks up a localized string similar to Remoting data is missing {0} property.. Looks up a localized string similar to Remoting data is missing Session InstanceId property.. Looks up a localized string similar to Remoting data is missing target interface property.. Looks up a localized string similar to Remote host method was invoked without specifying a target class.. Looks up a localized string similar to Only administrators can override the Thread Options remotely.. Looks up a localized string similar to Native API call to ReadFile failed. Error code is {0}.. Looks up a localized string similar to Native API call to WriteFile failed. Error code is {0}.. Looks up a localized string similar to Cannot delete temporary file {0}. Try again. Reason for failure: {1}.. Looks up a localized string similar to New shell successfully registered. However cannot delete temporary file {0}. Reason for failure: {1}.. Looks up a localized string similar to Cannot write shell configuration data into temporary file {0}. Try again. Reason for failure: {1}.. Looks up a localized string similar to Running command "{0}" to create a new Session Configuration.. Looks up a localized string similar to Name: {0} SDDL: {1}. This will allow selected users to remotely run Windows PowerShell commands on this computer. Looks up a localized string similar to Invoking a nested pipeline requires a valid runspace.. Looks up a localized string similar to Creation of nested pipelines is not supported in remote runspaces.. Looks up a localized string similar to The Microsoft .NET Framework 2.0, which is required for Windows PowerShell 2.0, is not installed. Install the .NET Framework 2.0 and retry.. Looks up a localized string similar to The job could not be created because the JobInvocationInfo does not contain a JobDefinition. Initialize the JobInvocationInfo with a JobDefinition.. Looks up a localized string similar to A {0} cannot be specified when {1} is specified.. Looks up a localized string similar to Expected "{0}" and "{1}" attributes in "{2}" element.. Looks up a localized string similar to EndpointConfiguration with Id {0} does not exist on the remote server. Contact your administrator.. Looks up a localized string similar to A running command could not be found for this PSSession.. Looks up a localized string similar to An error occurred while decoding data received from the remote computer. Need at least {0} bytes of data to decode a deserialized object received from remote computer. This can happen if the fragments are not properly constructed by the remote computer, or the data might have been corrupted or changed.. Looks up a localized string similar to ObjectId cannot be less than or equal to 0. This may happen if the fragments are not properly constructed by the remote machine or the data has been tampered with.. Looks up a localized string similar to Unexpected ObjectId received. This can happen if the fragments are not properly constructed by the remote computer, or the data might have been corrupted or changed.. Looks up a localized string similar to Remoting data is too large to be reassembled from the fragments. This may happen if length of the data in a fragment is greater than Int32.Max or the data might have been tampered with.. Looks up a localized string similar to Out of process memory.. Looks up a localized string similar to The remote pipeline failed.. Looks up a localized string similar to The remote pipeline failed for the following reason: {0}. Looks up a localized string similar to Pipeline ID "{0}" does not match the currently executing pipeline's InstanceId "{1}".. Looks up a localized string similar to Pipeline Id "{0}" was not found on the server;. Looks up a localized string similar to The remote pipeline has been stopped.. Looks up a localized string similar to Port number {0} is out or range. Valid range is between 1 and 65535.. Looks up a localized string similar to Windows PowerShell version {0} is not installed. Install Windows PowerShell version {0} and retry.. Looks up a localized string similar to {0} cannot be specified as a proxy authentication mechanism. Only {1},{2} or {3} are supported for proxy authentication.. Looks up a localized string similar to Proxy credentials cannot be specified when using the following proxy access type: {0}. Either specify a different access type, or do not specify proxy credentials.. Looks up a localized string similar to Default session options for new remote sessions.. Looks up a localized string similar to Reason in a deserialized Job object is not valid.. Looks up a localized string similar to Contains information about the remote user starting the remote session. This variable is available only from a remote session.. Looks up a localized string similar to AppName where the remote connection will be established. Looks up a localized string similar to The specified configuration file '{0}' was not loaded because no valid configuration file was found.. Looks up a localized string similar to Name of the session configuration which will be loaded on the remote computer. Looks up a localized string similar to The value {0} is not valid for the {1} parameter. The available values are 2.0 and 3.0.. Looks up a localized string similar to Session must be open.. Looks up a localized string similar to The remote session query failed for {0} with the following error message: {1}. Looks up a localized string similar to Computer {0} has been successfully disconnected.. Looks up a localized string similar to Network connectivity to {0} has been lost and the reconnection attempt failed. Please repair the network connection and reconnect using Connect-PSSession or Receive-PSSession.. Looks up a localized string similar to The reconnection attempt to {0} failed. Attempting to disconnect the session.... Looks up a localized string similar to Attempting to reconnect to {0} .... Looks up a localized string similar to Job {0} has been created for reconnection.. Looks up a localized string similar to Session {0} with instance ID {1} on computer {2} has been successfully disconnected.. Looks up a localized string similar to Session {0} with instance ID {1} has been created for reconnection.. Looks up a localized string similar to Network connectivity to {0} has been lost and the attempt to reconnect has failed. Please repair the network connection and reconnect using Connect-PSSession or Receive-PSSession.. Looks up a localized string similar to The network connection to {0} has been interrupted. Attempting to reconnect for up to {1} minutes.... Looks up a localized string similar to Network connection interrupted. Looks up a localized string similar to Attempting to reconnect to {0} .... Looks up a localized string similar to The network connection to {0} has been restored.. Looks up a localized string similar to Running command "{0}" to remove a Session Configuration.. Looks up a localized string similar to The total data received from the remote server exceeded allowed maximum. Allowed maximum is {0}.. Looks up a localized string similar to The total data received from the remote client exceeded allowed maximum. Allowed maximum is {0}.. Looks up a localized string similar to "Received data has stream id index "{0}". Only Standard Output stream id index "0" is supported.. Looks up a localized string similar to The current deserialized object size of the data received from remote server exceeded allowed maximum object size. The current deserialized object size is {0}. Allowed maximum object size is {1}.. Looks up a localized string similar to The current deserialized object size of the data received from remote client exceeded allowed maximum object size. The current deserialized object size is {0}. Allowed maximum object size is {1}.. Looks up a localized string similar to Received remoting data with unsupported action: {0}.. Looks up a localized string similar to Received remoting data with unsupported data type: {0}.. Looks up a localized string similar to Received unsupported remote host call: {0}.. Looks up a localized string similar to Received unsupported RemotingTargetInterface type: {0}. Looks up a localized string similar to Processing data from remote server {0} failed with the following error message: {1}. Looks up a localized string similar to Receiving data from remote server {0} failed.. Looks up a localized string similar to Reconnecting to a command on remote server failed with the following error message : {0}. Looks up a localized string similar to Reconnecting to the remote server {0} failed with the following error message : {1}. Looks up a localized string similar to Re-connecting to remote server failed.. Looks up a localized string similar to The destination "{0}" requested the connection to be redirected to "{1}". However "{1}" is not a well formatted URI.. Looks up a localized string similar to Relative URIs are not supported in the creation of remote sessions.. Looks up a localized string similar to Remote host call to "{0}" failed.. Looks up a localized string similar to Remote host method data decoding is not supported for type {0}.. Looks up a localized string similar to Remote host method data encoding is not supported for type {0}.. Looks up a localized string similar to Failure in decoding data from the remote host. There was an error in the network data.. Looks up a localized string similar to You are currently in a Windows PowerShell PSSession and cannot use the Enter-PSSession cmdlet to enter another PSSession.. Looks up a localized string similar to A script or application on the {0} remote computer is attempting to read the buffer contents on the Windows PowerShell host. This is not allowed and the call has been suppressed.. Looks up a localized string similar to Remote host method {0} is not implemented.. Looks up a localized string similar to No client computer was specified for the remote runspace that is running a client-side method.. Looks up a localized string similar to Windows PowerShell Credential Request : {0}. Looks up a localized string similar to Warning: This credential is being requested by a script or application on the {0} remote computer. Enter your credentials only if you trust the remote computer and the application or script requesting it. {1}. Looks up a localized string similar to A script or application on the {0} remote computer is sending a prompt request. When prompted, enter sensitive information such as credentials or password only if you trust the remote computer and the application or script requesting it.. Looks up a localized string similar to A script or application on the {0} remote computer is requesting to read a line securely. Enter sensitive information such as your credentials only if you trust the remote computer and the application or script requesting it.. Looks up a localized string similar to Remote Session closed for Uri {0}.. Looks up a localized string similar to Enter-PSSession failed because the remote Session does not provide commands that it needs.. Looks up a localized string similar to Multiple matches found for name {0}.. Looks up a localized string similar to Multiple matches found for Session ID {0}.. Looks up a localized string similar to Multiple matches found for session ID {0}.. Looks up a localized string similar to Specified RemoteRunspaceInfo objects have duplicates.. Looks up a localized string similar to Specified RemoteRunspaceInfo objects have exceeded the maximum allowable limit.. Looks up a localized string similar to Remote session is not available for ComputerName {0}.. Looks up a localized string similar to Remote session with Name {0} is not available.. Looks up a localized string similar to Remote session is not available for {0}.. Looks up a localized string similar to Remote session with session id {0} is not available.. Looks up a localized string similar to Remote session open failed.. Looks up a localized string similar to Opening remote Session failed with unexpected state. State {0}.. Looks up a localized string similar to Received packet not destined for me: myself = {0}, packet destination = {1}.. Looks up a localized string similar to Remote Command: {0}, associated with job whose job ID is "{1}".. Looks up a localized string similar to Remote session {0} could not be connected and could not be removed from the server. The client remote session object will be removed from the server, but the state of the remote session on the server is unknown.. Looks up a localized string similar to Prompt response has a prompt id "{0}" that cannot be found.. Looks up a localized string similar to This operation may restart WinRM. Do you wish to continue?. Looks up a localized string similar to WinRM service must be restarted before a UI can be displayed for SecurityDescriptor selection. Restart WinRM service and run the command: "{0}". Looks up a localized string similar to "Restart-Service". Looks up a localized string similar to Restarting WinRM service". Looks up a localized string similar to Name: {0}. Looks up a localized string similar to One or more jobs could not be resumed because the state was not valid for the operation.. Looks up a localized string similar to When RunAs is enabled for a Windows PowerShell session configuration, the Windows security model will not enforce a security boundary between sessions of different users that are created through this endpoint. Ensure that the Windows PowerShell runspace configuration is restricted to only the necessary set of cmdlets and capabilities.. Looks up a localized string similar to Starting a command on remote server failed with the following error message : {0}. Looks up a localized string similar to Starting a command on remote server failed.. Looks up a localized string similar to Session already exists. Trying to create Session again with the same client Session InstanceId {0} is not allowed.. Looks up a localized string similar to Cannot connect PSSession "{0}" because it is not in Disconnected state or is not available for connection.. Looks up a localized string similar to Cannot disconnect PSSession "{0}" because it is not in the Opened state.. Looks up a localized string similar to Requested remote Session with client InstanceId "{0}" cannot be found.. Looks up a localized string similar to The connect operation failed for session {0}. The Runspace state is {1} instead of Opened.. Looks up a localized string similar to The connect operation failed for session {0} with the following error message: {1}. Looks up a localized string similar to Disconnect-PSSession operation failed for runspace Id = {0}. Looks up a localized string similar to Disconnect-PSSession operation failed for runspace Id = {0} for the following reason: {1}. Looks up a localized string similar to Received client Session InstanceId "{0}" does not matching my Session's InstanceId "{1}".. Looks up a localized string similar to Session parameter can be used only with PSRemotingJob objects. Looks up a localized string similar to Disconnected PSSession query failed for computer "{0}". Looks up a localized string similar to Running command "{0}" to update Session Configuration properties.. Looks up a localized string similar to Name: {0} SDDL: {1}. Looks up a localized string similar to Sending data to remote server {0} failed with the following error message : {1}. Looks up a localized string similar to Sending data to remote server {0} failed.. Looks up a localized string similar to Windows PowerShell server cannot process the connect operation because the following information is not found or not valid: Client Capability information and Connect RunspacePool information.. Looks up a localized string similar to Windows PowerShell server cannot process the connect operation because the server runspace pool properties did not match the client specified properties.. Looks up a localized string similar to Windows PowerShell server does not support connect operation on the {0} {1} negotiated by the client. Make sure the client is compatible with the build {2} and the protocol version {3} of Windows PowerShell.. Looks up a localized string similar to Windows PowerShell server cannot process the connect operation because it is not initialized or shutting down.. Looks up a localized string similar to The client did not respond with a public key within the specified time-out period.. Looks up a localized string similar to PowerShell server does not support the {0} {1} negotiated by the client. Make sure the client is compatible with the build {2} and the protocol version {3} of Windows PowerShell.. Looks up a localized string similar to The server negotiation timer has expired. The negotiation time-out interval is {0} milliseconds.. Looks up a localized string similar to {0}. Negotiation with the client failed. Make sure the client is compatible with the build {1} and the protocol version {2} of Windows PowerShell.. Looks up a localized string similar to The server process has exited.. Looks up a localized string similar to Server has requested to close the session.. Looks up a localized string similar to A failure occurred while attempting to connect the PSSession.. Looks up a localized string similar to The command cannot find a PSSession with InstanceId value of "{0}".. Looks up a localized string similar to The command cannot find a PSSession with "{0}" name.. Looks up a localized string similar to The SessionName parameter can only be used with the Disconnected switch parameter.. Looks up a localized string similar to The PSSession is in a disconnected state and is not available for connection.. Looks up a localized string similar to Enabled: False. This will configure the WS-Management service to deny the connection request. Looks up a localized string similar to Enabled: True. This will configure the WS-Management service to accept connection request. Looks up a localized string similar to "{0}" and "{1}" parameters cannot be specified together. Specify either "{0}" or "{1}" parameter.. Looks up a localized string similar to Cannot find a scheduled job with name {0}.. Looks up a localized string similar to Cannot find a scheduled job with type {0} and name {1}.. Looks up a localized string similar to Cannot retrieve the job definition '{0}' because path '{1}' refers to a '{2}' provider path. Change the path parameter to a file system path.. Looks up a localized string similar to Cannot retrieve the job definition '{0}' because path '{1}' resolves to multiple file paths. Change the path parameter so that it is a single path.. Looks up a localized string similar to More than one job definition was found with name {0}. Try including the -DefinitionType parameter to Start-Job in order to narrow the search for the job definition to a single job source adapter.. Looks up a localized string similar to "{0}" must specify a Windows PowerShell script file that ends with extension ".ps1".. Looks up a localized string similar to Running startup script threw an error: {0}.. Looks up a localized string similar to Standard Input handle cannot be set to no wait state. System error code is {0}.. Looks up a localized string similar to Standard Input handle is not open.. Looks up a localized string similar to Reconnection attempt canceled. Please repair the network connection and reconnect using Connect-PSSession or Receive-PSSession.. Looks up a localized string similar to Job "{0}" could not be connected to the server and so could not be stopped.. Looks up a localized string similar to Remote Command: {0}, associated with job whose job ID is "{1}".. Looks up a localized string similar to One or more jobs could not be suspended because the state was not valid for the operation.. Looks up a localized string similar to The ThrottlingJob.AddChildJob method cannot be called after a call to the ThrottlingJob.EndOfChildJobs method.. Looks up a localized string similar to The ThrottlingJob.AddChildJob method accepts only child jobs in the NotStarted state.. Looks up a localized string similar to Memory usage of a cmdlet has exceeded a warning level. To avoid this situation, try one of the following: 1) Lower the rate at which CIM operations produce data (for example, by passing a low value to the ThrottleLimit parameter), 2) Increase the rate at which data is consumed by downstream cmdlets, or 3) Use the Invoke-Command cmdlet to run the whole pipeline on the server. The cmdlet that exceeded a warning level of memory usage was started by the following command line: {0}. Looks up a localized string similar to {0}/{1} completed. Looks up a localized string similar to {0} For more information, see the about_Remote_Troubleshooting Help topic.. Looks up a localized string similar to Both "{0}" and "{1}" must be specified in the "{2}" section.. Looks up a localized string similar to Unable to load assembly "{0}" specified in "{1}" section.. Looks up a localized string similar to Unable to load type "{0}" specified in "{1}" section.. Looks up a localized string similar to Remote host method was invoked on an unknown target class: {0}. Looks up a localized string similar to The wait handle type "{0}" is not supported.. Looks up a localized string similar to {0}Redirect location reported: {1}.. Looks up a localized string similar to {0} To automatically connect to the redirected URI, verify "{1}" property of session preference variable "{2}" and use "{3}" parameter on the cmdlet.. Looks up a localized string similar to Your connection has been redirected to the following URI: "{0}". Looks up a localized string similar to Specified Uri {0} is not valid.. Looks up a localized string similar to SharedHost attribute cannot be set to false on a Workflow session type configuration.. Looks up a localized string similar to Wildcards are not supported for FilePath parameter. Specify a path without wildcards.. Looks up a localized string similar to Windows PowerShell remoting is not supported in WinPE platform.. Looks up a localized string similar to Changes made by {0} will not take effect until WinRM service is restarted.. Looks up a localized string similar to {0} restarts the WinRM service and all dependent services. All WinRM sessions connected to Windows PowerShell session configurations, such as Microsoft.PowerShell and session configurations that are created with the Register-PSSessionConfiguration cmdlet, are disconnected.. Looks up a localized string similar to The -WriteEvents parameter cannot be used without the -Wait parameter. Looks up a localized string similar to The -WriteJobInResults parameter cannot be used without the -Wait parameter. Looks up a localized string similar to A {0} value must be specified for session option {1}.. Looks up a localized string similar to The maximum number of WSMan URI redirections to allow while connecting to a remote computer.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Use "list" to start from the current line, "list <m>" . Looks up a localized string similar to to start from line <m>, and "list <m> <n>" to list <n> . Looks up a localized string similar to lines starting from line <m>. Looks up a localized string similar to The line count must be a positive integer no greater than {0}.. Looks up a localized string similar to The starting line must be a positive integer no greater than {0}. Looks up a localized string similar to Command breakpoint on '{0}'. Looks up a localized string similar to Command breakpoint on '{0}:{1}'. Looks up a localized string similar to {0}, {1,-16} Continue operation. Looks up a localized string similar to <enter> Repeat last command if it was {0}, {1} or {2}. Looks up a localized string similar to {0}, Get-PSCallStack Display call stack. Looks up a localized string similar to {0}, {1,-16} displays this help message.. Looks up a localized string similar to Line breakpoint on '{0}:{1}'. Looks up a localized string similar to {0}, {1,-16} List source code for the current script. . Looks up a localized string similar to {0}: line {1}. Looks up a localized string similar to <No file>. Looks up a localized string similar to There is no source code available.. Looks up a localized string similar to For instructions about how to customize your debugger prompt, type "help about_prompt".. Looks up a localized string similar to The current session does not support debugging; operation will continue. . Looks up a localized string similar to at {0}, {1}: line {2}. Looks up a localized string similar to Line breakpoint on '{0}:{1}, {2}'. Looks up a localized string similar to {0}, {1,-16} Single step (step into functions, scripts, etc.). Looks up a localized string similar to {0}, {1,-16} Step out of the current function, script, etc.. Looks up a localized string similar to {0}, {1,-16} Step to next statement (step over functions, scripts, etc.). Looks up a localized string similar to {0}, {1,-16} Stop operation and exit the debugger. Looks up a localized string similar to Variable breakpoint on '${0}' ({1} access). Looks up a localized string similar to Variable breakpoint on '{0}:${1}' ({2} access). Looks up a localized string similar to Breakpoint {0} will not be hit. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Aliases to export from this module. Looks up a localized string similar to Author of this module. Looks up a localized string similar to Cannot define workflow. The language mode for this session is incompatible with the system-wide language mode.. Looks up a localized string similar to Cannot verify the Microsoft .NET Framework version {0} because it is not included in the list of permitted versions.. Looks up a localized string similar to The Export-ModuleMember cmdlet can only be called from inside a module.. Looks up a localized string similar to No custom object was returned for module '{0}' because the -AsCustomObject parameter can only be used with script modules.. Looks up a localized string similar to Minimum version of the common language runtime (CLR) required by this module. Looks up a localized string similar to The value of the {0} key in {1} is {2} and the module has nested modules. When a CDXML file is the root module, the Import-Module command fails because the commands in nested modules cannot be exported. Move the CDXML file to the NestedModules key and try the command again.. Looks up a localized string similar to Cmdlets to export from this module. Looks up a localized string similar to Company or vendor of this module. Looks up a localized string similar to {0} (Path: '{1}'). Looks up a localized string similar to Copyright statement for this module. Looks up a localized string similar to The module '{0}' is a core module for Windows PowerShell. Use the -force flag to remove core modules.. Looks up a localized string similar to Creating the "{0}" module manifest file.. Looks up a localized string similar to Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.. Looks up a localized string similar to Unknown. Looks up a localized string similar to (c) {0} {1}. All rights reserved.. Looks up a localized string similar to Description of the functionality provided by this module. Looks up a localized string similar to Minimum version of the .NET Framework required by this module. Looks up a localized string similar to Dot-sourcing the script file '{0}'.. Looks up a localized string similar to Processing the module manifest file '{0}' did not result in a valid manifest object. Update the file to contain a valid Windows PowerShell module manifest. A valid manifest can be created using the New-ModuleManifest cmdlet.. Looks up a localized string similar to Command cannot be exported as workflow '{0}'.. Looks up a localized string similar to Exporting alias '{0}'.. Looks up a localized string similar to Exporting cmdlet '{0}'.. Looks up a localized string similar to Exporting command as workflow '{0}'.. Looks up a localized string similar to Exporting function '{0}'.. Looks up a localized string similar to Exporting variable '{0}'.. Looks up a localized string similar to Exporting workflow '{0}'.. Looks up a localized string similar to List of all files packaged with this module. Looks up a localized string similar to The specified format data file '{0}' could not be processed because the file was not found. Please correct the path and try again.. Looks up a localized string similar to Format files (.ps1xml) to be loaded when importing this module. Looks up a localized string similar to Functions to export from this module. Looks up a localized string similar to The parameter 'Global' and 'Scope' cannot be specified together. Please remove one of them and try again.. Looks up a localized string similar to ID used to uniquely identify this module. Looks up a localized string similar to HelpInfo URI of this module. Looks up a localized string similar to Importing alias '{0}'.. Looks up a localized string similar to Importing cmdlet '{0}'.. Looks up a localized string similar to Importing function '{0}'.. Looks up a localized string similar to Some imported command names contain one or more of the following restricted characters: # , ( ) {{ }} [ ] & - / \ $ ^ ; : " ' < > | ? @ ` * % + = ~. Looks up a localized string similar to The command name '{0}' from the module '{1}' contains one or more of the following restricted characters: # , ( ) {{ }} [ ] & - / \ $ ^ ; : " ' < > | ? @ ` * % + = ~. Looks up a localized string similar to The names of some imported commands from the module '{0}' include unapproved verbs that might make them less discoverable. To find the commands with unapproved verbs, run the Import-Module command again with the Verbose parameter. For a list of approved verbs, type Get-Verb.. Looks up a localized string similar to The '{0}' command in the {1}' module was imported, but because its name does not include an approved verb, it might be difficult to find. For a list of approved verbs, type Get-Verb.. Looks up a localized string similar to The '{0}' command in the {2}' module was imported, but because its name does not include an approved verb, it might be difficult to find. The suggested alternative verbs are "{1}".. Looks up a localized string similar to Importing variable '{0}'.. Looks up a localized string similar to Importing command as workflow '{0}'.. Looks up a localized string similar to The alias '{0}' was not imported because there is a member with the same name in the current scope.. Looks up a localized string similar to The cmdlet '{0}' was not imported because there is a member with the same name in the current scope.. Looks up a localized string similar to The function '{0}' was not imported because there is a member with the same name in the current scope.. Looks up a localized string similar to The variable '{0}' was not imported because there is a member with the same name in the current scope.. Looks up a localized string similar to The command '{0}' was not imported as a workflow because there is a member with the same name in the current scope.. Looks up a localized string similar to The item {0} that resolves to {1} is not located in the same directory as the module manifest or any of its subdirectories. Windows PowerShell looks for items referenced in the manifest only in paths relative to the manifest location. To fix this problem, move the item, and use a relative path to identify its location.. Looks up a localized string similar to The module '{0}' requires the following version of the .NET Framework: {1}. The required version is not installed.. Looks up a localized string similar to The extension '{0}' is not a valid module extension. The supported module extensions are '.dll', '.ps1', '.psm1', '.psd1', '.cdxml' and '.xaml'. Correct the extension then try adding the file '{1}' again.. Looks up a localized string similar to The module manifest '{0}' could not be processed because it is not a valid Windows PowerShell restricted language file. Please remove the elements that are not permitted by the restricted language: {1}. Looks up a localized string similar to The '{0}' module cannot be imported because its manifest contains one or more members that are not valid. The valid manifest members are ({1}). Remove the members that are not valid ({2}), then try to import the module again.. Looks up a localized string similar to Module Manifest path '{0}' is not valid. The path argument must resolve to a single file in the file system with a '.psd1' extension. Please fix the path specification and try again.. Looks up a localized string similar to The hashtable describing a module contains one or more members that are not valid. The valid members are ({0}). Remove the members that are not valid ({1}), then try again.. Looks up a localized string similar to This operation cannot be performed on a binary module. Please try again with a script module.. Looks up a localized string similar to The name of the current Windows PowerShell host is: '{0}'. The module '{1}' requires the following PowerShell host: '{2}'.. Looks up a localized string similar to The current Windows PowerShell host is: '{0}' (version {1}). The module '{2}' requires a minimum Windows PowerShell host version of '{3}' to run.. Looks up a localized string similar to The current processor architecture is: {0}. The module '{1}' requires the following architecture: {2}.. Looks up a localized string similar to The processor architecture value of {0} is not supported. Run the New-ModuleManifest command again specifying one of the following enumeration values. The possible enumeration values are "None, MSIL, X86, Amd64, Arm".. Looks up a localized string similar to The workflow file name is not valid because it does not have the required .XAML file name extension. Run the New-ModuleManifest command again specifying a value for the WorkflowsToProcess parameter with this extension.. Looks up a localized string similar to The workflow file name extension is not valid. The workflow file name {0} listed in the WorkflowsToProcess key of the module manifest does not have the required .XAML or .DLL file name extension. Edit the module manifest and correct the workflow file name. If providing .DLL file extension, then provide only one assembly name.. Looks up a localized string similar to Loading '{0}' from path '{1}'.. Looks up a localized string similar to Loading module from path '{0}'.. Looks up a localized string similar to Loading workflow {0}. Looks up a localized string similar to Module manifest for module '{0}'. Looks up a localized string similar to Generated by: {0}. Looks up a localized string similar to Generated on: {0}. Looks up a localized string similar to The module to process '{0}', listed in field '{1}' of module manifest '{2}' was not processed because no valid module was found in any module directory.. Looks up a localized string similar to Some commands from module {0} cannot be imported over a CimSession. To get all the commands, verify that the remote server has Windows PowerShell remote management enabled, and then try adding the PSSession parameter to an Import-Module cmdlet.. Looks up a localized string similar to The assembly '{0}' was not loaded because no assembly was found. Please check the assembly name and try again.. Looks up a localized string similar to The following module is providing the PSDrive in the current Windows PowerShell session: {0}. Therefore no modules were removed. Change the current PSDrive and retry.. Looks up a localized string similar to Unable to remove module '{0}' because it is marked as constant. A module cannot be removed if it is marked constant.. Looks up a localized string similar to Unable to remove module '{0}' because it is read-only. Use the -force flag to remove read-only modules.. Looks up a localized string similar to Unable to remove module '{0}' because it is required by '{1}'. Use the -force flag to remove the module.. Looks up a localized string similar to List of all modules packaged with this module.. Looks up a localized string similar to The '{0}' module was not imported because the '{0}' snap-in was already imported.. Looks up a localized string similar to The module manifest cannot contain both 'ModuleToProcess' member and 'RootModule' member. Please fix the module manifest file at '{0}' and try again.. Looks up a localized string similar to The version of the loaded CLR is '{0}'. The module '{1}' requires a minimum CLR version of '{2}' to run. Please verify the installation of the CLR and try again.. Looks up a localized string similar to The version '{0}' of module '{1}' does not meet the required minimum version '{2}'. Please verify the version number and try loading the module again.. Looks up a localized string similar to The version of the loaded Windows PowerShell is '{0}'. The module '{1}' requires a minimum Windows PowerShell version of '{2}' to run. Please verify the installation of the Windows PowerShell and try again.. Looks up a localized string similar to The member '{0}' in the module manifest is not valid: {1}. Please make sure that a valid value is specified for this field in file '{2}'.. Looks up a localized string similar to The '{0}' member is not valid in the module manifest file '{2}': {1}. Looks up a localized string similar to The member 'ModuleVersion' is not present in the module manifest. This member must exist and be assigned a version number of the form 'n.n.n.n'. Please add the missing member to the file '{0}'.. Looks up a localized string similar to The module manifest member 'NestedModules' cannot be used if 'ModuleToProcess' member is a binary module. Please fix the module manifest file at '{0}' and try again.. Looks up a localized string similar to The specified module '{0}' was not loaded because no valid module file was found in any module directory.. Looks up a localized string similar to Cannot load module '{0}' because the module nesting limit has been reached. Modules can only be nested to {1} levels. Please reexamine the order in which you are loading modules so that they are not as deeply nested then try running your script again.. Looks up a localized string similar to Script module or binary module file associated with this manifest. Looks up a localized string similar to The module manifest member 'ModuleToProcess' has been deprecated. Please use 'RootModule' instead.. Looks up a localized string similar to Version number of this module.. Looks up a localized string similar to The specified module '{0}' with version '{1}' was not loaded because no valid module file was found in any module directory.. Looks up a localized string similar to Modules to import as nested modules of the module specified in RootModule/ModuleToProcess. Looks up a localized string similar to No modules were removed. Verify that the specification of modules to remove is correct and those modules exist in the runspace.. Looks up a localized string similar to Name of the Windows PowerShell host required by this module. Looks up a localized string similar to Minimum version of the Windows PowerShell host required by this module. Looks up a localized string similar to Minimum version of the Windows PowerShell engine required by this module. Looks up a localized string similar to Private data to pass to the module specified in RootModule/ModuleToProcess. Looks up a localized string similar to Processor architecture (None, X86, Amd64) required by this module. Looks up a localized string similar to The module {0} cannot be imported over a CimSession. Try using the PSSession parameter of the Import-Module cmdlet.. Looks up a localized string similar to Failed to generate proxies for remote module '{0}'. {{0}}. Looks up a localized string similar to Failed to process the remote module {0}. {1}. Looks up a localized string similar to Failed to receive module data from the remote CimSession. {0}. Looks up a localized string similar to CIM provider for module discovery was not found on the CIM server. {0}. Looks up a localized string similar to Failure from remote command: {0}: {{0}}. Looks up a localized string similar to Get-Module against a remote computer can only list available modules. Add a ListAvailable switch and try again.. Looks up a localized string similar to Removing the imported "{0}" alias.. Looks up a localized string similar to Removing the imported "{0}" function.. Looks up a localized string similar to Removing the imported "{0}" variable.. Looks up a localized string similar to Assemblies that must be loaded prior to importing this module. Looks up a localized string similar to The 'ModuleName' member is not present in the hashtable describing a module.. Looks up a localized string similar to The 'ModuleVersion' member is not present in the hashtable describing a module. This member must exist and be assigned a version number of the form 'n.n.n.n'.. Looks up a localized string similar to The required module '{0}' was not loaded because no valid module file was found in any module directory.. Looks up a localized string similar to The required module '{0}' with GUID '{1}' and version '{2}' was not loaded because no valid module file was found in any module directory.. Looks up a localized string similar to The required module '{1}' is not loaded. Load the module or remove the module from 'RequiredModules' in the file '{0}'.. Looks up a localized string similar to The required module '{1}' with GUID '{2}' is not loaded. Load the module or remove the module from 'RequiredModules' in the file '{0}'.. Looks up a localized string similar to The required module '{1}' with version '{2}' is not loaded. Load the module or remove the module from 'RequiredModules' in the file '{0}'.. Looks up a localized string similar to Modules that must be imported into the global environment prior to importing this module. Looks up a localized string similar to The required module '{0}' is not loaded. The module '{0}' has a requiredModule '{1}' in its module manifest '{2}' that points to a cyclic dependency.. Looks up a localized string similar to Script module or binary module file associated with this manifest.. Looks up a localized string similar to The specified script file '{0}' could not be processed because the file was not found. Please correct the path and try again.. Looks up a localized string similar to Script files (.ps1) that are run in the caller's environment prior to importing this module.. Looks up a localized string similar to The file '{0}' is not allowed because it does not have the extension '.ps1'.. Looks up a localized string similar to The specified type data file '{0}' could not be processed because the file was not found. Please correct the path and try again.. Looks up a localized string similar to Type files (.ps1xml) to be loaded when importing this module. Looks up a localized string similar to The '{0}' member, which was imported from module '{1}', cannot be removed for the following reason: {2}. Looks up a localized string similar to Variables to export from this module. Looks up a localized string similar to Wild card characters are not allowed in members 'ModuleToProcess', 'RootModule' and 'NestedModule' in the module manifest '{0}'.. Looks up a localized string similar to Wild card characters are not allowed in the member 'RequiredAssemblies' in the module manifest '{0}'.. Looks up a localized string similar to Commands to export from this module as Workflows. Looks up a localized string similar to Cannot load workflow. XAML-based workflows are not supported in this language mode. Only script-based workflows are supported.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Ambiguous key {0};{1} and {2} conflict.. Looks up a localized string similar to Illegal key type {0}. The key must be a string.. Looks up a localized string similar to Key cannot be null.. Looks up a localized string similar to Duplicated key "{0}" conflicts with "{1}".. Looks up a localized string similar to Cannot have an empty formatting string for key "{0}".. Looks up a localized string similar to The value "{0}" for key "{1}" is not valid; valid values are {2}.. Looks up a localized string similar to Illegal EnumerableExpansion value.. Looks up a localized string similar to Illegal key {0}. Looks up a localized string similar to Key "{0}" has illegal type {1}; expected types are {2}.. Looks up a localized string similar to Key "{0}" has illegal type {1}; expected type is {2}.. Looks up a localized string similar to Missing mandatory entry for {0}.. Looks up a localized string similar to Key {0} has no value.. Looks up a localized string similar to Empty string is not allowed.. Looks up a localized string similar to Key "{0}" cannot have an empty string value.. Looks up a localized string similar to Key "{0}" cannot have wildcard characters in value "{1}".. Looks up a localized string similar to Wildcard characters are not allowed in "{0}".. Looks up a localized string similar to Null parameter. Expecting one of the following types: {0}.. Looks up a localized string similar to Value "{0}" for key "{1}" should be >0.. Looks up a localized string similar to Cannot convert {0} to one of the following types {1}.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Cmdlet parameters AutoSize and Column are mutually exclusive.. Looks up a localized string similar to Cmdlet parameters View and Property are mutually exclusive.. Looks up a localized string similar to Unknown class Id {0}.. Looks up a localized string similar to Failed to create object with class Id {0}.. Looks up a localized string similar to Object is not of recognized type.. Looks up a localized string similar to Invalid type {0} for property {1}.. Looks up a localized string similar to Data member {0} cannot be null.. Looks up a localized string similar to Property {0} is recursive.. Looks up a localized string similar to Failed to interpret format string "{0}".. Looks up a localized string similar to {0}: . Looks up a localized string similar to The following object supports IEnumerable:. Looks up a localized string similar to The IEnumerable contains the following {0} objects:. Looks up a localized string similar to The IEnumerable contains no objects.. Looks up a localized string similar to The IEnumerable contains the following object:. Looks up a localized string similar to View name {0} cannot be found. Specify one of the following {1} views and try again: {2}.. Looks up a localized string similar to Failed to evaluate Expression "{0}".. Looks up a localized string similar to There are no existing {0} views for {1} objects.. Looks up a localized string similar to Try using one of these other format cmdlets: . Looks up a localized string similar to View name {0} cannot be found.. Looks up a localized string similar to View name {0} cannot be found in the {1} formatting.. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to <SPACE> next page; <CR> next line; Q quit. Looks up a localized string similar to Output to File. Looks up a localized string similar to Cannot open file "{0}".. Looks up a localized string similar to Unexpected lineOutput type {0}; LineOutput expects type {1}.. Looks up a localized string similar to LineOutput should not be null.. Looks up a localized string similar to The object of type "{0}" is not valid or not in the correct sequence. This is likely caused by a user-specified "{1}" command which is conflicting with the default formatting..