Skip to content

Instantly share code, notes, and snippets.

@jsakamoto
Last active December 27, 2015 18:19
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 jsakamoto/7369469 to your computer and use it in GitHub Desktop.
Save jsakamoto/7369469 to your computer and use it in GitHub Desktop.
@powershell -nop -ex unrestricted -c "iex ((new-object net.webclient).DownloadString('http://goo.gl/2JUSZU'))"
function Download-File {
param (
[string]$url,
[string]$file
)
Write-Host "Downloading $url to $file"
$downloader = new-object System.Net.WebClient
$downloader.DownloadFile($url, $file)
}
function Expand-ZipFile {
param (
[string]$file,
[string]$destination
)
$shell = New-Object -ComObject shell.application
$zip = $shell.NameSpace($file)
foreach($item in $zip.items())
{
$shell.Namespace($destination).copyhere($item)
}
}
$tagname = "1.0"
$zipname = "markdown-presenter-$tagname.zip"
$zippath = Join-Path (pwd).Path $zipname
Download-File -url "https://github.com/jsakamoto/MarkdownPresenter/releases/download/v.$tagname/$zipname" -file $zippath
Expand-ZipFile -file $zippath -destination (pwd).Path
sleep -Seconds 1
del $zippath
.\start-presenter-for-windows.bat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment