0

what is wrong on this: get-childitem "$([System.Environment]::SystemDirectory)" -Include ('*.exe','*.dll')

and why this works: get-childitem "$([System.Environment]::SystemDirectory)\*" -Include ('*.exe','*.dll')

from which line of get-childitem docu should I understand this effect?

Lumir J.
  • 56
  • 7
  • 1
    See https://stackoverflow.com/questions/790796/confused-with-include-parameter-of-the-get-childitem-cmdlet. The wildcard is a requirement for `-path` when using the `-include` parameter – Itchydon Mar 21 '21 at 12:08
  • ["*The Include parameter is effective only when the command includes the contents of an item, such as `C:\Windows\*`, where the wildcard character specifies the contents of the `C:\Windows directory.`*"](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-childitem?view=powershell-7.1#parameters) – iRon Mar 21 '21 at 12:20

0 Answers0