• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1083
  • Last Modified:

exit code of iCacls

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 ?
0
Sybux
Asked:
Sybux
1 Solution
 
SybuxAuthor Commented:
Ok I answer myself and for futur research :

$LASTEXITCODE !!
0

Featured Post

Evaluating UTMs? Here's what you need to know!

Evaluating a UTM appliance and vendor can prove to be an overwhelming exercise.  How can you make sure that you're getting the security that your organization needs without breaking the bank? Check out our UTM Buyer's Guide for more information on what you should be looking for!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now