Result of custom installation

Hello,

I am doing the first steps with the toolkit.
I have created some packages, which install a msi or exe.

The commands “Execute-MSI” and “Execute-Process” seem to take care, if the installation was ok or not.
What about this simple example:

<code>$FeatureInstallResult = Install-WindowsFeature -Name Telnet-Client

IF ( $FeatureInstallResult.Success -eq $True ) {            
    # Success
} ELSE {            
    # Error
}</code>

How do I report back to the toolkit, if my custom Installation was successful or not?

Thank you

Would it be correct like this?

<code>$FeatureInstallResult = Install-WindowsFeature -Name Telnet-Client

IF ( $FeatureInstallResult.Success -eq $True ) {            
    [int32]$mainExitCode = 0
} ELSE {            
    [int32]$mainExitCode = 1
}</code>