Tag Archives: Name

Get-Member

NAME
    Get-Member

SYNOPSIS
    Gets the properties and methods of objects.

SYNTAX
    Get-Member [[-Name] <string[]>] [-Force] [-InputObject <psobject>] [-MemberType {AliasProperty | CodeProperty | Property | NoteProperty | ScriptProperty | Properties | PropertySet | Method | CodeMethod | ScriptMethod | Methods | ParameterizedProperty | MemberSet | Event | All}] [-Static] [-View {Extended | Adapted | Base | All}] [<CommonParameters>]

DESCRIPTION
    The Get-Member cmdlet gets the “members” (properties and methods) of objects.

    To specify the object, use the InputObject parameter or pipe an object to Get-Member. To retrieve information about static members (members of the class, not of the instance), use the Static parameter. To get only certain types of members, such as NoteProperties, use the MemberType parameter.

PARAMETERS
    -Force [<SwitchParameter>]
        Adds the intrinsic members (PSBase, PSAdapted, PSObject, PSTypeNames) and the compiler-generated get_ and set_ methods to the display. By default, Get-Member gets these properties in all views other than “Base” and “Adapted,” but it does not display them.

        The following list describes the properties that are added when you use the Force parameter:

        — PSBase: The original properties of the .NET Framework object without extension or adaptation. These are the properties defined for the object class and listed in MSDN.
        — PSAdapted: The properties and methods defined in the Windows PowerShell extended type system.
        — PSExtended: The properties and methods that were added in the Types.ps1xml files or by using the Add-Member cmdlet.
        — PSObject: The adapter that converts the base object to a Windows PowerShell PSObject object.
        — PSTypeNames: A list of object types that describe the object, in order of specificity. When formatting the object, Windows PowerShell searches for the types in the Format.ps1xml files in the Windows PowerShell installation directory ($pshome). It uses the formatting definition for the first type that it finds.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    -InputObject <psobject>
        Specifies the object whose members are retrieved.

        Using the InputObject parameter is not the same as piping an object to Get-Member. The differences are as follows:

        — When you pipe a collection of objects to Get-Member, Get-Member gets the members of the individual objects in the collection, such as the properties of the integers in an array of integers.

        — When you use InputObject to submit a collection of objects, Get-Member gets the members of the collection, such as the properties of the array in an array of integers.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     true (ByValue)
        Accept wildcard characters? false

    -MemberType <PSMemberTypes>
        Gets only members with the specified member type. The default is All.

        The valid values for this parameter are:

        — AliasProperty: A property that defines a new name for an existing property.
        — CodeMethod: A method that references a static method of a .NET Framework class.
        — CodeProperty: A property that references a static property of a .NET Framework class.
        — Event: Indicates that the object sends a message to indicate an action or a change in state.
        — MemberSet: A predefined collection of properties and methods, such as PSBase, PSObject, and PSTypeNames.
        — Method: A method of the underlying .NET Framework object.
        — NoteProperty: A property with a static value.
        — ParameterizedProperty: A property that takes parameters and parameter values.
        — Property: A property of the underlying .NET Framework object.
        — PropertySet: A predefined collection of object properties.
        — ScriptMethod: A method whose value is the output of a script.
        — ScriptProperty: A property whose value is the output of a script.

        — All: Gets all member types.
        — Methods: Gets all types of methods of the object (for example, Method, CodeMethod, ScriptMethod).
        — Properties: Gets all types of properties of the object (for example, Property, CodeProperty, AliasProperty, ScriptProperty).

        Not all objects have every type of member. If you specify a member type that the object does not have, Windows PowerShell returns a null value.

        To get related types of members, such as all extended members, use the View parameter. If you use the MemberType parameter with the Static or View parameters, Get-Member gets the members that belong to both sets.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    -Name <string[]>
        Specifies the names of one or more properties or methods of the object. Get-Member gets only the specified properties and methods.

        If you use the Name parameter with the MemberType, View, or Static parameters, Get-Member gets only the members that satisfy the criteria of all parameters.

        To get a static member by name, use the Static parameter with the Name parameter.

        Required?                    false
        Position?                    1
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    -Static [<SwitchParameter>]
        Gets only the static properties and methods of the object.

        Static properties and methods are defined on the class of objects, not on any particular instance of the class.

        If you use the Static parameter with the View parameter, the View parameter is ignored. If you use the Static parameter with the MemberType parameter, Get-Member gets only the members that belong to both sets.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    -View <PSMemberViewTypes>
        Gets only particular types of members (properties and methods). Specify one or more of the values. The default is “Adapted, Extended”.

        Valid values are:
        — Base: Gets only the original properties and methods of the .NET Framework object (without extension or adaptation).
        — Adapted: Gets only the properties and methods defined in the Windows PowerShell extended type system.
        — Extended: Gets only the properties and methods that were added in the Types.ps1xml files or by using the Add-Member cmdlet.
        — All: Gets the members in the Base, Adapted, and Extended views.

        The View parameter determines the members retrieved, not just the display of those members.

        To get particular member types, such as script properties, use the MemberType parameter. If you use the MemberType and View parameters in the same command, Get-Member gets the members that belong to both sets. If you use the Static and View parameters in the same command, the View parameter is ignored.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer and OutVariable. For more information, type,
        “Get-Help about_CommonParameters“.

INPUTS
    System.Management.Automation.PSObject
        You can pipe any object to Get-Member

OUTPUTS
    Microsoft.PowerShell.Commands.MemberDefinition
        Get-Member returns an object for each property or method that its gets.

NOTES

        You can retrieve information about a collection object either by using the InputObject parameter or by piping the object, preceded by a comma, to Get-Member.

    ————————– EXAMPLE 1 ————————–

    C:\PS>Get-Service | Get-Member

     TypeName: System.ServiceProcess.ServiceController

    Name                     MemberType    Definition
    —-                     ———-    ———-
    Name                     AliasProperty Name = ServiceName
    Close                     Method        System.Void Close()
    Continue                 Method        System.Void Continue()
    CreateObjRef             Method        System.Runtime.Remoting.ObjRef CreateObjRef(Type requestedType)
    Dispose                 Method        System.Void Dispose()
    Equals                    Method        System.Boolean Equals(Object obj)
    ExecuteCommand            Method        System.Void ExecuteCommand(Int32 command)
    GetHashCode             Method        System.Int32 GetHashCode()
    GetLifetimeService        Method        System.Object GetLifetimeService()
    GetType                 Method        System.Type GetType()
    InitializeLifetimeService Method        System.Object InitializeLifetimeService()
    Pause                     Method        System.Void Pause()
    Refresh                 Method        System.Void Refresh()
    Start                     Method        System.Void Start(), System.Void Start(String[] args)
    Stop                     Method        System.Void Stop()
    ToString                 Method        System.String ToString()
    WaitForStatus             Method        System.Void WaitForStatus(ServiceControllerStatus desiredStatus), System.Voi…
    CanPauseAndContinue     Property     System.Boolean CanPauseAndContinue {get;}
    CanShutdown             Property     System.Boolean CanShutdown {get;}
    CanStop                 Property     System.Boolean CanStop {get;}
    Container                 Property     System.ComponentModel.IContainer Container {get;}
    DependentServices         Property     System.ServiceProcess.ServiceController[] DependentServices {get;}
    DisplayName             Property     System.String DisplayName {get;set;}
    MachineName             Property     System.String MachineName {get;set;}
    ServiceHandle             Property     System.Runtime.InteropServices.SafeHandle ServiceHandle {get;}
    ServiceName             Property     System.String ServiceName {get;set;}
    ServicesDependedOn        Property     System.ServiceProcess.ServiceController[] ServicesDependedOn {get;}
    ServiceType             Property     System.ServiceProcess.ServiceType ServiceType {get;}
    Site                     Property     System.ComponentModel.ISite Site {get;set;}
    Status                    Property     System.ServiceProcess.ServiceControllerStatus Status {get;}

    Description
    ———–
    This command displays the properties and methods of the process objects (System.ServiceProcess.ServiceController) that are generated by the Get-Service cmdlet.

    The command uses the pipeline operator (|) to send the output of a Get-Service command to Get-Member.

    Because the Get-Member part of the command does not have any parameters, it uses all of the default values. As such, it gets all member types, but it does not get static members and does not display intrinsic members.

    ————————– EXAMPLE 2 ————————–

    C:\PS>Get-Service | Get-Member -Force

    C:\PS> (Get-Service -schedule).psbase

    Description
    ———–
    This example gets all of the members (properties and methods) of the service objects (System.ServiceProcess.ServiceController) retrieved by the Get-Service cmdlet, including the intrinsic members, such as PSBase and PSObject, and the get_ and set_ methods.

    The first command uses the Get-Service cmdlet to get objects that represent the services on the system. It uses a pipeline operator (|) to pass the service objects to the Get-Member cmdlet.

    The Get-Member command uses the Force parameter to add the intrinsic members and compiler-generated members of the objects to the display. Get-Member gets these members, but it hides them by default.

    You can use these properties and methods in the same way that you would use an adapted method of the object. The second command shows how to display the value of the PSBase property of the Schedule service.

    ————————– EXAMPLE 3 ————————–

    C:\PS>Get-Service    | Get-Member -View extended

     TypeName: System.ServiceProcess.ServiceController

    Name MemberType    Definition
    —- ———-    ———-
    Name AliasProperty Name = ServiceName

    Description
    ———–
    This command gets the methods and properties of service objects that were extended by using the Types.ps1xml file or the Add-Member cmdlet.

    The Get-Member command uses the View parameter to get only the extended members of the service objects. In this case, the extended member is the Name property, which is an Alias property of the ServiceName property.

    ————————– EXAMPLE 4 ————————–

    C:\PS>Get-Eventlog -log system | gm -MemberType scriptproperty

     TypeName: System.Diagnostics.EventLogEntry

    Name    MemberType     Definition
    —-    ———-     ———-
    EventID ScriptProperty System.Object EventID {get=$this.get_EventID() -band 0xFFFF;}

    Description
    ———–
    This command gets the script properties of event log objects in the System log in Event Viewer. In this case, the only script property is the EventID.

    ————————– EXAMPLE 5 ————————–

    C:\PS>Get-Eventlog -log system | Get-Member -MemberType scriptproperty

     TypeName: System.Diagnostics.EventLogEntry

    Name    MemberType     Definition
    —-    ———-     ———-
    EventID ScriptProperty System.Object EventID {get=$this.get_EventID() -band 0xFFFF;}

    Description
    ———–
    This command gets the script properties of event log objects in the System log in Event Viewer.

    The command uses the MemberType parameter to get only objects with a value of AliasProperty for their MemberType property.

    The command returns the EventID property of the EventLog object.

    ————————– EXAMPLE 6 ————————–

    C:\PS>$a = “Get-Process“, “Get-Service“, “Get-Culture“, “Get-PSDrive“, “Get-ExecutionPolicy

    C:\PS> foreach ($cmdlet in $a) {Invoke-Expression $cmdlet | Get-Member -Name machinename}

    TypeName: System.Diagnostics.Process

    Name        MemberType Definition
    —-        ———- ———-
    MachineName Property System.String MachineName {get;}

     TypeName: System.ServiceProcess.ServiceController

    Name        MemberType Definition
    —-        ———- ———-
    MachineName Property System.String MachineName {get;set;}

    Description
    ———–
    This command gets objects that have a MachineName property from a list of cmdlets.

    The first command stores the names of several cmdlets in the $a Variable.

    The second command uses a ForEach statement to invoke each command, send the results to Get-Member, and limit the results from Get-Member to members that have the name “MachineName.”

    The results show that only process objects (System.Diagnostics.Process) and service objects (System.ServiceProcess.ServiceController) have a MachineName property.

    ————————– EXAMPLE 7 ————————–

    C:\PS>$a = Get-Member -InputObject @(1)

    C:\PS>$a.count

    1

    C:\PS> $a = Get-Member -InputObject 1,2,3

     TypeName: System.Object[]
    Name             MemberType    Definition
    —-             ———-    ———-
    Count             AliasProperty Count = Length
    Address            Method        System.Object& Address(Int32 )
    Clone             Method        System.Object Clone()
    …

    C:\PS>$a.count
    1

    Description
    ———–
    This example demonstrates how to find the properties and methods of an array of objects when you have only one object of the given type.

    Because the goal of the command is to find the properties of an array, the first command uses the InputObject parameter. It uses the “at” symbol (@) to indicate an array. In this case, the array contains only one object, the integer 1.

    The third command uses the Get-Member cmdlet to get the properties and methods of an array of integers, and the command saves them in the $a Variable.

    The fourth command uses the Count property of the array to find the number of objects in the $a Variable.

RELATED LINKS
    Online version: http://go.microsoft.com/fwlink/?LinkID=113322
    Add-Member
    Get-Help
    Get-Command
    Get-PSDrive

Get-ItemProperty

NAME
    Get-ItemProperty

SYNOPSIS
    Gets the properties of a specified item.

SYNTAX
    Get-ItemProperty [-LiteralPath] <string[]> [[-Name] <string[]>] [-Credential <PSCredential>] [-Exclude <string[]>] [-Filter <string>] [-Include <string[]>] [-UseTransaction] [<CommonParameters>]

    Get-ItemProperty [-Path] <string[]> [[-Name] <string[]>] [-Credential <PSCredential>] [-Exclude <string[]>] [-Filter <string>] [-Include <string[]>] [-UseTransaction] [<CommonParameters>]

DESCRIPTION
    The Get-ItemProperty cmdlet gets the properties of the specified items. For example, you can use Get-ItemProperty to get the value of the LastAccessTime property of a file object. You can also use Get-ItemProperty to view Registry entries and their values.

PARAMETERS
    -Credential <PSCredential>
        Specifies a user account that has permission to perform this action. The default is the current user.

        Type a user name, such as “User01” or “Domain01\User01”, or enter a PSCredential object, such as one generated by the Get-Credential cmdlet. If you type a user name, you will be prompted for a password.

        This parameter is not supported by any providers installed with Windows PowerShell.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     true (ByPropertyName)
        Accept wildcard characters? false

    -Exclude <string[]>
        Omits the specified items. Wildcards are permitted.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    -Filter <string>
        Specifies a filter in the provider’s format or language. The value of this parameter qualifies the Path parameter. The syntax of the filter, including the use of wildcards, depends on the provider. Filters are more efficient than other parameters, because the provider applies them when retrieving the objects rather than having Windows PowerShell filter the objects after they are retrieved.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    -Include <string[]>
        Includes the specified items.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    -LiteralPath <string[]>
        Specifies a path to the item property. The value of LiteralPath is used exactly as it is typed. No characters are interpreted as wildcards. If the path includes escape characters, enclose it in single quotation marks. Single quotation marks tell Windows PowerShell not to interpret any characters as escape sequences.

        Required?                    true
        Position?                    1
        Default value
        Accept pipeline input?     true (ByPropertyName)
        Accept wildcard characters? false

    -Name <string[]>
        Specifies the name of the property or properties to retrieve.

        Required?                    false
        Position?                    2
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    -Path <string[]>
        Specifies the path to the item or items.

        Required?                    true
        Position?                    1
        Default value
        Accept pipeline input?     true (ByValue, ByPropertyName)
        Accept wildcard characters? false

    -UseTransaction [<SwitchParameter>]
        Includes the command in the active transaction. This parameter is valid only when a transaction is in progress. For more information, see about_transactions.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer and OutVariable. For more information, type,
        “Get-Help about_CommonParameters“.

INPUTS
    System.String
        You can pipe a string that contains a path to Get-ItemProperty.

OUTPUTS
    Object
        Get-ItemProperty returns an object for each item property that it gets. The object type depends on the object that is retrieved.

NOTES

        The Get-ItemProperty cmdlet is designed to work with the data exposed by any provider. To list the providers available in your session, type “Get-PSProvider“. For more information, see about_providers.

    ————————– EXAMPLE 1 ————————–

    C:\PS>Get-Itemproperty C:\Windows

    Description
    ———–
    This command gets information about the C:\Windows directory.

    ————————– EXAMPLE 2 ————————–

    C:\PS>Get-Itemproperty C:\Test\Weather.xls | Format-List

    Description
    ———–
    This command gets the properties of the C:\Test\Weather.xls file. The result is piped to the Format-List cmdlet to display the output as a list.

    ————————– EXAMPLE 3 ————————–

    C:\PS>Get-Itemproperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion

    Description
    ———–
    This command displays the value name and data of each of the Registry entries contained in the CurrentVersion Registry subkey. Note that the command requires that there is a Windows PowerShell drive named HKLM: that is mapped to the HKEY_LOCAL_MACHINE hive of the Registry. A drive with that name and mapping is available in Windows PowerShell by default. Alternatively, the path to this Registry subkey can be specified by using the following alternative path that begins with the provider name followed by two colons:
    Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion.

    ————————– EXAMPLE 4 ————————–

    C:\PS>Get-Itemproperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion `
    -Name “ProgramFilesDir”

    Description
    ———–
    This command gets the value name and data of the ProgramFilesDir Registry entry in the CurrentVersion Registry subkey. The command uses the Path parameter to specify the subkey and the Name parameter to specify the value name of the entry.

    ————————– EXAMPLE 5 ————————–

    C:\PS>Get-Itemproperty -Path HKLM:\SOFTWARE\Microsoft\PowerShell\1\PowerShellEngine

    ApplicationBase         : C:\Windows\system32\WindowsPowerShell\v1.0\
    ConsoleHostAssemblyName : Microsoft.PowerShell.ConsoleHost, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad
                             364e35, ProcessorArchitecture=msil
    PowerShellVersion     : 2.0
    RuntimeVersion         : v2.0.50727
    CTPVersion             : 5
    PSCompatibleVersion     : 1.0,2.0

    Description
    ———–
    This command gets the value names and data of the Registry entries in the PowerShellEngine Registry key. The results are shown in the following sample output.

    ————————– EXAMPLE 6 ————————–

    C:\PS>Get-Itemproperty -Path HKLM:\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell

    Path                                                        ExecutionPolicy
    —-                                                        —————
    C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe RemoteSigned

    C:\PS>Get-Itemproperty -Path HKLM:\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell | Format-List -property *

    PSPath         : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\Software\Microsoft\PowerShell\1\ShellIds\Micro
                     soft.PowerShell
    PSParentPath    : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\Software\Microsoft\PowerShell\1\ShellIds
    PSChildName     : Microsoft.PowerShell
    PSDrive         : HKLM
    PSProvider     : Microsoft.PowerShell.Core\Registry
    Path            : C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe
    ExecutionPolicy : RemoteSigned

    Description
    ———–
    This example shows how to format the output of a Get-ItemProperty command in a list to make it easy to see the Registry values and data and to make it easy to interpret the results.

    The first command uses the Get-ItemProperty cmdlet to get the Registry entries in the Microsoft.PowerShell subkey. This subkey stores options for the default shell for Windows PowerShell. The results are shown in the following sample output.

    The output shows that there are two Registry entries, Path and ExecutionPolicy. When a Registry key contains fewer than five entries, by default it is displayed in a table, but it is often easier to view in a list.

    The second command uses the same Get-ItemProperty command. However, this time, the command uses a pipeline operator (|) to send the results of the command to the Format-List cmdlet. The Format-List command uses the Property parameter with a value of * (all) to display all of the properties of the objects in a list. The results are shown in the following sample output.

    The resulting display shows the Path and ExecutionPolicy Registry entries, along with several less familiar properties of the Registry key object. The other properties, prefixed with “PS”, are properties of Windows PowerShell custom objects, such as the objects that represent the Registry keys.

RELATED LINKS
    Online version: http://go.microsoft.com/fwlink/?LinkID=113320
    about_providers
    Set-ItemProperty
    Clear-ItemProperty
    Copy-ItemProperty
    Move-ItemProperty
    New-ItemProperty
    Remove-ItemProperty
    Rename-ItemProperty

Get-Help

NAME
    Get-Help

SYNOPSIS
    Displays information about Windows PowerShell commands and concepts.

SYNTAX
    Get-Help [-Full] [[-Name] <string>] [-Category <string[]>] [-Component <string[]>] [-Functionality <string[]>] [-Online] [-Path <string>] [-Role <string[]>] [<CommonParameters>]

    Get-Help [-Detailed] [[-Name] <string>] [-Category <string[]>] [-Component <string[]>] [-Functionality <string[]>] [-Online] [-Path <string>] [-Role <string[]>] [<CommonParameters>]

    Get-Help [-Examples] [[-Name] <string>] [-Category <string[]>] [-Component <string[]>] [-Functionality <string[]>] [-Online] [-Path <string>] [-Role <string[]>] [<CommonParameters>]

    Get-Help [-Parameter <string>] [[-Name] <string>] [-Category <string[]>] [-Component <string[]>] [-Functionality <string[]>] [-Online] [-Path <string>] [-Role <string[]>] [<CommonParameters>]

DESCRIPTION
    The Get-Help cmdlet displays information about Windows PowerShell concepts and commands, including cmdlets, providers, Functions and scripts. To get a list of all cmdlet help topic titles, type “Get-Help *”.

    If you type “Get-Help” followed by the exact name of a help topic, or by a word unique to a help topic, Get-Help displays the topic contents. If you enter a word or word pattern that appears in several help topic titles, Get-Help displays a list of the matching titles. If you enter a word that does not appear in any help topic titles, Get-Help displays a list of topics that include that word in their contents.

    In addition to “Get-Help“, you can also type “help” or “man”, which displays one screen of text at a time, or “<cmdlet-Name> -?”, which is identical to Get-Help but works only for cmdlets.

    You can display the entire help file or selected parts of the file, such as the syntax, parameters, or examples. You can also use the Online parameter to display an online version of a help file in your Internet browser. These parameters have no effect on conceptual help topics.

    Conceptual help topics in Windows PowerShell begin with “about_”, such as “about_Comparison_Operators”. To see all “about_” topics, type “Get-Help about_*”. To see a particular topic, type “Get-Help about_<topic-Name>”, such as “Get-Help about_Comparison_Operators“.

PARAMETERS
    -Category <string[]>
        Displays help for items in the specified category. Valid values are Alias, Cmdlet, Provider, and HelpFile. Conceptual topics are in the HelpFile category.

        Category is a property of the MamlCommandHelpInfo object that Get-Help returns. This parameter has no effect on displays of conceptual (“about_”) help.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    -Component <string[]>
        Displays a list of tools with the specified component value, such as “Exchange.” Enter a component name. Wildcards are permitted.

        Component is a property of the MamlCommandHelpInfo object that Get-Help returns. This parameter has no effect on displays of conceptual (“About_”) help.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    -Detailed [<SwitchParameter>]
        Adds parameter descriptions and examples to the basic help display.

        This parameter has no effect on displays of conceptual (“About_”) help.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    -Examples [<SwitchParameter>]
        Displays only the name, synopsis, and examples. To display only the examples, type “(Get-Help <cmdlet-Name>).examples”.

        This parameter has no effect on displays of conceptual (“About_”) help.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    -Full [<SwitchParameter>]
        Displays the entire help file for a cmdlet, including parameter descriptions and attributes, examples, input and output object types, and additional notes.

        This parameter has no effect on displays of conceptual (“About_”) help.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    -Functionality <string[]>
        Displays help for items with the specified Functionality. Enter the Functionality. Wildcards are permitted.

        Functionality is a property of the MamlCommandHelpInfo object that Get-Help returns. This parameter has no effect on displays of conceptual (“About_”) help.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    -Name <string>
        Requests help about the specified tool or conceptual topic. Enter a cmdlet, provider, script, or Function name, such as Get-Member, a conceptual topic name, such as “about_Objects”, or an Alias, such as “ls”. Wildcards are permitted in cmdlet and provider names, but you cannot use wildcards to find the names of Function help and script help topics.

        To get help for a script that is not located in a path that is listed in the Path Environment Variable, type the path and file name of the script .

        If you enter the exact name of a help topic, Get-Help displays the topic contents. If you enter a word or word pattern that appears in several help topic titles, Get-Help displays a list of the matching titles. If you enter a word that does not match any help topic titles, Get-Help displays a list of topics that include that word in their contents.

        The names of conceptual topics, such as about_objects, must be entered in English, even in non-English versions of Windows PowerShell.

        Required?                    false
        Position?                    1
        Default value
        Accept pipeline input?     true (ByPropertyName)
        Accept wildcard characters? false

    -Online [<SwitchParameter>]
        Displays the online version of a help topic in the default Internet browser. This parameter is valid only for cmdlet, Function, and script help topics.

        Get-Help uses the Internet address (Uniform Resource Identifier [URI]) that appears in the first item of the Related Links section of a cmdlet, Function, or script help topic. This parameter works only when the help topic includes a URI that begins with “Http” or “Https” and an Internet browser is installed on the system.

        For information about supporting this feature in help topics that you write, see about_Comment_Based_Help, and see “How to Write Cmdlet Help” in the MSDN (Microsoft Developer Network) library at http://go.microsoft.com/fwlink/?LinkID=123415.

        Required?                    false
        Position?                    named
        Default value                None
        Accept pipeline input?     false
        Accept wildcard characters? false

    -Parameter <string>
        Displays only the detailed descriptions of the specified parameters. Wildcards are permitted.

        This parameter has no effect on displays of conceptual (“About_”) help.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    -Path <string>
        Gets help that explains how the cmdlet works in the specified provider path. Enter a Windows PowerShell provider path.

        This parameter gets a customized version of a cmdlet help topic that explains how the cmdlet works in the specified Windows PowerShell provider path. This parameter is effective only for help about a provider cmdlet and only when the provider includes a custom version of the provider cmdlet help topic.

        To see the custom cmdlet help for a provider path, go to the provider path location and enter a Get-Help command or, from any path location, use the Path parameter of Get-Help to specify the provider path. For more information, see about_providers.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    -Role <string[]>
        Displays help customized for the specified user role. Enter a role. Wildcards are permitted.

        Enter the role that the user plays in an organization. Some cmdlets display different text in their help files based on the value of this parameter. This parameter has no effect on help for the core cmdlets.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer and OutVariable. For more information, type,
        “Get-Help about_CommonParameters“.

INPUTS
    None
        You cannot pipe objects to this cmdlet.

OUTPUTS
    System.String or MamlCommandHelpInfo
        If you request a conceptual topic, Get-Help returns it as a string. If you specify the name of a cmdlet,, Function, or script, it returns a MamlCommandHelpInfo object. Otherwise, Get-Help returns one of the formatted views that are specified in the Help.Format.ps1xml file in the $pshome directory.

NOTES

        Without parameters, “Get-Help” displays information about the Windows PowerShell help system.

        The full view of help (-Full) includes a table of information about the parameters. The table includes the following fields:

        — Required: Indicates whether the parameter is required (true) or optional (false).

        — Position: Indicates whether the parameter is named or positional (numbered). Positional parameters must appear in a specified place in the command.

        — “Named” indicates that the parameter name is required, but that the parameter can appear anywhere in the command.

        — <Number> indicates that the parameter name is optional, but when the name is omitted, the parameter must be in the place specified by the number. For example, “2” indicates that when the parameter name is omitted, the parameter must be the second (2) or only unnamed parameter in the command. When the parameter name is used, the parameter can appear anywhere in the command.

        — Default value: The parameter value that Windows PowerShell uses if you do not include the parameter in the command.

        — Accepts pipeline input: Indicates whether you can (true) or cannot (false) send objects to the parameter through a pipeline. “By Property Name” means that the pipelined object must have a property with the same name as the parameter name.

        — Accepts wildcard characters: Indicates whether the value of a parameter can include wildcard characters, such as * and ?.

    ————————– EXAMPLE 1 ————————–

    C:\PS>Get-Help

    Description
    ———–
    This command displays help about the Windows PowerShell help system.

    ————————– EXAMPLE 2 ————————–

    C:\PS>Get-Help *

    Description
    ———–
    This command displays a list of all help files in the Windows PowerShell help system.

    ————————– EXAMPLE 3 ————————–

    C:\PS>Get-Help Get-Alias

    C:\PS>help Get-Alias

    C:\PS>Get-Alias -?

    Description
    ———–
    These commands display basic information about the Get-Alias cmdlet. The “Get-Help” and “-?” commands display the information on a single page. The “Help” command displays the information one page at a time.

    ————————– EXAMPLE 4 ————————–

    C:\PS>Get-Help about_*

    Description
    ———–
    This command displays a list of the conceptual topics included in Windows PowerShell help. All of these topics begin with the characters “about_”. To display a particular help file, type “Get-Help <topic-Name>, for example, “Get-Help about_Signing“.

    ————————– EXAMPLE 5 ————————–

    C:\PS>Get-Help ls -detailed

    Description
    ———–
    This command displays detailed help for the Get-ChildItem cmdlet by specifying one of its Aliases, “ls.” The Detailed parameter requests the detailed view of the help file, which includes parameter descriptions and examples. To see the complete help file for a cmdlet, use the Full parameter.

    ————————– EXAMPLE 6 ————————–

    C:\PS>Get-Help format-string -Full

    Description
    ———–
    This command displays the full view help for the Format-String cmdlet. The full view of help includes parameter descriptions, examples, and a table of technical details about the parameters.

    ————————– EXAMPLE 7 ————————–

    C:\PS>Get-Help Start-Service -examples

    Description
    ———–
    This command displays examples of using Start-Service in Windows PowerShell commands.

    ————————– EXAMPLE 8 ————————–

    C:\PS>Get-Help Get-ChildItem -parameter f*

    Description
    ———–
    This command displays descriptions of the parameters of the Get-ChildItem cmdlet that begin with “f” (filter and force). For descriptions of all parameters, type “Get-Help Get-ChildItem parameter*”.

    ————————– EXAMPLE 9 ————————–

    C:\PS>(Get-Help Write-Output).syntax

    Description
    ———–
    This command displays only the syntax of the Write-Output cmdlet.

    Syntax is one of many properties of help objects; others are description, details, examples, and parameters. To find all properties and methods of help objects, type “Get-Help <cmdlet-Name> | Get-Member“; for example, “Get-Help Start-Service | get member”.

    ————————– EXAMPLE 10 ————————–

    C:\PS>(Get-Help Trace-Command).alertset

    Description
    ———–
    This command displays the notes about the cmdlet. The notes are stored in the alertSet property of the help object.

    The notes include conceptual information and tips for using the cmdlet. By default, the notes are displayed only when you use the Full parameter of Get-Help, but you can also display them by using the alertSet property.

    ————————– EXAMPLE 11 ————————–

    C:\PS>Get-Help Add-Member -Full | Out-String -stream | Select-String -pattern clixml

    Description
    ———–
    This example shows how to search for a word in particular cmdlet help topic. This command searches for the word “clixml” in the full version of the help topic for the Add-Member cmdlet.

    Because the Get-Help cmdlet generates a MamlCommandHelpInfo object, not a string, you need to use a command that transforms the help topic content into a string, such as Out-String or Out-File.

    ————————– EXAMPLE 12 ————————–

    C:\PS>Get-Help Get-Member -Online

    Description
    ———–
    This command displays the online version of the help topic for the Get-Member cmdlet.

    ————————– EXAMPLE 13 ————————–

    C:\PS>Get-Help remoting

    Description
    ———–
    This command displays a list of topics that include the word “remoting” in their contents.

    When you enter a word that does not appear in any topic title, Get-Help displays a list of topics that include that word.

    ————————– EXAMPLE 14 ————————–

    C:\PS>Get-Help Get-Item -Path SQLSERVER:\DataCollection

    NAME
        Get-Item

    SYNOPSIS
        Gets a collection of Server objects for the local computer and any computers to which you have made a SQL Server PowerShell connection.
    …

    C:\PS> cd SQLSERVER:\DataCollection
    C:\PS> SQLSERVER:\DataCollection> Get-Help Get-Item

    NAME
        Get-Item

    SYNOPSIS
        Gets a collection of Server objects for the local computer and any computers to which you have made a SQL Server PowerShell connection.
    …

    C:\PS> Get-Item

    NAME
        Get-Item

    SYNOPSIS
        Gets the item at the specified location.

    …

    Description
    ———–
    This example shows how to get help for the Get-Item cmdlet that explains how to use the cmdlet in the DataCollection node of the Windows PowerShell SQL Server provider.

    The example shows two ways of getting the custom help for Get-Item.

    The first command uses the Path parameter of Get-Help to specify the provider path. This command can be entered at any path location.

    The second command uses the Set-Location cmdlet (alias = “cd”) to go to the provider path. From that location, even without the Path parameter, the Get-Help command gets the custom help for the provider path.

    The third command shows that a Get-Help command in a file system path, and without the Path parameter, gets the standard help for the Get-Item cmdlet.

    ————————– EXAMPLE 15 ————————–

    C:\PS>Get-Help c:\ps-test\MyScript.ps1

    Description
    ———–
    This command gets help for the MyScript.ps1 script. For information about writing help for your Functions and scripts, see about_Comment_Based_Help.

RELATED LINKS
    Online version: http://go.microsoft.com/fwlink/?LinkID=113316

    about_Comment_Based_Help
    Get-Command
    Get-PSDrive
    Get-Member

Get-ChildItem

NAME
    Get-ChildItem

SYNOPSIS
    Gets the items and child items in one or more specified locations.

SYNTAX
    Get-ChildItem [[-Path] <string[]>] [[-Filter] <string>] [-Exclude <string[]>] [-Force] [-Include <string[]>] [-Name] [-Recurse] [-UseTransaction] [<CommonParameters>]

    Get-ChildItem [-LiteralPath] <string[]> [[-Filter] <string>] [-Exclude <string[]>] [-Force] [-Include <string[]>] [-Name] [-Recurse] [-UseTransaction] [<CommonParameters>]

DESCRIPTION
    The Get-ChildItem cmdlet gets the items in one or more specified locations. If the item is a container, it gets the items inside the container, known as child items. You can use the Recurse parameter to get items in all child containers.

    A location can be a file system location, such as a directory, or a location exposed by another provider, such as a Registry hive or a Certificate store.

PARAMETERS
    -Exclude <string[]>
        Omits the specified items. The value of this parameter qualifies the Path parameter. Enter a path element or pattern, such as “*.txt”. Wildcards are permitted.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    -Filter <string>
        Specifies a filter in the provider’s format or language. The value of this parameter qualifies the Path parameter. The syntax of the filter, including the use of wildcards, depends on the provider. Filters are more efficient than other parameters, because the provider applies them when retrieving the objects, rather than having Windows PowerShell filter the objects after they are retrieved.

        Required?                    false
        Position?                    2
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    -Force [<SwitchParameter>]
        Allows the cmdlet to get items that cannot otherwise not be accessed by the user, such as hidden or system files. Implementation varies from provider to provider. For more information, see about_providers. Even using the Force parameter, the cmdlet cannot override security restrictions.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    -Include <string[]>
        Retrieves only the specified items. The value of this parameter qualifies the Path parameter. Enter a path element or pattern, such as “*.txt”. Wildcards are permitted.

        The Include parameter is effective only when the command includes the Recurse parameter or the path leads to the contents of a directory, such as C:\Windows\*, where the wildcard character specifies the contents of the C:\Windows directory.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    -LiteralPath <string[]>
        Specifies a path to one or more locations. Unlike Path, the value of LiteralPath is used exactly as it is typed. No characters are interpreted as wildcards. If the path includes escape characters, enclose it in single quotation marks. Single quotation marks tell Windows PowerShell not to interpret any characters as escape sequences.

        Required?                    true
        Position?                    1
        Default value
        Accept pipeline input?     true (ByPropertyName)
        Accept wildcard characters? false

    -Name [<SwitchParameter>]
        Retrieves only the names of the items in the locations. If you pipe the output of this command to another command, only the item names are sent.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    -Path <string[]>
        Specifies a path to one or more locations. Wildcards are permitted. The default location is the current directory (.).

        Required?                    false
        Position?                    1
        Default value
        Accept pipeline input?     true (ByValue, ByPropertyName)
        Accept wildcard characters? false

    -Recurse [<SwitchParameter>]
        Gets the items in the specified locations and in all child items of the locations.

        Recurse works only when the path points to a container that has child items, such as C:\Windows or C:\Windows\*, and not when it points to items that do not have child items, such as C:\Windows\*.exe.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    -UseTransaction [<SwitchParameter>]
        Includes the command in the active transaction. This parameter is valid only when a transaction is in progress. For more information, see about_transactions.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer and OutVariable. For more information, type,
        “Get-Help about_CommonParameters“.

INPUTS
    System.String
        You can pipe a string that contains a path to Get-ChildItem.

OUTPUTS
    Object.
        The type of object that Get-ChildItem returns is determined by the provider with which it is used.

NOTES

        You can also refer to Get-ChildItem by its built-in Aliases, “ls”, “dir”, and “gci”. For more information, see about_aliases.

        Get-ChildItem does not get hidden items by default. To get hidden items, use -Force.

        The Get-ChildItem cmdlet is designed to work with the data exposed by any provider. To list the providers available in your session, type “Get-PSProvider“. For more information, see about_providers.

    ————————– EXAMPLE 1 ————————–

    C:\PS>Get-ChildItem

    Description
    ———–
    This command gets the child items in the current location. If the location is a file system directory, it gets the files and sub-directories in the current directory. If the item does not have child items, this command returns to the command prompt without displaying anything.

    The default display lists the mode (attributes), last write time, file size (length), and the name of the file. The valid values for mode are d (directory), a (archive), r (read-only), h (hidden), and s (system).

    ————————– EXAMPLE 2 ————————–

    C:\PS>Get-ChildItem . -Include *.txt -Recurse -Force

    Description
    ———–
    This command retrieves all of the .txt files in the current directory and its subdirectories. The dot (.) represents the current directory and the Include parameter specifies the file name extension. The Recurse parameter directs Windows PowerShell to retrieve objects recursively, and it indicates that the subject of the command is the specified directory and its contents. The force parameter adds hidden files to the display.

    ————————– EXAMPLE 3 ————————–

    C:\PS>Get-ChildItem c:\windows\logs\* -Include *.txt -Exclude A*

    Description
    ———–
    This command lists the .txt files in the Logs subdirectory, except for those whose names start with the letter A. It uses the wildcard character (*) to indicate the contents of the Logs subdirectory, not the directory container. Because the command does not include the Recurse parameter, Get-ChildItem does not include the content of directory automatically; you need to specify it.

    ————————– EXAMPLE 4 ————————–

    C:\PS>Get-ChildItem Registry::hklm\software

    Description
    ———–
    This command retrieves all of the Registry keys in the HKEY_LOCAL_MACHINE\SOFTWARE key in the Registry of the local computer.

    ————————– EXAMPLE 5 ————————–

    C:\PS>Get-ChildItem -Name

    Description
    ———–
    This command retrieves only the names of items in the current directory.

    ————————– EXAMPLE 6 ————————–

    C:\PS>Get-ChildItem cert:\. -Recurse -codesigningcert

    Description
    ———–
    This command gets all of the Certificates in the Certificate store that have code-signing authority.

    The command uses the Get-ChildItem cmdlet. The path specifies the Cert: drive exposed by the Windows PowerShell Certificate provider. The backslash (\) symbol specifies a subdirectory of the Certificate store and the dot (.) represents the current directory, which would be the root directory of the Certificate store. The Recurse parameter specifies a recursive search.

    The CodeSigningCertificate parameter is a dynamic parameter that gets only Certificates with code-signing authority. For more information, type “Get-Help Certificate“.

    ————————– EXAMPLE 7 ————————–

    C:\PS>Get-ChildItem * -Include *.exe

    Description
    ———–
    This command retrieves all of the items in the current directory with a “.exe” file name extension. The wildcard character (*) represents the contents of the current directory (not the container). When using the Include parameter without the Recurse parameter, the path must point to contents, not a container.

RELATED LINKS
    Online version: http://go.microsoft.com/fwlink/?LinkID=113308
    about_providers
    Get-Item
    Get-Alias
    Get-Location
    Get-Process

Get-Alias

NAME
    Get-Alias

SYNOPSIS
    Gets the Aliases for the current session.

SYNTAX
    Get-Alias [[-Name] <string[]>] [-Exclude <string[]>] [-Scope <string>] [<CommonParameters>]

    Get-Alias [-Definition <string[]>] [-Exclude <string[]>] [-Scope <string>] [<CommonParameters>]

DESCRIPTION
    The Get-Alias cmdlet gets the Aliases (alternate names for commands and executable files) in the current session. This includes built-in Aliases, Aliases that you have set or imported, and Aliases that you have added to your Windows PowerShell profile.

    By default, Get-Alias takes an Alias and returns the command name. When you use the Definition parameter, Get-Alias takes a command name and returns its Aliases.

PARAMETERS
    -Definition <string[]>
        Gets the Aliases for the specified item. Enter the name of a cmdlet, Function, script, file, or executable file.

        This parameter is called Definition, because it searches for the item name in the Definition property of the Alias object.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? true

    -Exclude <string[]>
        Omits the specified items. The value of this parameter qualifies the Name and Definition parameters. Enter a name, a definition, or a pattern, such as “s*”. Wildcards are permitted.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    -Name <string[]>
        Specifies the Aliases to retrieve. Wildcards are permitted. By default, Get-Alias retrieves all Aliases defined for the current session. The parameter name (“Name”) is optional. You can also pipe Alias names to Get-Alias.

        Required?                    false
        Position?                    1
        Default value
        Accept pipeline input?     true (ByValue, ByPropertyName)
        Accept wildcard characters? false

    -Scope <string>
        Gets only the Aliases in the specified scope. Valid values are “Global”, “Local”, or “Script”, or a number relative to the current scope (0 through the number of scopes, where 0 is the current scope and 1 is its parent). “Local” is the default. For more information, see about_scopes.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer and OutVariable. For more information, type,
        “Get-Help about_CommonParameters“.

INPUTS
    System.String
        You can pipe Alias names to Get-Alias.

OUTPUTS
    System.Management.Automation.AliasInfo
        Get-Alias returns an object that represents each Alias.

NOTES

        An Alias is an alternate name or nickname for a cmdlet, Function, or an executable file. To run the cmdlet, Function, or executable, you can use its full name or any Alias. For more information, see about_aliases.

        To create a new Alias, use Set-Alias or New-Alias. To delete an Alias, use Remove-Item.

    ————————– EXAMPLE 1 ————————–

    C:\PS>Get-Alias

    Description
    ———–
    This command gets all Aliases in the current session.

    ————————– EXAMPLE 2 ————————–

    C:\PS>Get-Alias -Name g*, s* -Exclude get-*

    Description
    ———–
    This command gets all Aliases that begin with “g” or “s”, except for Aliases that begin with “get-“.

    ————————– EXAMPLE 3 ————————–

    C:\PS>Get-Alias -definition Get-ChildItem

    Description
    ———–
    This command gets the Aliases for the Get-ChildItem cmdlet.

    By default, the Get-Alias cmdlet gets the item name when you know the Alias. The Definition parameter gets the Alias when you know the item name.

    ————————– EXAMPLE 4 ————————–

    C:\PS>Get-Alias | Where-Object {$_.Options -match “ReadOnly”}

    Description
    ———–
    This command retrieves all Aliases in which the value of the Options property is ReadOnly. This command provides a quick way to find the Aliases that are built into Windows PowerShell, because they have the ReadOnly option.

    Options is just one property of the AliasInfo objects that Get-Alias gets. To find all properties and methods of AliasInfo objects, type “Get-Alias | Get-Member“.

    ————————– EXAMPLE 5 ————————–

    C:\PS>Get-Alias -definition “*-pssession” -Exclude e* -Scope global

    Description
    ———–
    This example gets Aliases for commands that have names that end in “-pssession”, except for those that begin with “e”.

    The command uses the Scope parameter to apply the command in the global scope. This is useful in scripts when you want to get the Aliases in the session.

RELATED LINKS
    Online version: http://go.microsoft.com/fwlink/?LinkID=113306
    about_aliases
    Set-Alias
    New-Alias
    Export-Alias
    Import-Alias
    Alias Provider

Export-Alias

NAME
    Export-Alias

SYNOPSIS
    Exports information about currently defined Aliases to a file.

SYNTAX
    Export-Alias [-Path] <string> [[-Name] <string[]>] [-Append] [-As {Csv | Script}] [-Description <string>] [-Force] [-NoClobber] [-PassThru] [-Scope <string>] [-Confirm] [-WhatIf] [<CommonParameters>]

DESCRIPTION
    The Export-Alias cmdlet exports the Aliases in the current session to a file. If the output file does not exist, the cmdlet will create it.

    Export-Alias can export the Aliases in a particular scope or all scopes, it can generate the data in CSV format or as a series of Set-Alias commands that you can add to a session or to a Windows PowerShell profile.

PARAMETERS
    -Append [<SwitchParameter>]
        Appends the output to the specified file, rather than overwriting the existing contents of that file.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    -As <ExportAliasFormat>
        Determines the output format. CSV is the default.

        Valid values are:

        — CSV: Comma-separated value (CSV) format.
        — Script: Creates a Set-Alias command for each exported Alias. If you name the output file with a .ps1 file name extension, you can run it as a script to add the Aliases to any session.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    -Description <string>
        Adds a description to the exported file. The description appears as a comment at the top of the file, following the header information.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    -Force [<SwitchParameter>]
        Overwrites the output file, even if the read-only attribute is set on the file.

        By default, Export-Alias overwrites files without warning, unless the read-only or hidden attribute is set or the NoClobber parameter is used in the command. The NoClobber parameter takes precedence over the Force parameter when both are used in a command.

        The Force parameter cannot force Export-Alias to overwrite files with the hidden attribute.

        Required?                    false
        Position?                    named
        Default value                Does not overwrite read-only files.
        Accept pipeline input?     false
        Accept wildcard characters? false

    -Name <string[]>
        Specifies the names of the Aliases to export. Wildcards are permitted.

        By default, Export-Alias exports all Aliases in the session or scope.

        Required?                    false
        Position?                    2
        Default value                Export all Aliases
        Accept pipeline input?     true (ByPropertyName)
        Accept wildcard characters? false

    -NoClobber [<SwitchParameter>]
        Prevents Export-Alias from overwriting any files, even if the Force parameter is used in the command.

        If the NoClobber parameter is omitted, Export-Alias will overwrite an existing file without warning, unless the read-only attribute is set on the file. NoClobber takes precedence over the Force parameter, which permits Export-Alias to overwrite a file with the read-only attribute.

        NoClobber does not prevent the Append parameter from adding content to an existing file.

        Required?                    false
        Position?                    named
        Default value                Overwrites read-write files.
        Accept pipeline input?     false
        Accept wildcard characters? false

    -PassThru [<SwitchParameter>]
        Returns objects that represent the Aliases that were exported. By default, this cmdlet does not generate any output.

        Required?                    false
        Position?                    named
        Default value                No output
        Accept pipeline input?     false
        Accept wildcard characters? false

    -Path <string>
        Specifies the path to the output file. Wildcards are permitted, but the resulting path value must resolve to a single file name. This parameter is required.

        Required?                    true
        Position?                    1
        Default value                None
        Accept pipeline input?     false
        Accept wildcard characters? false

    -Scope <string>
        Specifies the scope from which the Aliases should be exported.

        Valid values are “Global”, “Local”, or “Script”, or a number relative to the current scope (0 through the number of scopes where 0 is the current scope and 1 is its parent). “Local” is the default. For more information, see about_scopes.

        Required?                    false
        Position?                    named
        Default value                Local
        Accept pipeline input?     false
        Accept wildcard characters? false

    -Confirm [<SwitchParameter>]
        Prompts you for confirmation before executing the command.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    -WhatIf [<SwitchParameter>]
        Describes what would happen if you executed the command without actually executing the command.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer and OutVariable. For more information, type,
        “Get-Help about_CommonParameters“.

INPUTS
    None.
        You cannot pipe objects to this cmdlet.

OUTPUTS
    None or System.Management.Automation.AliasInfo
        When you use the Passthru parameter, Export-Alias returns a System.Management.Automation.AliasInfo object that represents the Alias. Otherwise, this cmdlet does not generate any output.

NOTES

        You can only Export-Aliases to a file.

    ————————– EXAMPLE 1 ————————–

    C:\PS>Export-Alias -Path Alias.csv

    Description
    ———–
    This command exports current Alias information to a file named Alias.csv in the current directory.

    ————————– EXAMPLE 2 ————————–

    C:\PS>Export-Alias -Path Alias.csv -NoClobber

    Description
    ———–
    This command exports the Aliases in the current session to an Alias.csv file.

    Because the NoClobber parameter is specified, the command will fail if an Alias.csv file already exists in the current directory.

    ————————– EXAMPLE 3 ————————–

    C:\PS>Export-Alias -Path Alias.csv -Append -Description “Appended Aliases” -Force

    Description
    ———–
    This command appends the Aliases in the current session to the Alias.csv file.

    The command uses the Description parameter to add a description to the comments at the top of the file.

    The command also uses the Force parameter to overwrite any existing Alias.csv files, even if they have the read-only attribute.

    ————————– EXAMPLE 4 ————————–

    C:\PS>Export-Alias -Path Alias.ps1 -As script

    C:\PS> Add-Content -Path $profile -value (Get-Content Alias.ps1)

    C:\PS> $s = New-PSSession -computername Server01
    C:\PS> Invoke-Command -session $s -filepath .\alias.ps1

    Description
    ———–
    This example shows how to use the script file format that Export-Alias generates.

    The first command exports the Aliases in the session to the Alias.ps1 file. It uses the As parameter with a value of Script to generate a file that contains a Set-Alias command for each Alias.

    The second command adds the Aliases in the Alias.ps1 file to the CurrentUser-CurrentHost profile. (The path to the profile is saved in the $profile Variable.) The command uses the Get-Content cmdlet to get the Aliases from the Alias.ps1 file and the Add-Content cmdlet to add them to the profile. For more information, see about_profiles.

    The third and fourth commands add the Aliases in the Alias.ps1 file to a remote session on the Server01 computer. The third command uses the New-PSSession cmdlet to create the session. The fourth command uses the FilePath parameter of the Invoke-Command cmdlet to run the Alias.ps1 file in the new session.

RELATED LINKS
    Online version: http://go.microsoft.com/fwlink/?LinkID=113296
    Import-Alias
    Get-Alias
    New-Alias
    Set-Alias

Enable-PSSessionConfiguration

NAME
    Enable-PSSessionConfiguration

SYNOPSIS
    Enables the session configurations on the local computer.

SYNTAX
    Enable-PSSessionConfiguration [[-Name] <string[]>] [-Force] [-SecurityDescriptorSddl <string>] [-Confirm] [-WhatIf] [<CommonParameters>]

DESCRIPTION
    The Enable-PSSessionConfiguration cmdlet re-enables registered session configurations that have been disabled by using the Disable-PSSessionConfiguration cmdlet. This is an advanced cmdlet that is designed to be used by system administrators to manage customized session configurations for their users.

    Without parameters, Enable-PSSessionConfiguration re-enables the Microsoft.PowerShell configuration, which is the default configuration that is used for sessions.

    This cmdlet performs the following operations for each enabled configuration:
    — Removes the “deny all” setting from the security descriptor of the configuration or replaces the security descriptor with one that you specify.
    — Turns on the listener that accepts requests on any IP address.
    — Restarts the WinRM service.

    The Enable-PSSessionConfiguration cmdlet calls the Set-WSManQuickConfig cmdlet. However, it should not be used to enable remoting on the computer. Instead, use the more comprehensive cmdlet, Enable-PSRemoting.

PARAMETERS
    -Force [<SwitchParameter>]
        Suppresses all user prompts, and restarts the WinRM service without prompting. Restarting the service makes the configuration change effective.

        To prevent a restart and suppress the restart prompt, use the NoServiceRestart parameter.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    -Name <string[]>
        Specifies the names of session configurations to enable. Enter one or more configuration names. Wildcards are permitted.

        You can also pipe a string that contains a configuration name or a session configuration object to Enable-PSSessionConfiguration.

        If you omit this parameter, Enable-PSSessionConfiguration enables the Microsoft.PowerShell session configuration.

        Required?                    false
        Position?                    1
        Default value
        Accept pipeline input?     true (ByValue, ByPropertyName)
        Accept wildcard characters? true

    -SecurityDescriptorSddl <string>
        Replaces the security descriptor on the session configuration with the specified security descriptor.

        If you omit this parameter, Enable-PSSessionConfiguration just deletes the “deny all” item from the security descriptor.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    -Confirm [<SwitchParameter>]
        Prompts you for confirmation before executing the command.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    -WhatIf [<SwitchParameter>]
        Describes what would happen if you executed the command without actually executing the command.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer and OutVariable. For more information, type,
        “Get-Help about_CommonParameters“.

INPUTS
    Microsoft.PowerShell.Commands.PSSessionConfigurationCommands#PSSessionConfiguration, System.String
        You can pipe a session configuration object or a string that contains the name of a session configuration to Enable-PSSessionConfiguration.

OUTPUTS
    None
        This cmdlet does not return any objects.

NOTES

        To run this cmdlet on Windows Vista, Windows Server 2008, and later versions of Windows, you must start Windows PowerShell with the “Run as administrator” option.

    ————————– EXAMPLE 1 ————————–

    C:\PS>Enable-PSSessionConfiguration

    Description
    ———–
    This command re-enables the Microsoft.PowerShell default session configuration on the computer.

    ————————– EXAMPLE 2 ————————–

    C:\PS>Enable-PSSessionConfiguration -Name MaintenanceShell, AdminShell

    Description
    ———–
    This command re-enables the MaintenanceShell and AdminShell session configurations on the computer.

    ————————– EXAMPLE 3 ————————–

    C:\PS>Enable-PSSessionConfiguration -Name *

    C:\PS> Get-PSSessionConfiguration | Enable-PSSessionConfiguration

    Description
    ———–
    These commands re-enable all session configurations on the computer. The commands are equivalent, so you can use either one.

    Enable-PSSessionConfiguration does not generate an error if you enable a session configuration that is already enabled.

    ————————– EXAMPLE 4 ————————–

    C:\PS>Enable-PSSessionConfiguration -Name MaintenanceShell -SecurityDescriptorSddl “O:NSG:BAD:P(A;;GXGWGR;;;BA)(A;;GAGR;;;S-1-5-21-123456789-188441444-3100496)S:P”

    Description
    ———–
    This command re-enables the MaintenanceShell session configuration and specifies a new security descriptor for the configuration.

RELATED LINKS
    Online version: http://go.microsoft.com/fwlink/?LinkID=144301
    about_Session_Configurations
    Disable-PSSessionConfiguration
    Get-PSSessionConfiguration
    Register-PSSessionConfiguration
    Set-PSSessionConfiguration
    Unregister-PSSessionConfiguration
    WS-Management Provider

Disable-PSSessionConfiguration

NAME
    Disable-PSSessionConfiguration

SYNOPSIS
    Denies access to the session configurations on the local computer.

SYNTAX
    Disable-PSSessionConfiguration [[-Name] <string[]>] [-Force] [-Confirm] [-WhatIf] [<CommonParameters>]

DESCRIPTION
    The Disable-PSSessionConfiguration cmdlet prevents all users of the computer from using the session configuration in a session. This is an advanced cmdlet that is designed to be used by system administrators to manage customized session configurations for their users.

    The Disable-PSSessionConfiguration cmdlet adds a “deny all” setting to the security descriptor of one or more registered session configurations. As a result, you can unregister, view, and change the configurations, but you cannot use them in a session.

    Without parameters, Disable-PSSessionConfiguration disables the Microsoft.PowerShell configuration, which is the default configuration that is used for sessions. Unless the user specifies a different configuration, both local and remote users are effectively prevented from creating any sessions that connect to the computer.

    To disable all session configurations on the computer, use Disable-PSRemoting.

PARAMETERS
    -Force [<SwitchParameter>]
        Suppresses all user prompts. By default, you are prompted to confirm each operation.

        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?     false
        Accept wildcard characters? false

    -Name <string[]>
        Specifies the names of session configurations to disable. Enter one or more configuration names. Wildcards are permitted. You can also pipe a string that contains a configuration name or a session configuration object to Disable-PSSessionConfiguration.

        If you omit this parameter, Disable-PSSessionConfiguration disables the Microsoft.PowerShell session configuration.

        Required?                    false
        Position?                    1
        Default value                Microsoft.PowerShell
        Accept pipeline input?     true (ByValue, ByPropertyName)
        Accept wildcard characters? true

    -Confirm [<SwitchParameter>]
        Prompts you for confirmation before executing the command.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    -WhatIf [<SwitchParameter>]
        Describes what would happen if you executed the command without actually executing the command.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer and OutVariable. For more information, type,
        “Get-Help about_CommonParameters“.

INPUTS
    Microsoft.PowerShell.Commands.PSSessionConfigurationCommands#PSSessionConfiguration, System.String
        You can pipe a session configuration object or a string that contains the name of a session configuration to Disable-PSSessionConfiguration.

OUTPUTS
    None
        This cmdlet does not return any objects.

NOTES

        To run this cmdlet on Windows Vista, Windows Server 2008, and later versions of Windows, you must start Windows PowerShell with the “Run as administrator” option.

    ————————– EXAMPLE 1 ————————–

    C:\PS>Disable-PSSessionConfiguration

    Description
    ———–
    This command disables the Microsoft.PowerShell session configuration.

    ————————– EXAMPLE 2 ————————–

    C:\PS>Disable-PSSessionConfiguration -Name *

    Description
    ———–
    This command disables all registered session configurations on the computer.

    ————————– EXAMPLE 3 ————————–

    C:\PS>Disable-PSSessionConfiguration -Name Microsoft* -Force

    Description
    ———–
    This command disables all session configurations that have names that begin with “Microsoft”. The command uses the Force parameter to suppress all user prompts from the command.

    ————————– EXAMPLE 4 ————————–

    C:\PS>Get-PSSessionConfiguration -Name MaintenanceShell, AdminShell | Disable-PSSessionConfiguration

    Description
    ———–
    This command disables the MaintenanceShell and AdminShell session configurations.

    The command uses a pipeline operator (|) to send the results of a Get-PSSessionConfiguration command to Disable-PSSessionConfiguration.

    ————————– EXAMPLE 5 ————————–

    C:\PS>Get-PSSessionConfiguration | Format-Table -property Name, Permission -auto

    Name                 Permission
    —-                 ———-
    MaintenanceShell     BUILTIN\Administrators AccessAllowed
    microsoft.powershell BUILTIN\Administrators AccessAllowed
    microsoft.powershell32 BUILTIN\Administrators AccessAllowed

    C:\PS> Disable-PSSessionConfiguration -Name MaintenanceShell -Force

    C:\PS> Get-PSSessionConfiguration | Format-Table -property Name, Permission -auto

    Name                 Permission
    —-                 ———-
    MaintenanceShell     Everyone AccessDenied, BUILTIN\Administrators AccessAllowed
    microsoft.powershell BUILTIN\Administrators AccessAllowed
    microsoft.powershell32 BUILTIN\Administrators AccessAllowed

    C:\PS> Set-PSSessionConfiguration -Name MaintenanceShell -MaximumReceivedDataSizePerCommandMB 60

    ParamName            ParamValue
    ———            ———-
    psmaximumreceived… 60

    “Restart WinRM service”
    WinRM service need to be restarted to make the changes effective. Do you want to run the command “Restart-Service winrm”?
    [Y] Yes [N] No [S] Suspend [?] Help (default is “Y”): y

    C:\PS> New-PSSession -computername localhost -configurationName MaintenanceShell

    [localhost] Connecting to remote server failed with the following error message : Access is denied. For more information, see the about_remote_Troubl
    eshooting Help topic.
        + CategoryInfo         : OpenError: (System.Manageme….RemoteRunspace:RemoteRunspace) [], PSRemotingTransportException
        + FullyQualifiedErrorId : PSSessionOpenFailed

    Description
    ———–
    This example shows the effect of disabling a session configuration.

    The first command uses the Get-SessionConfiguration and Format-Table cmdlets to display only the Name and Permission properties of the session configuration objects. This table format makes it easier to see the values of the objects. The results show that members of the Administrators group are permitted to use the session configurations.

    The second command uses the Disable-PSSessionConfiguration cmdlet to disable the MaintenanceShell session configuration. The command uses the Force parameter to suppress all user prompts.

    The third command repeats the first command. The results show that you can still get the object that represents the MaintenanceShell session configuration even though everyone is denied access to it. The “AccessDenied” entry takes precedence over all other entries in the security descriptor.

    The fourth command uses the Set-PSSessionConfiguration cmdlet to increase the MaximumDataSizePerCommandMB setting on the MaintenanceShell session configuration to 60. The results show that the command was successful even though everyone is denied access to the configuration.

    The fifth command attempts to use the MaintenanceShell session configuration in a session. It uses the New-PSSession cmdlet to create a new session and the ConfigurationName parameter to specify the MaintenanceShell configuration. The results show that the New-PSSession command fails because the user is denied access to the configuration.

RELATED LINKS
    Online version: http://go.microsoft.com/fwlink/?LinkID=144299
    about_Session_Configurations
    Enable-PSSessionConfiguration
    Get-PSSessionConfiguration
    Register-PSSessionConfiguration
    Set-PSSessionConfiguration
    Unregister-PSSessionConfiguration
    WS-Management Provider

Copy-ItemProperty

NAME
    Copy-ItemProperty

SYNOPSIS
    Copies a property and value from a specified location to another location.

SYNTAX
    Copy-ItemProperty [-LiteralPath] <string[]> [-Destination] <string> [-Name] <string> [-Credential <PSCredential>] [-Exclude <string[]>] [-Filter <string>] [-Force] [-Include <string[]>] [-PassThru] [-Confirm] [-WhatIf] [-UseTransaction] [<CommonParameters>]

    Copy-ItemProperty [-Path] <string[]> [-Destination] <string> [-Name] <string> [-Credential <PSCredential>] [-Exclude <string[]>] [-Filter <string>] [-Force] [-Include <string[]>] [-PassThru] [-Confirm] [-WhatIf] [-UseTransaction] [<CommonParameters>]

DESCRIPTION
    The Copy-ItemProperty cmdlet copies a property and value from a specified location to another location. For example, you can use Copy-ItemProperty to copy one or more Registry entries from one Registry key to another Registry key.

PARAMETERS
    -Credential <PSCredential>
        Specifies a user account that has permission to perform this action. The default is the current user.

        Type a user name, such as “User01” or “Domain01\User01”, or enter a PSCredential object, such as one generated by the Get-Credential cmdlet. If you type a user name, you will be prompted for a password.

        This parameter is not supported by any providers installed with Windows PowerShell.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     true (ByPropertyName)
        Accept wildcard characters? false

    -Destination <string>
        Specifies the path to the destination location.

        Required?                    true
        Position?                    2
        Default value
        Accept pipeline input?     true (ByPropertyName)
        Accept wildcard characters? false

    -Exclude <string[]>
        Omits the specified items. Wildcards are permitted.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    -Filter <string>
        Specifies a filter in the provider’s format or language. The value of this parameter qualifies the Path parameter. The syntax of the filter, including the use of wildcards, depends on the provider. Filters are more efficient than other parameters, because the provider applies them when retrieving the objects rather than having Windows PowerShell filter the objects after they are retrieved.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    -Force [<SwitchParameter>]
        Allows the cmdlet to override restrictions such as renaming existing files as long as security is not compromised.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    -Include <string[]>
        Specifies only those items upon which the cmdlet will act, excluding all others.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    -LiteralPath <string[]>
        Specifies a path to the item property. The value of LiteralPath is used exactly as it is typed. No characters are interpreted as wildcards. If the path includes escape characters, enclose it in single quotation marks. Single quotation marks tell Windows PowerShell not to interpret any characters as escape sequences.

        Required?                    true
        Position?                    1
        Default value
        Accept pipeline input?     true (ByPropertyName)
        Accept wildcard characters? false

    -Name <string>
        Specifies the name of the property to be copied.

        Required?                    true
        Position?                    3
        Default value
        Accept pipeline input?     true (ByPropertyName)
        Accept wildcard characters? false

    -PassThru [<SwitchParameter>]
        Returns an object representing the copied item property. By default, this cmdlet does not generate any output.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    -Path <string[]>
        Specifies the path to the property to be copied.

        Required?                    true
        Position?                    1
        Default value
        Accept pipeline input?     true (ByValue, ByPropertyName)
        Accept wildcard characters? false

    -Confirm [<SwitchParameter>]
        Prompts you for confirmation before executing the command.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    -WhatIf [<SwitchParameter>]
        Describes what would happen if you executed the command without actually executing the command.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    -UseTransaction [<SwitchParameter>]
        Includes the command in the active transaction. This parameter is valid only when a transaction is in progress. For more information, see about_transactions.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer and OutVariable. For more information, type,
        “Get-Help about_CommonParameters“.

INPUTS
    System.String
        You can pipe a string that contains a path to Copy-ItemProperty.

OUTPUTS
    None or System.Management.Automation.PSCustomObject
        When you use the Passthru parameter, Copy-ItemProperty generates a PsCustomObject representing the copied item property. Otherwise, this cmdlet does not generate any output.

NOTES

        The Copy-ItemProperty cmdlet is designed to work with the data exposed by any provider. To list the providers available in your session, type “Get-PSProvider“. For more information, see about_providers.

    ————————– EXAMPLE 1 ————————–

    C:\PS>Copy-Itemproperty -Path MyApplication -Destination HKLM:\Software\MyApplicationRev2 -Name MyProperty

    Description
    ———–
    This command copies the property named MyProperty from the MyApplication Registry key to the MyApplicationRev2 Registry key.

RELATED LINKS
    Online version: http://go.microsoft.com/fwlink/?LinkID=113293
    about_providers
    Clear-ItemProperty
    New-ItemProperty
    Move-ItemProperty
    Rename-ItemProperty
    Get-ItemProperty
    Set-ItemProperty

Debug-Process

NAME
    Debug-Process

SYNOPSIS
    Debugs one or more processes running on the local computer.

SYNTAX
    Debug-Process [-Name] <string[]> [-Confirm] [-WhatIf] [<CommonParameters>]

    Debug-Process [-Id] <Int32[]> [-Confirm] [-WhatIf] [<CommonParameters>]

    Debug-Process -InputObject <Process[]> [-Confirm] [-WhatIf] [<CommonParameters>]

DESCRIPTION
    The Debug-Process cmdlet attaches a debugger to one or more running processes on a local computer. You can specify the processes by their process name or process ID (PID), or you can pipe process objects to Debug-Process.

    Debug-Process attaches the debugger that is currently registered for the process. Before using this cmdlet, verify that a debugger is downloaded and correctly configured.

PARAMETERS
    -Id <Int32[]>
        Specifies the process IDs of the processes to be debugged. The parameter name (“-Id”) is optional.

        To find the process ID of a process, type “Get-Process“.

        Required?                    true
        Position?                    1
        Default value                None
        Accept pipeline input?     true (ByPropertyName)
        Accept wildcard characters? false

    -InputObject <Process[]>
        Specifies the process objects that represent processes to be debugged. Enter a Variable that contains the process objects or a command that gets the process objects, such as a Get-Process command. You can also pipe process objects to Debug-Process.

        Required?                    true
        Position?                    named
        Default value
        Accept pipeline input?     true (ByValue)
        Accept wildcard characters? false

    -Name <string[]>
        Specifies the names of the processes to be debugged. If there is more than one process with the same name, Debug-Process attaches a debugger to all processes with that name. The parameter name (“Name”) is optional.

        Required?                    true
        Position?                    1
        Default value
        Accept pipeline input?     true (ByPropertyName)
        Accept wildcard characters? false

    -Confirm [<SwitchParameter>]
        Prompts you for confirmation before executing the command.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    -WhatIf [<SwitchParameter>]
        Describes what would happen if you executed the command without actually executing the command.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer and OutVariable. For more information, type,
        “Get-Help about_CommonParameters“.

INPUTS
    System.Int32, System.Diagnostics.Process, System.String
        You can pipe a process ID (Int32), a process object (System.Diagnostics.Process), or a process name (String) to Debug-Process.

OUTPUTS
    None
        This cmdlet does not generate any output.

NOTES

        This cmdlet uses the AttachDebugger method of the Windows Management Instrumentation (WMI) Win32_Process class. For more information about this method, see “AttachDebugger Method” in the MSDN (Microsoft Developer Network) library at http://go.microsoft.com/fwlink/?LinkId=143640.

    ————————– EXAMPLE 1 ————————–

    C:\PS>Debug-Process -Name powershell

    Description
    ———–
    This command attaches a debugger to the PowerShell process on the computer.

    ————————– EXAMPLE 2 ————————–

    C:\PS>Debug-Process -Name sql*

    Description
    ———–
    This command attaches a debugger to all processes that have names that begin with “sql”.

    ————————– EXAMPLE 3 ————————–

    C:\PS>Debug-Process winlogon, explorer, outlook

    Description
    ———–
    This command attaches a debugger to the Winlogon, Explorer, and Outlook processes.

    ————————– EXAMPLE 4 ————————–

    C:\PS>Debug-Process -id 1132, 2028

    Description
    ———–
    This command attaches a debugger to the processes that have process IDs 1132 and 2028.

    ————————– EXAMPLE 5 ————————–

    C:\PS>Get-Process powershell | Debug-Process

    Description
    ———–
    This command attaches a debugger to the PowerShell processes on the computer. It uses the Get-Process cmdlet to get the PowerShell processes on the computer, and it uses a pipeline operator (|) to send the processes to the Debug-Process cmdlet.

    To specify a particular PowerShell process, use the ID parameter of Get-Process.

    ————————– EXAMPLE 6 ————————–

    C:\PS>$pid | Debug-Process

    Description
    ———–
    This command attaches a debugger to the current PowerShell processes on the computer.

    It uses the $pid automatic Variable, which contains the process ID of the current PowerShell process. Then, it uses a pipeline operator (|) to send the process ID to the Debug-Process cmdlet.

    For more information about the $pid automatic Variable, see about_Automatic_Variables.

    ————————– EXAMPLE 7 ————————–

    C:\PS>Get-Process -computername Server01, Server02 -Name MyApp | Debug-Process

    Description
    ———–
    This command attaches a debugger to the MyApp processes on the Server01 and Server02 computers.

    It uses the Get-Process cmdlet to get the MyApp processes on the Server01 and Server02 computers. It uses a pipeline operator to send the processes to the Debug-Process cmdlet, which attaches the debuggers.

    ————————– EXAMPLE 8 ————————–

    C:\PS>$p = Get-Process powershell

    C:\PS> Debug-Process -inputobject $p

    Description
    ———–
    This command attaches a debugger to the PowerShell processes on the local computer.

    The first command uses the Get-Process cmdlet to get the PowerShell processes on the computer. It saves the resulting process object in the $p Variable.

    The second command uses the InputObject parameter of Debug-Process to submit the process object in the $p Variable to Debug-Process.

RELATED LINKS
    Online version: http://go.microsoft.com/fwlink/?LinkID=135206
    Get-Process
    Start-Process
    Stop-Process
    Wait-Process
    Debug-Process