Last active
April 4, 2022 19:31
-
-
Save dburriss/b4075863873b5871d34e32ab1ae42baa to your computer and use it in GitHub Desktop.
A Powershell script to install Paket dependency manager in current folder (sub-folder .paket)
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
New-Item -ItemType directory -Path ".paket" | |
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 | |
$tag = (Invoke-WebRequest -Uri https://api.github.com/repos/fsprojects/Paket/releases | ConvertFrom-Json)[0].tag_name | |
$uri = " https://github.com/fsprojects/Paket/releases/download/" + $tag + "/paket.bootstrapper.exe" | |
Invoke-WebRequest $uri -OutFile .paket/paket.exe |
Task for Visual Studio Code
{
"version": "2.0.0",
"tasks": [
{
"label": "paket_setup",
"type": "shell",
"command": "powershell",
"args": [
"-NoProfile",
"-ExecutionPolicy",
"Bypass",
"-Command",
"iex (Invoke-WebRequest 'https://gist.githubusercontent.com/dburriss/b4075863873b5871d34e32ab1ae42baa/raw/b09c0b3735ef2392dcb3b1be5df0ca109b70d24e/Install-Paket.ps1')"
]
}
]
}
You could install via the dotnet tool
{
"version": "2.0.0",
"tasks": [
{
"label": "paket_setup",
"type": "shell",
"command": "dotnet",
"args": [
"tool",
"install",
"--tool-path",
".paket",
"Paket",
"--add-source", "https://api.nuget.org/v3/index.json"
]
}
]
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can run the above with a single command
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "iex (Invoke-WebRequest 'https://gist.githubusercontent.com/dburriss/b4075863873b5871d34e32ab1ae42baa/raw/b09c0b3735ef2392dcb3b1be5df0ca109b70d24e/Install-Paket.ps1')"