简体   繁体   English

Powershell 中 Windows 系统安装程序脚本的 Visual Studio 代码的任务名称

[英]TASK Names for Visual Studio Code for Windows System Installer script in Powershell

Looking for some help on writing a PowerShell script to install Visual Studio Code.寻找有关编写 PowerShell 脚本以安装 Visual Studio Code 的帮助。 I have downloaded the Windows 64 System installer: VSCodeSetup-x64-1.56.2我已经下载了 Windows 64 位系统安装程序:VSCodeSetup-x64-1.56.2

My script so far:到目前为止我的脚本:

$fullPath = <<Installer location>>
$vscApp = "VSCodeSetup-x64-1.56.2"
$appPath = join-path $fullPath $vscApp
Write-Host "App Path" $appPath
$arguments = '/SILENT /ALLUSERS /mergetasks="!runcode,????, ????, ???? ,????"'
Start-Process $appPath $arguments -Verb RunAs -Wait

I need the list of internal names for all of the check box items on the "Select Additional Tasks" Select Additional Tasks GUI Screenshot我需要“选择附加任务” Select 附加任务 GUI 屏幕截图上所有复选框项目的内部名称列表

I want to turn on all four other tasks, both Add Open, Register code, and Add to Path.我想打开所有其他四个任务,包括添加打开、注册代码和添加到路径。 Only 1 of which seems to be default.其中只有 1 个似乎是默认的。 While I do not need the desktop icon, from the Inno Setup docs, https://jrsoftware.org/ishelp/index.php?topic=setupcmdline , I can see the desktop Icon name is desktopicon .虽然我不需要桌面图标,但从 Inno Setup 文档https://jrsoftware.org/ishelp/index.php?topic=setupcmdline中,我可以看到桌面图标名称是desktopicon How and where would I find this list?我如何以及在哪里可以找到这份清单?

Thanks for any and all help!感谢您的任何帮助!

Continuing from my comment.继续我的评论。 There are several pre-built scripts, in several GitHub Repos for silent installs:有几个预构建的脚本,在几个 GitHub 存储库中用于静默安装:

Example: 例子:

#Install-VSCode

# Download URL, you may need to update this if it changes
$downloadUrl = "https://go.microsoft.com/fwlink/?LinkID=623230"

# What to name the file and where to put it
$installerFile = "vscode-install.exe"
$installerPath = (Join-Path $env:TEMP $installerFile)

# Install Options
# Reference:
# http://stackoverflow.com/questions/42582230/how-to-install-visual-studio-code-silently-without-auto-open-when-installation
# http://www.jrsoftware.org/ishelp/
# I'm using /silent, use /verysilent for no UI

# Install with the context menu, file association, and add to path options (and don't run code after install: 
$installerArguments = "/silent /mergetasks='!runcode,addcontextmenufiles,addcontextmenufolders,associatewithfiles,addtopath'"

#Install with default options, and don't run code after install.
#$installerArguments = "/silent /mergetasks='!runcode'"

Write-Verbose "Downloading $installerFile..."
Invoke-Webrequest $downloadUrl -UseBasicParsing -OutFile $installerPath

Write-Verbose "Installing $installerPath..."
Start-Process $installerPath -ArgumentList $installerArguments -Wait

Write-Verbose "Cleanup the downloaded file."
Remove-Item $installerPath -Force

You can also automate installing VSCode extensions.您还可以自动安装 VSCode 扩展。

Example: 例子:

Visual Studio Code: Getting Started with PowerShell https://social.technet.microsoft.com/wiki/contents/articles/35780.visual-studio-code-getting-started-with-powershell.aspx Visual Studio 代码:PowerShell https://social.technet.microsoft.com/wiki/contents/articles/35780.visual-studio-code-getting-started-with-powershell.aspx 入门

code --install-extension ms-vscode.powershell

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

相关问题 Visual Studio Code 终端在 Powershell 中继续运行 Python 脚本 - Visual Studio Code Terminal keeps running Python script in Powershell 在脚本文件夹中打开Visual Studio Code Powershell终端 - Open Visual Studio Code Powershell Terminal in script folder 如何在 Visual Studio Code 中以 noprofile 的形式启动 Powershell 脚本 - How can I start Powershell script as noprofile in Visual Studio Code Powershell / Visual Studio Code:Visual Studio Code 中 Powershell 的更新版本 - Powershell / Visual Studio Code: Update version of Powershell in Visual Studio Code Visual Studio 代码:Powershell 新手 - Visual Studio Code: Powershell Greenhorn SSIS执行过程任务在Visual Studio中执行Powershell脚本,但在部署时不执行 - SSIS Execute Process Task executes Powershell script in Visual Studio but not when deployed 通过 Visual Studio 使用 CMake 运行 powershell 脚本而不更改系统范围的权限 - Running powershell script with CMake through Visual Studio without changing system-wide permissions Powershell MSI安装程序脚本 - Powershell MSI installer script Windows Task Scheduler Powershell脚本完成并重新启动 - Windows Task Scheduler Powershell Script complete and restart PowerShell内联任务的Visual Studio生成任务问题-Azure - Visual studio Build Task Issue for PowerShell inline task - Azure
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM