Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Parsing Icacls results

$
0
0

Hello!

Basically I want a conditional statement, if icacls failed processing any files, then do not continue. Please imagine you are writing a PowerShell script, this script runs$icaclsResult = Icacls.exe $soruce, where $source is a valid folder path. 

So now we have the output of the Icacls run inside the variable $icaclsResult. A typical icacls runs last line typically looks as follows :

Successfully processed 12 files; Failed processing 0 files

Is it possible for me to parse the entire icacls result so that I can use the number following Failed processingas a sort-of exitcode?

Thank you in advance.


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>