-
Notifications
You must be signed in to change notification settings - Fork 29.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tools,win: refactor install_tools.bat
* Ask for credentials upfront * Try to `-DisableReboots`
- Loading branch information
Showing
2 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
try | ||
{ | ||
$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent; | ||
|
||
# Ask for an opaque user credentials token | ||
$cred = Get-Credential $( whoami ) -Message "The Node.js installer needs your credentials to streamline the installation of the Build Tools"; | ||
if (!($cred)) { | ||
# Wait for user confirmation. | ||
Echo 'The installer will now exit.'; | ||
Read-Host 'Press ENTER to finish'; | ||
exit 1; | ||
} | ||
# The following line is lifted verbatim from https://boxstarter.org/InstallBoxstarter | ||
iex ((New-Object System.Net.WebClient).DownloadString('https://boxstarter.org/bootstrapper.ps1')); get-boxstarter -Force; | ||
|
||
# Install the packges from `install_tools.txt` | ||
Install-BoxstarterPackage -PackageName ($PSScriptRoot+'\install_tools.txt') -Credential $cred -DisableReboots; | ||
|
||
# Wait for user confirmation. | ||
Read-Host 'Press ENTER to finish'; | ||
} catch { | ||
exit 1; | ||
} |