powershellwindows-serverservermanager

Where can I find a list of exit codes and their meanings for the PowerShell ServerManager cmdlet?


I'm using the PowerShell ServerManager cmdlet and haven't been able to find a comprehensive list of exit codes for the installation commands.

$feature = Add-WindowsFeature NET-Framework-Core
exit $feature.ExitCode

What values can I expect ExitCode to contain?


Solution

  • I have never used this cmdlet, but based on @vmrob's initial answer, it appears that ExitCode is in instance of the Microsoft.Windows.ServerManager.Commands.FeatureOperationExitCode enum type.

    You should be able to get a list of possible values like this:

    [enum]::GetNames( [Microsoft.Windows.ServerManager.Commands.FeatureOperationExitCode] )