It`s simple when you know how ! Operating Systems,Tutorials,Windows How to return one value from a PowerShell select property

How to return one value from a PowerShell select property

 

 

When running select from powershell the result will be headers and value, if you what just the value you should use -ExpandProperty switch, for example

if you want to get just the username of file owner on c:\1.txt :

$usr = GET-ACL C:\1.txt | select -exp owner
echo $usr

This will return :  coputername\username

 

 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

You can’t access this shared folder because your organization’s security policies block unauthenticated guest accessYou can’t access this shared folder because your organization’s security policies block unauthenticated guest access

  When trying to access from new server to old shares you might get this error : ” You can’t access this shared folder because your organization’s security policies block