Get-WebFileName
Get-WebFileName
Get-WebFileName
Gets the original file name from a url. Used by Get-WebFile to determine the original file name for a file.
Syntax
Get-WebFileName `
[-Url <String>] `
-DefaultName <String> `
[-UserAgent <String>] `
[-IgnoredArguments <Object[]>] [<CommonParameters>]
Description
Uses several techniques to determine the original file name of the file based on the url for the file.
Notes
Falls back to DefaultName when the name cannot be determined.
Chocolatey works best when the packages contain the software it is managing and doesn’t require downloads. However most software in the Windows world requires redistribution rights and when sharing packages publicly (like on the community feed), maintainers may not have those aforementioned rights. Chocolatey understands how to work with that, hence this function. You are not subject to this limitation with internal packages.
Aliases
None
Examples
EXAMPLE 1
Get-WebFileName -Url $url -DefaultName $originalFileName
Inputs
None
Outputs
None
Parameters
-Url [<String>]
Property | Value |
---|---|
Aliases | |
Required? | false |
Position? | 1 |
Default Value | |
Accept Pipeline Input? | false |
-DefaultName <String>
Property | Value |
---|---|
Aliases | |
Required? | true |
Position? | 2 |
Default Value | |
Accept Pipeline Input? | false |
-UserAgent [<String>]
Property | Value |
---|---|
Aliases | |
Required? | false |
Position? | named |
Default Value | chocolatey command line |
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-WebFileName -Full
.
View the source for Get-WebFileName