Write PodeXmlResponse - mdaneri/Pode GitHub Wiki
external help file: Pode-help.xml Module Name: Pode online version: PodeType: Responses schema: 2.0.0
Writes XML data to the Response.
Write-PodeXmlResponse [-Value] <Object> [-Depth <Int32>] [-ContentType <String>] [-StatusCode <Int32>]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
Write-PodeXmlResponse -Path <String> [-ContentType <String>] [-StatusCode <Int32>]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
Writes XML data to the Response, setting the content type accordingly.
<name>Rick</name></root>'
Write-PodeXmlResponse -Value @{ Name = 'Rick' } -StatusCode 201
@(@{ Name = 'Rick' }, @{ Name = 'Don' }) | Write-PodeXmlResponse
$users = @([PSCustomObject]@{
Name = 'Rick'
}, [PSCustomObject]@{
Name = 'Don'
}
)
Write-PodeXmlResponse -Value $users
@([PSCustomObject]@{
Name = 'Rick'
}, [PSCustomObject]@{
Name = 'Don'
}
) | Write-PodeXmlResponse
Write-PodeXmlResponse -Path 'E:/Files/Names.xml'
Because XML content has not yet an official content type. one custom can be specified here (Default: 'application/xml' ) https://www.rfc-editor.org/rfc/rfc3023
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: Application/xml
Accept pipeline input: False
Accept wildcard characters: FalseThe Depth to generate the XML document - the larger this value the worse performance gets.
Type: Int32
Parameter Sets: Value
Aliases:
Required: False
Position: Named
Default value: 10
Accept pipeline input: False
Accept wildcard characters: FalseThe path to an XML file.
Type: String
Parameter Sets: File
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe status code to set against the response.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: 200
Accept pipeline input: False
Accept wildcard characters: FalseA String, PSObject, or HashTable value.
Type: Object
Parameter Sets: Value
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.