-
Notifications
You must be signed in to change notification settings - Fork 0
Write PodeFileResponse
external help file: Pode-help.xml Module Name: Pode online version: PodeType: Responses schema: 2.0.0
Renders the content of a static, or dynamic, file on the Response.
Write-PodeFileResponse [-Path] <String> [-Data <Object>] [-ContentType <String>] [-MaxAge <Int32>]
[-StatusCode <Int32>] [-Cache] [-FileBrowser] [-ProgressAction <ActionPreference>] [<CommonParameters>]
Renders the content of a static, or dynamic, file on the Response. You can set browser's to cache the content, and also override the file's content type.
Write-PodeFileResponse -Path 'C:/Files/Stuff.txt'
Write-PodeFileResponse -Path 'C:/Files/Stuff.txt' -Cache -MaxAge 1800
Write-PodeFileResponse -Path 'C:/Files/Stuff.txt' -ContentType 'application/json'
Write-PodeFileResponse -Path 'C:/Views/Index.pode' -Data @{ Counter = 2 }
Write-PodeFileResponse -Path 'C:/Files/Stuff.txt' -StatusCode 201
Write-PodeFileResponse -Path 'C:/Files/' -FileBrowser
Should the file's content be cached by browsers, or not?
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
The content type of the file's contents - this overrides the file's extension.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
A HashTable of dynamic data to supply to a dynamic file.
Type: Object
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: @{}
Accept pipeline input: False
Accept wildcard characters: False
If the path is a folder, instead of returning 404, will return A browsable content of the directory.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
The maximum age to cache the file's content on the browser, in seconds.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: 3600
Accept pipeline input: False
Accept wildcard characters: False
The path to a file.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
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: False
The 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: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
sss
x