none
Why do "Get-Childitem -Path C:\ -Filter *.swidtag -Recurse -ErrorAction SilentlyContinue" and Command Prompt "C:\>Dir *.swidtag /S" return different results? RRS feed

  • General discussion

  • Powershell:

    PS F:\> Get-ChildItem -Path C:\ -Filter *.swidtag -File -Recurse -ErrorAction SilentlyContinue
        Directory: C:\Windows\WinSxS\amd64_microsoft-windows-b..base-serverstandard_31bf3856ad364e35_6.3.9600.16384_none_9dd3fa54eaa62662


    Mode                LastWriteTime     Length Name
    ----                -------------     ------ ----
    -a---         8/22/2013   8:49 AM       1028 regid.1991-06.com.microsoft_Windows-Server-2012-R2-Standard.swidtag


        Directory: C:\Windows\WinSxS\amd64_microsoft-windows-b..se-serverdatacenter_31bf3856ad364e35_6.3.9600.16384_none_80
        386a0f711f7476

    Mode                LastWriteTime     Length Name
    ----                -------------     ------ ----
    -a---         8/22/2013   8:49 AM       1032 regid.1991-06.com.microsoft_Windows-Server-2012-R2-Datacenter.swidtag

    PS F:\>

    Two files found with PowerShell (x86). Command Prompt on the very same machine:

    C:\>Dir *.swidtag /S
     Volume in drive C has no label.
     Volume Serial Number is 5635-F7B2

     Directory of C:\ProgramData\regid.1991-06.com.microsoft

    10/02/2012  02:34 AM             1,045 regid.1991-06.com.microsoft Microsoft Lyn
    c 2013.swidtag
    10/02/2012  01:38 AM             1,061 regid.1991-06.com.microsoft Microsoft Pro
    ject Professional 2013.swidtag
    08/22/2013  07:49 AM             1,028 regid.1991-06.com.microsoft_Windows-Serve
    r-2012-R2-Standard.swidtag
                   3 File(s)          3,134 bytes

     Directory of C:\Users\All Users\regid.1991-06.com.microsoft

    10/02/2012  02:34 AM             1,045 regid.1991-06.com.microsoft Microsoft Lyn
    c 2013.swidtag
    10/02/2012  01:38 AM             1,061 regid.1991-06.com.microsoft Microsoft Pro
    ject Professional 2013.swidtag
    08/22/2013  07:49 AM             1,028 regid.1991-06.com.microsoft_Windows-Serve
    r-2012-R2-Standard.swidtag
                   3 File(s)          3,134 bytes

     Directory of C:\Windows\WinSxS\amd64_microsoft-windows-b..base-serverstandard_3
    1bf3856ad364e35_6.3.9600.16384_none_9dd3fa54eaa62662

    08/22/2013  07:49 AM             1,028 regid.1991-06.com.microsoft_Windows-Serve
    r-2012-R2-Standard.swidtag
                   1 File(s)          1,028 bytes

     Directory of C:\Windows\WinSxS\amd64_microsoft-windows-b..se-serverdatacenter_3
    1bf3856ad364e35_6.3.9600.16384_none_80386a0f711f7476

    08/22/2013  07:49 AM             1,032 regid.1991-06.com.microsoft_Windows-Serve
    r-2012-R2-Datacenter.swidtag
                   1 File(s)          1,032 bytes

         Total Files Listed:
                   8 File(s)          8,328 bytes
                   0 Dir(s)  45,113,790,464 bytes free

    C:\>

    Powershell was not running under elevated privileges but neither was the command prompt. Any ideas what causes the difference?

    • Changed type Bill_Stewart Friday, January 26, 2018 3:19 PM
    • Moved by Bill_Stewart Friday, January 26, 2018 3:19 PM Abandoned
    Friday, December 8, 2017 9:48 AM

All replies