• Narrow screen resolution
  • Wide screen resolution
  • Increase font size
  • Decrease font size
  • Default font size
  • default color
  • red color
© Diana Scherff, Amas-Veritas.com

Welcome to Amas Veritas [dot] com

Updates: Media (lyrics) has a new layout. I could never figure out how to lay it out, but it's easier to navigate now. I'm still working on a better duplicate Mamblog mod. I'm trying to make submittions easier but the poetry form died for some reason. Quizzes are also on their way from the old site. Joomla content isn't very code friendly so I'm having to rewrite old code. You can still click on News > AH v21 > Screen if you wish to use the quizzes.
 
Home arrow Tools arrow Windows PowerShell arrow Invoke-History [ihy]
Invoke-History [ihy] Print E-mail
Written by Diana, on 04-09-2007 02:37
Views 127    
Favoured None

PS C:\Users\Admin> help ihy -full

NAME
    Invoke-History

SYNOPSIS
    Runs commands from the session history.

SYNTAX
    Invoke-History [[-iD] <string>] [-whatIf] [-confirm] [<CommonParameters>]


DETAILED DESCRIPTION
    The Invoke-History cmdlet runs commands from the session history. You can pass objects representing the commands from Get-History to Invoke-History, or identify commands in the current history by using their ID number. To find the identification number of a command, use Get-History.


PARAMETERS
    -iD <string>
        Identifies a command in the history. You can type the ID number of the command or the first few characters of the command.

        If you type characters, Invoke-History matches the most recent commands first. If you omit this parameter, Invoke-History runs the last (most recent) command. The parameter name ("-id") is optional. To find the ID number of a command, use Get-History.

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

    -whatIf
        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

    -confirm
        Prompts you for confirmation before 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, and -OutVariable. For more information, type, "get-help about_commonparameters".


INPUT TYPE
    HistoryInfo Object


RETURN TYPE



NOTES


        For more information, type "Get-Help Invoke-History -detailed". For technical information, type "Get-Help Invoke-History -full".

        The session history is a list of the commands entered during the session, along with the ID, which represents the order of execution, the status, and start and end times of the command. As you enter each command, Windows PowerShell adds it to the history so that you can reuse it.

        For more information about the session history, type "get-help about_history".

        When specifying multiple values for a parameter, use commas to separate the values. For example, "<parameter-name> <value1>, <value2>".

        You can also refer to Invoke-History by its built-in aliases, "r" and "ihy". For more information, see About_Alias.


    ----------------- EXAMPLE 1 -----------------

    C:\PS>invoke-history


    This command runs the last (most recent) command in the session history. You can abbreviate this command as "r" (think "repeat" or "rerun"), the alias for Invoke-History.





    ----------------- EXAMPLE 2 -----------------

    C:\PS>invoke-history -id 132


    This command runs the command in the session history with ID 132. Because the name of the -id parameter is optional, you can abbreviate this comm and as "Invoke-History 132", "ihy 132" or "r 132".





    ----------------- EXAMPLE 3 -----------------

    C:\PS>invoke-history get-pr


    This command runs the most recent get-process command in the session history. When you type characters for the Id parameter, Invoke-History runs the first command that it finds that matches the pattern, beginning with the most recent commands. This command uses the ID parameter, but omits the optional parameter name.





    ----------------- EXAMPLE 4 -----------------

    C:\PS>invoke-history (16..24), 27


    This command runs commands 16 - 24 and 27. You can list multiple IDs and ID ranges separated by commas.





    ----------------- EXAMPLE 5 -----------------

    C:\PS>get-history -id 255 -count 7 | invoke-history


    This command runs the 7 comnands in the history that end with command 255 (typically 249 - 255). It uses the Get-History cmdlet to retrieve the commands. The pipeline operator (|) passes the commands to Invoke-History, which executes them.






RELATED LINKS
    Get-History
    Add-History


Last update: 04-09-2007 02:37

Published in : Tools, Windows PowerShell

Users' Comments (0) RSS feed comment

No comment posted

Add your comment



mXcomment 1.0.4 © 2007-2009 - visualclinic.fr
License Creative Commons - Some rights reserved
 
< Prev




Double click any word on this page for a definition.
Using Firefox? Enable definitions by downloading the extension.
Sorry, this feature does not currently work in Opera or Safari.

No Users Online

Statistics

OS: FreeBSD
PHP: 5.2.1
MySQL: 4.1.21-log
Time: 14:48
Caching: Disabled
GZIP: Disabled
Members: 36
News: 2448
Web Links: 39
Visitors: 1441624

Syndicate

Login

Particls