Downloads a given URL to a file, automatically determining the filename.
Save-WebRequest.ps1 [-Uri] <Uri> [-CreationTime <DateTime>] [-LastWriteTime <DateTime>] [-Open]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
Save-WebRequest.ps1 https://www.irs.gov/pub/irs-pdf/f1040.pdf -Open
Saves f1040.pdf (or else a filename specified in the Content-Disposition header) and opens it.
The URL to download.
Type: Uri
Parameter Sets: (All)
Aliases: Url, Href, Src
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
Sets the creation time on the file to the given value.
Type: DateTime
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Sets the creation time on the file to the given value.
Type: DateTime
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
When present, invokes the file after it is downloaded.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
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.
https://tools.ietf.org/html/rfc2183
http://test.greenbytes.de/tech/tc2231/
https://msdn.microsoft.com/library/system.net.mime.contentdisposition.filename.aspx
https://msdn.microsoft.com/library/system.io.path.getinvalidfilenamechars.aspx