It's possible that the current version of the PowerShell cmdlets act as a wrapper around the deprecated servermanagercmd.exe
. If this is the case, then the exit codes listed here should be applicable:
http://technet.microsoft.com/en-us/library/cc733119.aspx
The exit codes that I've encountered so far match:
With a feature that is already installed
PS C:\> $feature = Add-WindowsFeature NET-Framework-Core
PS C:\> $feature.ExitCode
NoChangeNeeded
PS C:\> $feature.ExitCode.value__
1003
When a feature fails to install due to a needed restart
This can happen after Windows Update runs but before the computer is restarted.
PS C:\> $feature = Add-WindowsFeature NET-Framework-Core
PS C:\> $feature.ExitCode
FailedRestartRequired
PS C:\> $feature.ExitCode.value__
1001
On success
PS C:\> $feature = Add-WindowsFeature NET-Framework-Core
PS C:\> $feature.ExitCode
Success
PS C:\> $feature.ExitCode.value__
0