1
votes

Following code Works: Get-ChildItem "C:\" -recurse -include *.dll

But the following code DOES NOT WORK when the drive is replaced with a variable containing the string.

$temp = "C:"; Get-ChildItem "$temp" -recurse -include *.dll.

Any Clue what might be the issue??

2
Couldn't reproduce using the posted code. Try running just this line in a new powershell session. If it runs, the problem is something else. Otherwise it could be some broken code in PS profile script.wOxxOm

2 Answers

0
votes

The issue got resolved with the following: $temp = "C:"; Get-ChildItem $temp -recurse -include *.dll

0
votes

It's work try this :

$temp = "C:\Program Files"
$DllDirectory = Get-ChildItem -Path $temp -Recurse -Include *.dll
$DllDirectory