none
Re: Powershell display system.IO.DirectoryINFO and System.IO.FileInfo RRS feed

  • Question

  • Hi All,

    Can someone tell me how to view directories and file properties on PS.

    When I type gci | get-member I see fileinfo but

    how to view System.IO.DirectoryInfo ?

    Also is there a special forum for Powershell and where and how to find it?

    Thank-you

    SQL75

    Thursday, February 5, 2015 4:16 PM

Answers

  • Your question is not clear. Get-childitem cmdlet returns both FileInfo and DirectoryInfo objects when used with the file system provider.

    You can see this for yourself:


    PS C:\> get-childitem | where-object { $_ -is [System.IO.DirectoryInfo] }
    


    -- Bill Stewart [Bill_Stewart]

    • Marked as answer by SQL75 Thursday, February 5, 2015 5:22 PM
    Thursday, February 5, 2015 4:34 PM
    Moderator

All replies

  • Hi All,

    Can someone tell me how to view directories and file properties on PS.

    When I type gci | get-member I see fileinfo but

    how to view System.IO.DirectoryInfo ?

    Also is there a special forum for Powershell and where and how to find it?

    Thank-you

    SQL75

    Thursday, February 5, 2015 4:16 PM
  • Your question is not clear. Get-childitem cmdlet returns both FileInfo and DirectoryInfo objects when used with the file system provider.

    You can see this for yourself:


    PS C:\> get-childitem | where-object { $_ -is [System.IO.DirectoryInfo] }
    


    -- Bill Stewart [Bill_Stewart]

    • Marked as answer by SQL75 Thursday, February 5, 2015 5:22 PM
    Thursday, February 5, 2015 4:34 PM
    Moderator