简体   繁体   English

使用Powershell提取SQL Server 2017安装文件

[英]Extract sql server 2017 install file with Powershell

I would like to download the sql server 2017 install file from Microsft, link: https://go.microsoft.com/fwlink/?linkid=853017 and if you also download this file you will notice that this is just a 4.8 mb file. 我想从Microsft下载sql server 2017安装文件,链接: https ://go.microsoft.com/fwlink/?linkid = 853017,如果您还下载此文件,您会注意到这只是一个4.8 mb文件。 When running it, and select to download the media for the full install, it will download a 700 mb file called "SQLEXPRADV_x64_ENU.exe" 运行它并选择下载完整安装的媒体时,它将下载一个700 mb的文件,名为“ SQLEXPRADV_x64_ENU.exe”

While this is an exe, it basically just unzips all its contents. 虽然这是一个exe,但它基本上只是解压缩所有内容。

I have tried to use Powershell to silently unzip: 我尝试使用Powershell静默解压缩:

start-process C:\SQLEXPRADV_x64_ENU.exe -Argumentlist "/a"

however it still brings up the prompt asking me to select zip location. 但是它仍然显示提示,要求我选择邮政编码位置。

Is there a way to unzip this file silently (ie just supply the desired path and automate it all from PS)? 有没有一种方法可以静默地解压缩该文件(即仅提供所需的路径,然后从PS自动执行所有操作)?

*Edit: This is an environment where I wouldn't be able to use 7zip *编辑:这是一个我无法使用7zip的环境

100%工作

SQLEXPRADV_x64_ENU.exe /extract /X:"%TEMP%\mssql" /q && ping 127.0.0.1 -n 30 && %TEMP%\mssql\setup.exe /ACTION=Install

你可以试试

start-process "C:\SQLEXPRADV_x64_ENU.exe" -Argumentlist "/extract: `"c:\temp`""

It is not possible to script out the extracting of the full installation media for SQL Server Express. 无法为SQL Server Express提取完整安装媒体的脚本。 The purpose of that file is for user and ease of installation, it was not designed for strict script install. 该文件的目的是为了用户和易于安装,而不是为严格的脚本安装而设计的。

If you are looking to get the media for doing an automated installation of SQL Server Express, then simply run the extract one time and you have it. 如果您希望获得用于自动安装SQL Server Express的介质,则只需运行一次提取程序就可以了。 Once the media is extracted then you can copy that directory and work on automating the installation. 提取媒体后,您可以复制该目录并进行自动化安装。

试试这个c:\\ SQLEXPRADV_x64_ENU.exe / X / q

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM