can you search help for a parameter ? "PrisContainer"

Harvey Lewis 1 Reputation point
2022-06-06T23:50:12.887+00:00

I am looking for a way to tell files from Directories.

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,387 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Rich Matheisen 45,096 Reputation points
    2022-06-07T01:48:50.517+00:00

    In what context?

    # get just directories
    Get-ChildItem c:\junk -Dir
     OR
    Get-ChildItem c:\junk | Where-Object {$_.PsIsContainer}
    
    
    # get just files
    Get-ChildItem c:\junk -File
     OR
    Get-ChildItem c:\junk | Where-Object {-Not $_.PsIsContainer}
    

  2. Limitless Technology 39,391 Reputation points
    2022-06-07T15:00:30.607+00:00

    Hi HarveyLewis-9057,

    Powershell can be used to identify folders and files and their properties:

    Get-ChildItem -Path C:\Test -Name
    Get-ItemProperty C:\Test\Weather.xls | Format-List

    The following article may be of use for finding out the required parameters:

    https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-childitem?view=powershell-7.2

    You may also find this useful:

    https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-itemproperty?view=powershell-7.2

    -----------------------------------------------------------------------------------------------------------------------------------------------

    --If the reply is helpful, please Upvote and Accept as answer--