< Back

Write-PodeHtmlResponse

Sat Jan 18, 2020 7:21 pm

NAME Write-PodeHtmlResponse



SYNOPSIS

Writes HTML data to the Response.





SYNTAX

Write-PodeHtmlResponse -Value <Object> [-StatusCode <Int32>] [<CommonParameters>]



Write-PodeHtmlResponse -Path <String> [-StatusCode <Int32>] [<CommonParameters>]





DESCRIPTION

Writes HTML data to the Response, setting the content type accordingly.





PARAMETERS

-Value <Object>

A String, PSObject, or HashTable value.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Path <String>

The path to a HTML file.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-StatusCode <Int32>

The status code to set against the response.



Required? false

Position? named

Default value 200

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



-------------------------- EXAMPLE 1 --------------------------



Write-PodeHtmlResponse -Value '<html><body>Hello!</body></html>'













-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Write-PodeHtmlResponse -Value @{ Message = 'Hello, all!' }













-------------------------- EXAMPLE 3 --------------------------



PS C:\\>Write-PodeHtmlResponse -Path 'E:/Site/About.html'















RELATED LINKS