From 6fa14b24fc841e18211bdfb80ee525c6808991c0 Mon Sep 17 00:00:00 2001 From: Jianhong Yin Date: Sun, 3 Sep 2023 15:41:56 +0800 Subject: [PATCH] AnswerFileTemplates/base: add Function Install-NuGet Signed-off-by: Jianhong Yin --- AnswerFileTemplates/base/postinstall.ps1.in | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/AnswerFileTemplates/base/postinstall.ps1.in b/AnswerFileTemplates/base/postinstall.ps1.in index 6bb677b5..47075942 100644 --- a/AnswerFileTemplates/base/postinstall.ps1.in +++ b/AnswerFileTemplates/base/postinstall.ps1.in @@ -31,6 +31,16 @@ Function Sync-Time { } } +Function Install-NuGet { + param([string]$curl = "https://dist.nuget.org/win-x86-commandline/v3.3.0/nuget.exe") + $progPath='C:\Program Files' + $target = "$progPath\nuget.exe" + + echo "[info] download $curl to $target ..." + Invoke-WebRequest $curl -OutFile $target + Set-Alias nuget $target -Scope Global -Verbose +} + Function virtio-win-install() { param([string]$AnsfDrvLetter) $msifile, $exefile, $drvDir = "", "", ""