Skip to content

Instantly share code, notes, and snippets.

@drmohundro
Created May 26, 2020 22:10
Show Gist options
  • Save drmohundro/8727c9bb70f749a7e31e41740f29f58f to your computer and use it in GitHub Desktop.
Save drmohundro/8727c9bb70f749a7e31e41740f29f58f to your computer and use it in GitHub Desktop.
Get sqlcmd.exe in Azure Pipelines
$ErrorActionPreference = 'Stop';
Invoke-WebRequest 'https://vstsagenttools.blob.core.windows.net/tools/SQLCMD/11.0/SQLCMD.zip' -OutFile sqlcmd.zip
try {
Add-Type -AssemblyName System.IO.Compression.FileSystem
} catch { };
[System.IO.Compression.ZipFile]::ExtractToDirectory('./sqlcmd.zip', './')
$env:PATH += ";$(Resolve-Path ./SQLCMD)";
# sqlcmd.exe will now be in your PATH
@drmohundro
Copy link
Author

drmohundro commented May 26, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment