Created
April 26, 2020 22:25
-
-
Save davecra/f5f39f8af36c96226265aa42f2e7a0d0 to your computer and use it in GitHub Desktop.
Microsoft Office Development Environment Setup Script Gist - https://github.com/davecra/modes
This file contains hidden or 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
Add-Type -assembly "system.io.compression.filesystem";$vscode_url = "https://aka.ms/win32-x64-user-stable";$vscode_output = $env:USERPROFILE + "\downloads\vscode.exe";$node_url = "https://nodejs.org/dist/latest/win-x64/node.exe";$node_output = $env:USERPROFILE + "\downloads\node.exe";$node_install_path = $env:USERPROFILE + "\node";$npm_url = "https://nodejs.org/dist/npm/npm-1.4.9.zip";$npm_output = $env:USERPROFILE + "\downloads\npm.zip" | |
Invoke-WebRequest -Uri $vscode_url -OutFile $vscode_output | |
Invoke-WebRequest -Uri $node_url -OutFile $node_output | |
Invoke-WebRequest -Uri $npm_url -OutFile $npm_output | |
Start-Process -FilePath $vscode_output -ArgumentList ('/VERYSILENT', '/MERGETASKS=!runcode') -Wait | |
md $node_install_path | |
copy $node_output $node_install_path | |
[io.compression.zipfile]::ExtractToDirectory($npm_output, $node_install_path) | |
[Environment]::SetEnvironmentVariable("Path", [Environment]::GetEnvironmentVariable("Path", [EnvironmentVariableTarget]::User) + ";" + $node_install_path, [EnvironmentVariableTarget]::User) | |
$env:Path += ";" + $node_install_path | |
cd $node_install_path | |
Start-Process -FilePath npm -ArgumentList ('install', '-g', 'npm') -WindowStyle Hidden -Wait | |
Start-Process -FilePath npm -ArgumentList('install', '-g', 'yo', 'generator-office') -WindowStyle Hidden -Wait | |
Start-Process -FilePath npm -ArgumentList('install', '-g', 'http-server') -WindowStyle Hidden -Wait | |
$yo_file = $node_install_path + "\yo.ps1" | |
ren $yo_file "yo.ps1.old" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment