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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER