Set-PowerShellExitCode

Set-PowerShellExitCode

Set-PowerShellExitCode

Sets the exit code for the PowerShell scripts.

Syntax

Set-PowerShellExitCode `
  [-ExitCode <Int32>] `
  [-IgnoredArguments <Object[]>] [<CommonParameters>]

Description

Sets the exit code as an environment variable that is checked and used as the exit code for the package at the end of the package script.

Notes

This tells PowerShell that it should prepare to shut down.

Aliases

None

Examples

EXAMPLE 1

Set-PowerShellExitCode 3010

Inputs

None

Outputs

None

Parameters

-ExitCode [<Int32>]

PropertyValue
Aliases
Required?false
Position?1
Default Value0
Accept Pipeline Input?false

-IgnoredArguments [<Object[]>]

PropertyValue
Aliases
Required?false
Position?named
Default Value
Accept Pipeline Input?false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters http://go.microsoft.com/fwlink/p/?LinkID=113216 .

Function Reference

:choco-info: NOTE

This documentation has been automatically generated from Import-Module "$env:ChocolateyInstall\helpers\chocolateyInstaller.psm1" -Force; Get-Help Set-PowerShellExitCode -Full.

View the source for Set-PowerShellExitCode