Get-LabInternetFile

SYNOPSIS

Download a file

SYNTAX

Get-LabInternetFile [-Uri] <String> [-Path] <String> [-FileName <String>] [-Force] [-NoDisplay] [-PassThru]
 [<CommonParameters>]

DESCRIPTION

Gets a file by URI and stores it in a specific path if it does not exist.

EXAMPLES

Example 1

Get-LabInternetFile -Uri 'https://download.microsoft.com/download/3/1/D/31D734E0-BFE8-4C33-A9DE-2392808ADEE6/SSMS-Setup-ENU.exe' -Path '\\VM1\AFileShare\SSMS.exe'

Downloads the SQL Server Management Suite and saves it on a lab machine's file share

PARAMETERS

-Uri

The URI of the file to retrieve

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Force

If present, overwrite the file at the destination

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Path

Path to store the file in

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-PassThru

Indicates that the downloaded file should be returned

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-FileName

The file name to save the file as

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-NoDisplay

Do not show console output

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

NOTES