Last active
May 24, 2022 13:25
-
-
Save t1m0thyj/22ecee3265b8bd20ec1e20b80d3d0941 to your computer and use it in GitHub Desktop.
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
# Usage: test-zowe.ps1 ../Brightside-v3.0.0 16 -Offline | |
param ([string]$packageDir, [string]$nodeVersion, [switch]$offline = $false) | |
$ErrorActionPreference = "Stop" | |
# Install Node.js and npm | |
$response = Invoke-WebRequest https://nodejs.org/download/release/latest-v$nodeVersion.x -UseBasicParsing | |
$x64Msi = $response.Links |? { $_.href -Match "-x64.msi" } | |
(New-Object Net.WebClient).DownloadFile("https://nodejs.org/download/release/latest-v$nodeVersion.x/$($x64Msi.href)", "$env:Temp\node.msi") | |
msiexec /I $env:Temp\node.msi /passive | Out-Null | |
$env:Path = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User") | |
# Download prerequisites for DB2 and SCS | |
if ($offline) { | |
(New-Object Net.WebClient).DownloadFile("https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/ntx64_odbc_cli.zip", "$env:Temp\ntx64_odbc_cli.zip") | |
$env:IBM_DB_INSTALLER_URL = $env:Temp | |
} else { | |
Remove-Item Env:\IBM_DB_INSTALLER_URL -ErrorAction Ignore | |
} | |
# TODO Temporary hack, remove once NPM bug is fixed | |
if ($nodeVersion -Eq "16") { | |
npm install -g prebuild-install | |
} | |
# Install Zowe CLI and plug-ins | |
Push-Location $packageDir | |
if ($offline) { Disable-NetAdapter -Name "Ethernet" -Confirm:$false } | |
try { | |
npm install -g zowe-cli.tgz | |
$plugins = $(Get-ChildItem *-for-zowe-cli.tgz -Name) | |
zowe plugins install @plugins | |
} finally { | |
Pop-Location | |
if ($offline) { Enable-NetAdapter -Name "Ethernet" -Confirm:$false } | |
} | |
# Verify versions of installed components | |
node --version | |
npm --version | |
zowe --version | |
zowe plugins list --short |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment