Skip to content

Instantly share code, notes, and snippets.

@wsmelton
Created January 15, 2019 19:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wsmelton/683340e4a68cdcad409dd5ab7c77f547 to your computer and use it in GitHub Desktop.
Save wsmelton/683340e4a68cdcad409dd5ab7c77f547 to your computer and use it in GitHub Desktop.
Download from PowerShell Gallery via API
$package = 'https://powershellgallery.com/api/v2/package/dbatools'
$zipPath = 'C:\temp\dbatools.zip'
(New-Object System.Net.WebClient).DownloadFile($package, $zipPath)
$extractPath = 'C:\temp\modules\'
[io.compression.zipfile]::ExtractToDirectory($zipPath, $extractPath)
# verify
ipmo "$extractPath\dbatools.psd1"
Get-Module dbatools
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment