How to display only filesystemobjects from PSDrive command

Welcome Forums General PowerShell Q&A How to display only filesystemobjects from PSDrive command

This topic contains 3 replies, has 3 voices, and was last updated by

 
Participant
7 months ago.

  • Author
    Posts
  • #112460

    Participant
    Topics: 1
    Replies: 1
    Points: 3
    Rank: Member

    How to get a list of objects which has Provider="FileSystem"

  • #112504

    Keymaster
    Topics: 13
    Replies: 4872
    Points: 1,811
    Helping HandTeam Member
    Rank: Community Hero

    If you mean using Get-PSDrive, just pipe to Where-Object and specify the filter criteria. Or, use the -Provider switch of Get-PSDrive.

    • #112508

      Participant
      Topics: 1
      Replies: 1
      Points: 3
      Rank: Member

      I got the collection from get-psdrive and since provider is sort of .net property of type System.Management.Automation.ProviderInfo Provider {get;}

      I had to compare with the collection object's property like

      $b[1].Provider.Name which was actually a filesystem type.

      Output from my pc

      Name           Used (GB)     Free (GB) Provider      Root                                               CurrentLocation
      —-           ———     ——— ——–      —-                                               —————
      Alias                                  Alias
      C                 168.96        492.78 FileSystem    C:\                                                 Users\Abhishe

  • #112513

    Participant
    Topics: 2
    Replies: 392
    Points: 667
    Helping Hand
    Rank: Major Contributor

    Get-PSDrive -PSProvider FileSystem

The topic ‘How to display only filesystemobjects from PSDrive command’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort