![](/img/trans.png)
[英]Visual Studio Code Terminal keeps running Python script in Powershell
[英]TASK Names for Visual Studio Code for Windows System Installer script in Powershell
寻找有关编写 PowerShell 脚本以安装 Visual Studio Code 的帮助。 我已经下载了 Windows 64 位系统安装程序:VSCodeSetup-x64-1.56.2
到目前为止我的脚本:
$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
我需要“选择附加任务” Select 附加任务 GUI 屏幕截图上所有复选框项目的内部名称列表
我想打开所有其他四个任务,包括添加打开、注册代码和添加到路径。 其中只有 1 个似乎是默认的。 虽然我不需要桌面图标,但从 Inno Setup 文档https://jrsoftware.org/ishelp/index.php?topic=setupcmdline中,我可以看到桌面图标名称是desktopicon
。 我如何以及在哪里可以找到这份清单?
感谢您的任何帮助!
继续我的评论。 有几个预构建的脚本,在几个 GitHub 存储库中用于静默安装:
#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
您还可以自动安装 VSCode 扩展。
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.