-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathadd_storage_explorer.ps1
31 lines (24 loc) · 1.32 KB
/
add_storage_explorer.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
function Write-Log {
param (
$message
)
$formattedTime = (Get-Date).ToString("yyyy-MM-dd HH:mm:ss")
Write-Host "$formattedTime init_vm: $message"
}
$BUILD_DIRECTORY="C:\BuildArtifacts"
$INSTALL_DIRECTORY="C:\Software"
Set-Location -Path $BUILD_DIRECTORY
# Azure Storage Explorer
$StorageExplorer_INSTALLER_FILE="StorageExplorer.exe"
# $StorageExplorer_DOWNLOAD_URL="https://go.microsoft.com/fwlink/?LinkId=708343&clcid=0x809"
$StorageExplorer_DOWNLOAD_URL="https://go.microsoft.com/fwlink/?linkid=2216182"
$StorageExplorer_INSTALL_PATH="$INSTALL_DIRECTORY\StorageExplorer"
$StorageExplorer_INSTALL_ARGS="/VERYSILENT /NORESTART /ALLUSERS /DIR=$StorageExplorer_INSTALL_PATH"
Write-Log "Downloading Azure Storage Explorer installer..."
Invoke-WebRequest -Uri $StorageExplorer_DOWNLOAD_URL -UseBasicParsing -OutFile "$BUILD_DIRECTORY\$StorageExplorer_INSTALLER_FILE"
Write-Log "Installing Azure Storage Explorer..."
Start-Process $StorageExplorer_INSTALLER_FILE -ArgumentList $StorageExplorer_INSTALL_ARGS -Wait
Write-Log "Add Storage Explorer Desktop Shortcut"
$ALL_USER_DESKTOP=[Environment]::GetFolderPath('CommonDesktopDirectory')
New-Item -ItemType SymbolicLink -Path "$ALL_USER_DESKTOP\Storage Explorer.lnk" -Target "$StorageExplorer_INSTALL_PATH\StorageExplorer.exe"
Write-Log "add_storage_explorer script completed"