I'm trying to use Powershell more often when I would normally be using cmd.
Today I wanted to expand the information that this cmd command gives:
dir/a/b/s/p msvcr90*
so I tried this in Powershell (on W7 X64 as an Admin ICIM):
PS C:\> ls -Fi msvcr90* -R | fl | more
I love the extra detail that that provides but am disturbed to see that it
completely misses an instance of the target file here:
C:\>dir/a/b/s/p msvcr9*
C:\MSOCache\All Users\{20140000-0115-0409-1000-0000000FF1CE}-C\msvcr90.dll
However, if I navigate to that directory separately PS has no trouble giving
me the desired information
PS C:\> cd MSOCache
PS C:\MSOCache> ls -Fi msvcr90* -R | fl
Directory: C:\MSOCache\All
Users\{20140000-0115-0409-1000-0000000FF1CE}-C
Does anybody have some explanation for this as something that I should be
aware of and watch out for? Any workaround? It looks like something is
wrong with the implementation of the -Recurse option which would make this
technique seem unreliable.
<help>
DESCRIPTION
The Get-ChildItem cmdlet gets the items in one or more specified
locations. If the item is a container, it gets the items inside the
container, known as child items. You can use the Recurse parameter to get
items in all child containers.
</help>
Oh. -Force finds it but that seems unnecessary. E.g. dir finds it
without the /a switch:
C:\>dir/b/s/p msvcr9*
C:\MSOCache\All Users\{20140000-0115-0409-1000-0000000FF1CE}-C\msvcr90.dll
PS C:\> icacls MSOCache
MSOCache NT AUTHORITY\SYSTEM

OI)(CI)(F)
BUILTIN\Administrators

OI)(CI)(F)
*and* then much of the elegance of the technique is lost in a hail of
"Accessed...denied" messages as other really inaccessible directories (to an
Administrator?) are tested and the failure of those tests reported. ; ]
So it looks like -Recurse is the analog of the dir/s and -Force is a
(verbose!) analog of dir/a? Now all I need I suppose is to find
-NoVerbose option so the dir/a/s/p complete analog will be
ls -Fo -R -NoV | more. It may take some time before I am used to
typing that in hurry. And that still leaves discovering how to get a
dir/b effect too. ; )
TIA
Robert Aldwinckle
---