diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions_OutputTypeAttribute.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions_OutputTypeAttribute.md index 4a0e17460dc..8721c841f2b 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions_OutputTypeAttribute.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions_OutputTypeAttribute.md @@ -1,7 +1,7 @@ --- description: Describes an attribute that reports the type of object that the function returns. Locale: en-US -ms.date: 04/14/2023 +ms.date: 10/06/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_functions_outputtypeattribute?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: about_Functions_OutputTypeAttribute @@ -16,19 +16,22 @@ returns. ## Long description The **OutputType** attribute lists the .NET types of objects that the functions -returns. You can use its optional ParameterSetName parameter to list different -output types for each parameter set. +returns. You can use its optional **ParameterSetName** parameter to list +different output types for each parameter set. The **OutputType** attribute is supported on simple and advanced functions. -It's independent of the **CmdletBinding** attribute. +It's independent of the **CmdletBinding** attribute. The **OutputType** +attribute provides the value of the **OutputType** property of the +**System.Management.Automation.FunctionInfo** object that the `Get-Command` +cmdlet returns. -The **OutputType** attribute provides the value of the **OutputType** property -of the **System.Management.Automation.FunctionInfo** object that the -`Get-Command` cmdlet returns. +> [!NOTE] +> The **OutputType** attribute value isn't derived from the function code or +> compared to the actual function output. As such, the value might be +> inaccurate. -The **OutputType** attribute value is only a documentation note. It's not -derived from the function code or compared to the actual function output. As -such, the value might be inaccurate. +The **OutputType** attribute also informs tab completion results for situations +like: `Command | Select ` and `Command | Where `. ## Syntax @@ -235,8 +238,8 @@ Or its shorter version. ``` The value of the **OutputType** property can be null. Use a null value when the -output isn't a .NET type, such as a **WMI** object or a formatted view of an -object. +function doesn't write any output to the **Success** stream. If the function +writes output, but you don't know the type, use **System.Object**. ## See also diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions_OutputTypeAttribute.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions_OutputTypeAttribute.md index 18ac6aa3f52..d2727eb6110 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions_OutputTypeAttribute.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions_OutputTypeAttribute.md @@ -1,7 +1,7 @@ --- description: Describes an attribute that reports the type of object that the function returns. Locale: en-US -ms.date: 04/14/2023 +ms.date: 10/06/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_functions_outputtypeattribute?view=powershell-7.4&WT.mc_id=ps-gethelp schema: 2.0.0 title: about_Functions_OutputTypeAttribute @@ -16,19 +16,22 @@ returns. ## Long description The **OutputType** attribute lists the .NET types of objects that the functions -returns. You can use its optional ParameterSetName parameter to list different -output types for each parameter set. +returns. You can use its optional **ParameterSetName** parameter to list +different output types for each parameter set. The **OutputType** attribute is supported on simple and advanced functions. -It's independent of the **CmdletBinding** attribute. +It's independent of the **CmdletBinding** attribute. The **OutputType** +attribute provides the value of the **OutputType** property of the +**System.Management.Automation.FunctionInfo** object that the `Get-Command` +cmdlet returns. -The **OutputType** attribute provides the value of the **OutputType** property -of the **System.Management.Automation.FunctionInfo** object that the -`Get-Command` cmdlet returns. +> [!NOTE] +> The **OutputType** attribute value isn't derived from the function code or +> compared to the actual function output. As such, the value might be +> inaccurate. -The **OutputType** attribute value is only a documentation note. It's not -derived from the function code or compared to the actual function output. As -such, the value might be inaccurate. +The **OutputType** attribute also informs tab completion results for situations +like: `Command | Select ` and `Command | Where `. ## Syntax @@ -235,8 +238,8 @@ Or its shorter version. ``` The value of the **OutputType** property can be null. Use a null value when the -output isn't a .NET type, such as a **WMI** object or a formatted view of an -object. +function doesn't write any output to the **Success** stream. If the function +writes output, but you don't know the type, use **System.Object**. ## See also diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_OutputTypeAttribute.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_OutputTypeAttribute.md index ce05abfb1b4..838aa61ac74 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_OutputTypeAttribute.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_OutputTypeAttribute.md @@ -1,7 +1,7 @@ --- description: Describes an attribute that reports the type of object that the function returns. Locale: en-US -ms.date: 04/14/2023 +ms.date: 10/06/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_functions_outputtypeattribute?view=powershell-7.5&WT.mc_id=ps-gethelp schema: 2.0.0 title: about_Functions_OutputTypeAttribute @@ -16,19 +16,22 @@ returns. ## Long description The **OutputType** attribute lists the .NET types of objects that the functions -returns. You can use its optional ParameterSetName parameter to list different -output types for each parameter set. +returns. You can use its optional **ParameterSetName** parameter to list +different output types for each parameter set. The **OutputType** attribute is supported on simple and advanced functions. -It's independent of the **CmdletBinding** attribute. +It's independent of the **CmdletBinding** attribute. The **OutputType** +attribute provides the value of the **OutputType** property of the +**System.Management.Automation.FunctionInfo** object that the `Get-Command` +cmdlet returns. -The **OutputType** attribute provides the value of the **OutputType** property -of the **System.Management.Automation.FunctionInfo** object that the -`Get-Command` cmdlet returns. +> [!NOTE] +> The **OutputType** attribute value isn't derived from the function code or +> compared to the actual function output. As such, the value might be +> inaccurate. -The **OutputType** attribute value is only a documentation note. It's not -derived from the function code or compared to the actual function output. As -such, the value might be inaccurate. +The **OutputType** attribute also informs tab completion results for situations +like: `Command | Select ` and `Command | Where `. ## Syntax @@ -235,8 +238,8 @@ Or its shorter version. ``` The value of the **OutputType** property can be null. Use a null value when the -output isn't a .NET type, such as a **WMI** object or a formatted view of an -object. +function doesn't write any output to the **Success** stream. If the function +writes output, but you don't know the type, use **System.Object**. ## See also diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Functions_OutputTypeAttribute.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Functions_OutputTypeAttribute.md index 66d9610a0a8..1f4bf773529 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Functions_OutputTypeAttribute.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Functions_OutputTypeAttribute.md @@ -1,7 +1,7 @@ --- description: Describes an attribute that reports the type of object that the function returns. Locale: en-US -ms.date: 04/14/2023 +ms.date: 10/06/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_functions_outputtypeattribute?view=powershell-7.6&WT.mc_id=ps-gethelp schema: 2.0.0 title: about_Functions_OutputTypeAttribute @@ -16,19 +16,22 @@ returns. ## Long description The **OutputType** attribute lists the .NET types of objects that the functions -returns. You can use its optional ParameterSetName parameter to list different -output types for each parameter set. +returns. You can use its optional **ParameterSetName** parameter to list +different output types for each parameter set. The **OutputType** attribute is supported on simple and advanced functions. -It's independent of the **CmdletBinding** attribute. +It's independent of the **CmdletBinding** attribute. The **OutputType** +attribute provides the value of the **OutputType** property of the +**System.Management.Automation.FunctionInfo** object that the `Get-Command` +cmdlet returns. -The **OutputType** attribute provides the value of the **OutputType** property -of the **System.Management.Automation.FunctionInfo** object that the -`Get-Command` cmdlet returns. +> [!NOTE] +> The **OutputType** attribute value isn't derived from the function code or +> compared to the actual function output. As such, the value might be +> inaccurate. -The **OutputType** attribute value is only a documentation note. It's not -derived from the function code or compared to the actual function output. As -such, the value might be inaccurate. +The **OutputType** attribute also informs tab completion results for situations +like: `Command | Select ` and `Command | Where `. ## Syntax @@ -235,8 +238,8 @@ Or its shorter version. ``` The value of the **OutputType** property can be null. Use a null value when the -output isn't a .NET type, such as a **WMI** object or a formatted view of an -object. +function doesn't write any output to the **Success** stream. If the function +writes output, but you don't know the type, use **System.Object**. ## See also