This tutorial will elaborate on the usage of PowerShell’s “Invoke-Item” cmdlet.
How to Use the PowerShell’s Invoke-Item Cmdlet?
The “Invoke-Item” cmdlet is responsible for invoking or opening files in PowerShell. To know more about the usage of the stated cmdlet, look at the mentioned examples.
The syntax of the “Invoke-Item” cmdlet is provided below:
Example 1: Use the “Invoke-Item” Cmdlet to Open a File
To open a file, first, use the “Invoke-Item” cmdlet, then assign the file path:
Example 2: Use the “Invoke-Item” Cmdlet to Open All Files of a Specific Type
To open all files of a specific type, simply assign the path along with the “*” asterisk and file extension to the “Invoke-Item” cmdlet:
That’s it! You have learned the usage of PowerShell’s “Invoke-Item” cmdlet.
To open the file in Powershell, the “Invoke-Item” cmdlet is used. Additionally, it is used to perform the default action on the specified item in PowerShell. For example, an image will open with whatever program it is associated with. This post has explained the usage of the “Invoke-Item” cmdlet in PowerShell.