Skip to content

Save SqlDscSqlServerMediaFile

dscbot edited this page May 11, 2024 · 1 revision

Save-SqlDscSqlServerMediaFile

SYNOPSIS

Downloads SQL Server media from a provided URL and saves the downloaded media file to the specified file path

SYNTAX

Save-SqlDscSqlServerMediaFile [-Url] <String> [-DestinationPath] <FileInfo> [[-FileName] <String>]
 [[-Language] <String>] [-Quiet] [-Force] [-WhatIf] [-Confirm]
 [<CommonParameters>]

DESCRIPTION

The Save-SqlDscSqlServerMediaFile function downloads SQL Server media from a provided URL and saves the downloaded media file to the specified file path.

If the URL ends with ".exe", it is treated as an executable that downloads an ISO. If it doesn't, it is treated as a direct link to an ISO.

The function also prints the SHA1 hash of the downloaded file.

EXAMPLES

EXAMPLE 1

Save-SqlDscSqlServerMediaFile -Url 'https://download.microsoft.com/download/c/c/9/cc9c6797-383c-4b24-8920-dc057c1de9d3/SQL2022-SSEI-Dev.exe' -DestinationPath 'C:\path\to\destination'

This downloads the SQL Server 2022 media and saves it to the specified destination path.

EXAMPLE 2

Save-SqlDscSqlServerMediaFile -Url 'https://download.microsoft.com/download/d/a/2/da259851-b941-459d-989c-54a18a5d44dd/SQL2019-SSEI-Dev.exe' -DestinationPath 'C:\path\to\destination'

This downloads the SQL Server 2019 media and saves it to the specified destination path.

EXAMPLE 3

Save-SqlDscSqlServerMediaFile -Url 'https://download.microsoft.com/download/E/F/2/EF23C21D-7860-4F05-88CE-39AA114B014B/SQLServer2017-x64-ENU.iso' -DestinationPath 'C:\path\to\destination'

This downloads the SQL Server 2017 media and saves it to the specified destination path.

EXAMPLE 4

Save-SqlDscSqlServerMediaFile -Url 'https://download.microsoft.com/download/9/0/7/907AD35F-9F9C-43A5-9789-52470555DB90/ENU/SQLServer2016SP1-FullSlipstream-x64-ENU.iso' -DestinationPath 'C:\path\to\destination'

This downloads the SQL Server 2016 media and saves it to the specified destination path.

PARAMETERS

-DestinationPath

The file path where the downloaded media file should be saved.

Type: FileInfo
Parameter Sets: (All)
Aliases:

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

-FileName

The file name of the downloaded media file. Defaults to media.iso if not provided.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: Media.iso
Accept pipeline input: False
Accept wildcard characters: False

-Force

Forces the download of the media file even if the file already exists at the specified destination path.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

-Language

The language parameter specifies the language of the downloaded iso. This parameter is only used when the provided URL is an executable file. Defaults to 'en-US' if not provided.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 4
Default value: En-US
Accept pipeline input: False
Accept wildcard characters: False

-Quiet

Disables verbose progress output during the download process.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

-Url

The URL of the SQL Server media to download.

Type: String
Parameter Sets: (All)
Aliases:

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

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

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

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

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

System.IO.FileInfo

NOTES

RELATED LINKS

Home

Commands

Resources

Usage

Clone this wiki locally