Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Microsoft Office Development Environment Setup Script Gist - https://github.com/davecra/modes
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
You can’t perform that action at this time.