Forrest logo
tool overview
On this page you find all important commands for the CLI tool Invoke-Item. If the command you are looking for is missing please ask our AI.

Invoke-Item

Invoke-Item is a command line tool used in PowerShell, a powerful scripting language and administrative shell. It is primarily used to invoke or open an item, such as a file, directory, or application. By using this tool, you can directly open items from the command line without navigating through the file system manually.

The Invoke-Item command can be abbreviated as "ii" for convenience. For instance, "ii C:\myfile.txt" will open the file using the default application associated with its file type. It also supports working with URLs, where it will launch the default web browser to open the specified URL.

The Invoke-Item command is versatile and can handle various types of items, including folders, documents, executables, scripts, and even Control Panel applets or special files like printer locations.

An interesting feature of this tool is its ability to open files with their default associated programs, which ensures a consistent user experience across different systems.

The Invoke-Item command can be helpful when automating tasks or building scripts that require opening specific files or launching applications programmatically.

As a precaution, it is important to exercise caution while using Invoke-Item to avoid accidentally running malicious scripts or programs. Always ensure the items being invoked are from trusted sources or are validated for security before executing the command.

List of commands for Invoke-Item:

  • invoke-item:tldr:145f3 invoke-item: Open a file in its default program.
    $ Invoke-Item -Path ${path\to\file}
    try on your machine
    explain this command
  • invoke-item:tldr:26acb invoke-item: Open all files inside a directory except those containing a specific keyword.
    $ Invoke-Item -Path ${path\to\directory}\* -Exclude ${*keyword*}
    try on your machine
    explain this command
  • invoke-item:tldr:427f0 invoke-item: Open all files inside a directory containing a specific keyword.
    $ Invoke-Item -Path ${path\to\directory}\* -Include ${*keyword*}
    try on your machine
    explain this command
  • invoke-item:tldr:734c0 invoke-item: Perform a dry run to determine which files will be opened inside a directory through `Invoke-Item`.
    $ Invoke-Item -Path ${path\to\directory}\* -WhatIf
    try on your machine
    explain this command
  • invoke-item:tldr:7ef5e invoke-item: Open all PNGs inside a directory.
    $ Invoke-Item -Path ${path\to\directory}\*.png
    try on your machine
    explain this command
  • invoke-item:tldr:f7447 invoke-item: Open all files inside a directory.
    $ Invoke-Item -Path ${path\to\directory}\*
    try on your machine
    explain this command
tool overview