Microsoft.PowerShell.Commands Namespace

Classes

AddHistoryCommand

This class Implements the add-history command

AddPSSnapinCommand

Class that implements add-pssnapin cmdlet.

AliasProvider

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.

AliasProviderDynamicParameters

The dynamic parameter object for the AliasProvider SetItem and NewItem commands

AlternateStreamData

Represents alternate stream data retrieved from a file.

CertificateNotFoundException

Defines the exception thrown by the certificate provider when the specified X509 certificate cannot be located.

CertificateProvider

Defines the implementation of a Certificate Store Provider. This provider allows for stateless namespace navigation of the computer's certificate store.

CertificateProviderItemNotFoundException

Defines the base class for exceptions thrown by the certificate provider when the specified item cannot be located.

CertificateStoreLocationNotFoundException

Defines the exception thrown by the certificate provider when the specified X509 store location cannot be located.

CertificateStoreNotFoundException

Defines the exception thrown by the certificate provider when the specified X509 store cannot be located.

ClearHistoryCommand

This Class implements the Clear History cmdlet

ConnectPSSessionCommand

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
ConsoleCmdletsBase

Base class for all the Console related cmdlets.

ConvertFromSecureStringCommand

Defines the implementation of the 'ConvertFrom-SecureString' cmdlet. This cmdlet exports a new SecureString -- one that represents text that should be kept confidential. The text is encrypted for privacy when being used, and deleted from computer memory when no longer needed. When no key is specified, the command uses the DPAPI to encrypt the string. When a key is specified, the command uses the Rijndael algorithm to encrypt the string.

ConvertFromToSecureStringCommandBase

Defines the base class from which all SecureString import and export commands are derived.

ConvertToSecureStringCommand

Defines the implementation of the 'ConvertTo-SecureString' cmdlet. This cmdlet imports a new SecureString from encrypted data -- one that represents text that should be kept confidential. The text is encrypted for privacy when being used, and deleted from computer memory when no longer needed. When no key is specified, the command uses the DPAPI to decrypt the data. When a key is specified, the command uses the Rijndael algorithm to decrypt the data.

DebugJobCommand
DisablePSRemotingCommand

Disable-PSRemoting cmdlet Only disable the network access to the Session Configuration. The local access is still enabled

DisablePSSessionConfigurationCommand
DisconnectPSSessionCommand

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
DnsNameProperty

class for DNSNameList

EnablePSRemotingCommand
EnablePSSessionConfigurationCommand

Class implemeting Enable-PSSessionConfiguration cmdlet

EnhancedKeyUsageProperty

class for ekulist

EnterPSHostProcessCommand
EnterPSSessionCommand

Enter-PSSession cmdlet.

EnvironmentProvider

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.

ExitPSHostProcessCommand
ExitPSSessionCommand

Exit-PSSession cmdlet.

ExportConsoleCommand

Class that implements export-console cmdlet.

ExportCounterCommand
ExportModuleMemberCommand

Implements a cmdlet that loads a module

FileSystemClearContentDynamicParameters

Defines the dynamic parameters used by the Clear-Content cmdlet.

FileSystemContentDynamicParametersBase

Defines the dynamic parameters used by both the content reader and writer.

FileSystemContentReaderDynamicParameters

Defines the dynamic parameters used by the get-content cmdlet.

FileSystemContentWriterDynamicParameters

Defines the dynamic parameters used by the set-content and add-content cmdlets.

FileSystemItemProviderDynamicParameters

Provides the dynamic parameters for test-path on the file system.

FileSystemProvider

Defines the implementation of a File System Provider. This provider allows for stateless namespace navigation of the file system.

FileSystemProviderGetItemDynamicParameters

Provides the dynamic parameters for Get-Item on the file system.

FileSystemProviderRemoveItemDynamicParameters

Provides the dynamic parameters for Remove-Item on the file system.

ForEachObjectCommand

Implements a cmdlet that applies a script block to each element of the pipeline.

FormatDefaultCommand

implementation for the format-default command

FunctionProvider

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.

FunctionProviderDynamicParameters

The dynamic parameter object for the FunctionProvider SetItem and NewItem commands

GetAclCommand

Defines the implementation of the 'get-acl' cmdlet. This cmdlet gets the security descriptor of an item at the specified path.

GetAuthenticodeSignatureCommand

Defines the implementation of the 'get-AuthenticodeSignature' cmdlet. This cmdlet extracts the digital signature from the given file.

GetCmsMessageCommand
GetCommandCommand

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.

GetCounterCommand
GetCredentialCommand

Defines the implementation of the 'get-credential' cmdlet. The get-credential Cmdlet establishes a credential object called a Msh credential, by pairing a given username with a prompted password. That credential object can then be used for other operations involving security.

GetEventPSSnapIn
GetExecutionPolicyCommand

Defines the implementation of the 'Get-ExecutionPolicy' cmdlet. This cmdlet gets the effective execution policy of the shell.

        In priority-order (highest priority first,) these come from:
           - Machine-wide Group Policy
           - Current-user Group Policy
           - Current session preference
           - Current user machine preference    
           - Local machine preference
GetHelpCodeMethods

Helper methods used as powershell extension from a types file.

GetHelpCommand

This class implements get-help command

GetHistoryCommand

This class Implements the get-history command

GetJobCommand

Cmdlet to get available list of results

GetModuleCommand

Implements a cmdlet that gets the list of loaded modules...

GetPfxCertificateCommand

Defines the implementation of the get-pfxcertificate cmdlet

GetPSHostProcessInfoCommand
GetPSSessionCommand

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
GetPSSessionConfigurationCommand

Class implemeting Get-PSSessionConfiguration

GetPSSnapinCommand

Class that implements get-pssnapin cmdlet.

GetWinEventCommand
HelpCategoryInvalidException

The exception that is thrown when there is no help category matching a specific input string.

HelpNotFoundException

The exception that is thrown when there is no help found for a topic.

HistoryInfo

Contains information about a single history entry

ImportCounterCommand
ImportModuleCommand

Implements a cmdlet that loads a module

ImportWorkflowCommand

A cmdlet to load WF Workflows, expressed as XAML and wrap them in functions.

InternalSymbolicLinkLinkCodeMethods
InvokeCommandCommand

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.
InvokeHistoryCommand

This class implements the Invoke-History command

JobCmdletBase

This is the base class for job cmdlet and contains some helper functions

ModuleCmdletBase

This is the base class for some of the module cmdlets. It contains a number of utility functions for these classes.

ModuleSpecification

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)
NewModuleCommand

Implements a cmdlet that creates a dynamic module from a scriptblock..

NewModuleManifestCommand

Cmdlet to create a new module manifest file.

NewPSSessionCommand

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
NewPSSessionConfigurationFileCommand

New-PSSessionConfigurationFile command implementation

        See Declarative Initial Session State (DISC)
NewPSSessionOptionCommand

This class implements New-PSSessionOption cmdlet.
Spec: TBD

NewPSTransportOptionCommand

Command to create an object for WSManConfigurationOption

NewPSWorkflowExecutionOptionCommand

Command to create an object for PSWorkflowExecutionOption

NewWinEventCommand
NounArgumentCompleter
ObjectEventRegistrationBase

Base class for object-based event registration.

OutDefaultCommand

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)

OutHostCommand

implementation for the out-host command

OutLineOutputCommand

implementation for the out-lineoutput command it provides a wrapper for the OutCommandInner class, which is the general purpose output command

OutNullCommand

Null sink to absorb pipeline output

ProtectCmsMessageCommand
PSExecutionCmdlet

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
PSHostProcessInfo
PSRemotingBaseCmdlet

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
PSRemotingCmdlet

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
PSRunspaceCmdlet

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
PSSessionConfigurationCommandBase

Base class for PSCustomShell commands Register-PSSessionConfiguration, Set-PSSessionConfiguration

PSSnapInCommandBase

Base class for all the pssnapin related cmdlets.

PSWorkflowExecutionOption

This class is used to specify Workflow related options in the Register-PSSessionConfiguration

ReceiveJobCommand

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

    1. 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

ReceivePSSessionCommand

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
RegisterPSSessionConfigurationCommand

Class implemeting Register-PSSessionConfiguration

RegistryProvider

Provider that provides access to Registry through cmdlets. This provider implements NavigationCmdletProvider, IPropertyCmdletProvider, IDynamicPropertyCmdletProvider,
ISecurityDescriptorCmdletProvider interfaces.

RegistryProviderSetItemDynamicParameter

Defines dynamic parameters for the registry provider

RemoveJobCommand

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.
RemoveModuleCommand

Implements a cmdlet that gets the list of loaded modules...

RemovePSSessionCommand

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
RemovePSSnapinCommand

Class that implements remove-pssnapin cmdlet.

ResumeJobCommand

This cmdlet resumes the jobs that are Job2. Errors are added for each Job that is not Job2.

SaveHelpCommand

This class implements the Save-Help cmdleto

SecureStringCommandBase

Defines the base class from which all SecureString commands are derived.

SecurityDescriptorCommandsBase

Defines the base class from which all Security Descriptor commands are derived.

SendAsTrustedIssuerProperty

class for SendAsTrustedIssuer

SessionStateProviderBase

This is the base class for all the providers that produce a view on session state data (Variables, Aliases, and Functions)

SessionStateProviderBaseContentReaderWriter

The content reader/writer for all providers deriving from SessionStateProviderBase

SetAclCommand

Defines the implementation of the 'set-acl' cmdlet. This cmdlet sets the security descriptor of an item at the specified path.

SetAuthenticodeSignatureCommand

Defines the implementation of the 'set-AuthenticodeSignature' cmdlet. This cmdlet sets the digital signature on a given file.

SetExecutionPolicyCommand

Defines the implementation of the 'Set-ExecutionPolicy' cmdlet. This cmdlet sets the local preference for the execution policy of the shell.

        The execution policy may be overridden by settings in Group Policy.
        If the Group Policy setting overrides the desired behaviour, the Cmdlet
        generates a terminating error.
SetPSDebugCommand

Implements a cmdlet that sets the script debugging options.

SetPSSessionConfigurationCommand

Class implemeting Set-PSSessionConfiguration

SetStrictModeCommand

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.

SignatureCommandsBase

Defines the base class from which all signature commands are derived.

StartJobCommand

This cmdlet start invocation of jobs in background.

StartTranscriptCommand

Implements the start-transcript cmdlet

StopJobCommand

This cmdlet stops the asynchronously invoked remote operaitons.

StopTranscriptCommand

Implements the stop-transcript cmdlet

SuspendJobCommand

This cmdlet suspends the jobs that are Job2. Errors are added for each Job that is not Job2.

TestModuleManifestCommand

This cmdlet takes a module manifest and validates the contents...

TestPSSessionConfigurationFileCommand

Test-PSSessionConfigurationFile command implementation

        See Declarative Initial Session Config (DISC)
UnprotectCmsMessageCommand
UnregisterPSSessionConfigurationCommand

Class implemeting Unregister-PSSessionConfiguration

UpdatableHelpCommandBase

The base class of all updatable help system cmdlets (Update-Help, Save-Help)

UpdateHelpCommand

This class implements the Update-Help cmdlet

VariableProvider

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.

WaitJobCommand

This cmdlet waits for job to complete.

WhereObjectCommand

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.

WSManConfigurationOption

Implementing type for WSManConfigurationOption

X509StoreLocation

Defines a class to represent a store location in the certificate provider. The two possible store locations are CurrentUser and LocalMachine

Structs

DnsNameRepresentation

Defines the type of DNS string The structure contains punycode name and unicode name

EnhancedKeyUsageRepresentation

Defines the type of EKU string The structure contains friendly name and EKU oid

ModuleCmdletBase.ImportModuleOptions

Options set during module import

Enums

FileSystemCmdletProviderEncoding

Defines the values that can be supplied as the encoding parameter in the FileSystemContentDynamicParametersBase class.

OpenMode

The enum used by commands to allow the user to specify how a file (or other item) should be opened.

OutTarget

Output modes available to the Receive-PSSession cmdlet.

SessionFilterState

Runspace states that can be used as filters for querying remote runspaces.