Benign powershell Download

install.ps1

Invokes PowerShell HTTP request cmdletInvokes PowerShell REST request cmdlet
SHA-2566d6eaa07bb9863fb629a05d6fe8577df81cad8863da94a0c84aa7a4dea3bd29e

Evidence

Comment line documents piped eval lines 1–26
1# Paysio CLI installer for Windows.
2#
3# irm https://paysio.com/install.ps1 | iex
4#
5# Downloads a standalone binary (no Node required). Set PAYSIO_INSTALL_DIR to
6# choose where it lands, or PAYSIO_VERSION to pin a version.
7
8$ErrorActionPreference = 'Stop'
9
10$cdn = if ($env:PAYSIO_CDN) { $env:PAYSIO_CDN } else { 'https://cdn.paysio.com/cli' }
11$installDir = if ($env:PAYSIO_INSTALL_DIR) { $env:PAYSIO_INSTALL_DIR } else { Join-Path $env:USERPROFILE '.paysio\bin' }
12
13if ([System.Environment]::Is64BitOperatingSystem -eq $false) {
14 Write-Error 'Paysio CLI requires 64-bit Windows. Install with npm instead: npm install -g paysio'
15 exit 1
16}
17
18$asset = 'paysio-windows-x64.exe'
19
20# Resolve the version to install.
21#
22# We deliberately ask the npm registry rather than downloading the CDN's
23# "latest" folder. Version folders are immutable, so the CDN can cache them
24# forever and always be right; "latest" is mutable, and a CDN edge that cached
25# the previous release keeps handing out the old binary until its TTL expires.
26# That ac …
Invokes PowerShell REST request cmdlet lines 28–42
28:70… a cache.
29$version = $env:PAYSIO_VERSION
30if (-not $version) {
31 Write-Host 'Resolving the latest version...' -ForegroundColor DarkGray
32 try {
33 $version = (Invoke-RestMethod -Uri 'https://registry.npmjs.org/paysio/latest' -UseBasicParsing -TimeoutSec 15).version
34 } catch {
35 $version = $null
⋯7 lines
Invokes PowerShell HTTP request cmdlet lines 42–65
42:76… hich
43 # is right except in the window right after a release.
44 Write-Host 'Could not reach the npm registry; falling back to the latest folder.' -ForegroundColor DarkGray
45 $version = 'latest'
46 $url = "$cdn/latest/$asset"
47}
48
49$target = Join-Path $installDir 'paysio.exe'
50
51Write-Host "Downloading $asset ($version)..." -ForegroundColor DarkGray
52New-Item -ItemType Directory -Force -Path $installDir | Out-Null
53
54try {
55 Invoke-WebRequest -Uri $url -OutFile $target -UseBasicParsing
56} catch {
57 Write-Error "Download failed: $url`nInstall with npm instead: npm install -g paysio"
58 exit 1
59}
60
61Write-Host "Installed paysio $version to $target" -ForegroundColor Green
62
63$userPath = [Environment]::GetEnvironmentVariable('Path', 'User')
64if ($userPath -notlike "*$installDir*") {
65 [Environment]::SetEnvironmentVariable('Path', "$userPath;$installDi …
PowerShell writes colored terminal output lines 67–71
67:23… to your PATH. Open a new terminal to use it.'
68}
69
70Write-Host ''
71Write-Host 'Next: paysio login' -ForegroundColor DarkGray

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.