From f90b2fef07faa67e662cad52c856ed7b53f18372 Mon Sep 17 00:00:00 2001 From: Dhruv Chand Date: Tue, 26 Jul 2022 12:15:08 -0700 Subject: [PATCH] choco installs packages from config file --- images/VS2022Box/build.pkr.hcl | 9 ++++++--- images/VS2022Box/packages/packages.config | 5 +++++ images/VSCodeBox/build.pkr.hcl | 9 ++++++--- images/VSCodeBox/packages/packages.config | 5 +++++ 4 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 images/VS2022Box/packages/packages.config create mode 100644 images/VSCodeBox/packages/packages.config diff --git a/images/VS2022Box/build.pkr.hcl b/images/VS2022Box/build.pkr.hcl index cf479a59..3ac420bb 100644 --- a/images/VS2022Box/build.pkr.hcl +++ b/images/VS2022Box/build.pkr.hcl @@ -75,13 +75,16 @@ build { ] } + provisioner "file" { + source = "./packages/packages.config" + destination = "C:/Windows/Temp/packages.config" + } + provisioner "powershell" { elevated_user = build.User elevated_password = build.Password inline = [ - "choco install postman --yes --no-progress", - "choco install googlechrome --yes --no-progress", - "choco install firefox --yes --no-progress" + "choco install C:/Windows/Temp/packages.config --yes --no-progress" ] } diff --git a/images/VS2022Box/packages/packages.config b/images/VS2022Box/packages/packages.config new file mode 100644 index 00000000..185168b8 --- /dev/null +++ b/images/VS2022Box/packages/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/images/VSCodeBox/build.pkr.hcl b/images/VSCodeBox/build.pkr.hcl index e6d88c75..f36ad2c2 100644 --- a/images/VSCodeBox/build.pkr.hcl +++ b/images/VSCodeBox/build.pkr.hcl @@ -75,13 +75,16 @@ build { ] } + provisioner "file" { + source = "./packages/packages.config" + destination = "C:/Windows/Temp/packages.config" + } + provisioner "powershell" { elevated_user = build.User elevated_password = build.Password inline = [ - "choco install postman --yes --no-progress", - "choco install googlechrome --yes --no-progress", - "choco install firefox --yes --no-progress" + "choco install C:/Windows/Temp/packages.config --yes --no-progress" ] } diff --git a/images/VSCodeBox/packages/packages.config b/images/VSCodeBox/packages/packages.config new file mode 100644 index 00000000..185168b8 --- /dev/null +++ b/images/VSCodeBox/packages/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file