Get-WebFile
Get-WebFile
Get-WebFile
Downloads a file from an HTTP/HTTPS location. Prefer HTTPS when available.
Syntax
Get-WebFile `
[-Url <String>] `
[-FileName <String>] `
[-UserAgent <String>] `
[-Passthru] `
[-Quiet] `
[-Options <Hashtable>] `
[-IgnoredArguments <Object[]>] [<CommonParameters>]
Description
This will download a file from an HTTP/HTTPS location, saving the file to the FileName location specified.
Notes
This is a low-level function and not recommended for use in package
scripts. It is recommended you call Get-ChocolateyWebFile
instead.
Will automatically call Set-PowerShellExitCode to set the package exit code to 404 if the resource is not found.
Aliases
None
Inputs
None
Outputs
None
Parameters
-Url [<String>]
Property | Value |
---|---|
Aliases | |
Required? | false |
Position? | 1 |
Default Value | |
Accept Pipeline Input? | false |
-FileName [<String>]
Property | Value |
---|---|
Aliases | |
Required? | false |
Position? | 2 |
Default Value | |
Accept Pipeline Input? | false |
-UserAgent [<String>]
Property | Value |
---|---|
Aliases | |
Required? | false |
Position? | 3 |
Default Value | chocolatey command line |
Accept Pipeline Input? | false |
-Passthru
Property | Value |
---|---|
Aliases | |
Required? | false |
Position? | named |
Default Value | False |
Accept Pipeline Input? | false |
-Quiet
Property | Value |
---|---|
Aliases | |
Required? | false |
Position? | named |
Default Value | False |
Accept Pipeline Input? | false |
-Options [<Hashtable>]
Property | Value |
---|---|
Aliases | |
Required? | false |
Position? | named |
Default Value | @{Headers = @{} } |
Accept Pipeline Input? | false |
-IgnoredArguments [<Object[]>]
Property | Value |
---|---|
Aliases | |
Required? | false |
Position? | named |
Default Value | |
Accept Pipeline Input? | false |
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters
http://go.microsoft.com/fwlink/p/?LinkID=113216 .
Links
Function Reference:choco-info: NOTE
This documentation has been automatically generated from
Import-Module "$env:ChocolateyInstall\helpers\chocolateyInstaller.psm1" -Force; Get-Help Get-WebFile -Full
.
View the source for Get-WebFile