Skip to content

Instantly share code, notes, and snippets.

@tanfwc
Created June 3, 2023 12:52
Show Gist options
  • Save tanfwc/a905633d947ac004b94788673dc819df to your computer and use it in GitHub Desktop.
Save tanfwc/a905633d947ac004b94788673dc819df to your computer and use it in GitHub Desktop.
<#Author : Tan Fang Wai
# Usage : Install and setup Bloomberg
#>
######################
# WVD Variables #
######################
$LocalTempDir = "c:\temp\bloomberg\";
####################################
# Test/Create Temp Directory #
####################################
if((Test-Path c:\temp) -eq $false) {
Write-Host "Install Bloomberg : Creating temp directory"
New-Item -Path c:\temp -ItemType Directory
}
else {
Write-Host "Install Bloomberg : C:\temp already exists"
}
if((Test-Path $LocalTempDir) -eq $false) {
Write-Host "Install Bloomberg : Creating directory: $LocalTempDir"
New-Item -Path $LocalTempDir -ItemType Directory
}
else {
Write-Host "Install Bloomberg : $LocalWVDpath already exists"
}
####################################
# Download Bloomberg #
####################################
Write-Host "Install Bloomberg : Downloading Bloomberg"
$uri = "https://bdn-ak-ssl.bloomberg.com/software/trv/sotr117_3_80.exe"
$path = "$LocalTempDir\sotr117_3_80.exe"
Invoke-WebRequest -Uri $uri -OutFile $path
####################################
# Install Bloomberg #
####################################
Write-Host "Install Bloomberg : Starting to install Bloomberg"
$bloomberg_deploy_status = Start-Process `
-FilePath "$LocalTempDir\sotr117_3_80.exe" `
-ArgumentList "/s" `
-Wait `
-Passthru
#Cleanup
if ((Test-Path -Path $LocalTempDir -ErrorAction SilentlyContinue)) {
Write-Host "Install Bloomberg : Temporary directory removed"
Remove-Item -Path $LocalTempDir -Force -Recurse -ErrorAction Continue
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment