Link to home
Start Free TrialLog in
Avatar of gfsupport
gfsupport

asked on

PowerShell Command.

Hi Guys,

I have a script that I'm trying to run. See below.

$BaseDir = 'E:\Test\'

$Users = gci -path $baseDir #| where ($_.Name -match "Jane.Mcintosh")

Get-ChildItem -path $BaseDir\$Users\desktop -Recurse -Hidden  #| Where-Object {($_.PSIsContainer ) -AND ($_.Name -EQ '$Recycle.Bin')}

Now the issue is that when i run  the above it does not find each folder individually it as if it finding all folders as one .

See below error

Get-ChildItem : Cannot find path 'E:\Test\gf.test1 gf.test4\' because it does not exist.

Its should list each folder individually.
ASKER CERTIFIED SOLUTION
Avatar of footech
footech
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gfsupport
gfsupport

ASKER

Thank you for your help, i now see where i went wrong.