How to test shared path, child item and security details using Power Shell script

  1. #Test shared path is exist or correct   
  2. Test-Path "C:\Users\john\script\"  
  3.  
  4. # Using the Get-ChildItem Cmdlet  
  5. #Replicating (and Extending) the DIR Command  
  6. #In its basic form the Get-ChildItem cmdlet provides functionality similar to the dir command.   
  7. GCI "C:\Users\john\script\"  
  8. Get-ChildItem -recurse  
  9. Get-ChildItem env:  
  10.  
  11. #Retrieving the Security Descriptor for an Object  
  12. #The Get-Acl cmdlet enables you to retrieve the security descriptor (access control list) for a file, a folder, or even a registry key    
  13. Get-Acl "C:\Users\john\script\" | Format-List  
  14. acl "C:\Users\john\script\"