exit code of iCacls

Sybux
Sybux used Ask the Experts™
on
Hello,

I'm running this command in my script :

    icacls D:\Test /grant "$($userCN):(OI)(CI)M" | Out-Null

Open in new window


I'd like to get the exit status code to know if was OK or not

Any idea ?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
Ok I answer myself and for futur research :

$LASTEXITCODE !!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial