Please come back for more

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 *