Multiple choice technology

Which of the below CmdLet will create an object of the MS Excel?

  1. New-Object -Com Excel.Application

  2. New-Item -Com Excel.Application

  3. Invoke-Item -Com Excel.Application

  4. All of the above

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

New-Object with the -Com parameter is used to create COM objects in PowerShell. Excel.Application is the COM ProgID for Microsoft Excel. New-Item creates file system items, and Invoke-Item opens files/folders - neither creates COM objects. Since only A is correct, 'All of the above' (D) is incorrect.