diff --git a/Devbox/devbox.yaml b/DevBoxConfig1/Devbox/devbox.yaml similarity index 61% rename from Devbox/devbox.yaml rename to DevBoxConfig1/Devbox/devbox.yaml index b987f01..b651aaa 100644 --- a/Devbox/devbox.yaml +++ b/DevBoxConfig1/Devbox/devbox.yaml @@ -1,9 +1,14 @@ -name: sample +name: powershell-customization-test image: microsoftwindowsdesktop_windows-ent-cpc_win11-22h2-ent-cpc-m365@1.0.0 hostInformation: general_a_8c32gb256ssd_v1 supportsHibernation: false setupTasks: - - task: write-to-file + - task: powershell + inputs: + script: echo "Testing Powershell Task" >> C:\\powershell-test.txt + - task: powershell + inputs: + script: calc - task: install-by-uri inputs: uri: 'https://community.chocolatey.org/install.ps1' diff --git a/InstallByUri/install-by-uri.ps1 b/DevBoxConfig1/InstallByUri/install-by-uri.ps1 similarity index 100% rename from InstallByUri/install-by-uri.ps1 rename to DevBoxConfig1/InstallByUri/install-by-uri.ps1 diff --git a/InstallByUri/task.yaml b/DevBoxConfig1/InstallByUri/task.yaml similarity index 100% rename from InstallByUri/task.yaml rename to DevBoxConfig1/InstallByUri/task.yaml diff --git a/InstallPackages/choco.ps1 b/DevBoxConfig1/InstallPackages/choco.ps1 similarity index 93% rename from InstallPackages/choco.ps1 rename to DevBoxConfig1/InstallPackages/choco.ps1 index bd26ae8..b69217d 100644 --- a/InstallPackages/choco.ps1 +++ b/DevBoxConfig1/InstallPackages/choco.ps1 @@ -1,6 +1,6 @@ -param( - [Parameter()] - [string]$Package - ) - +param( + [Parameter()] + [string]$Package + ) + choco install $Package -y \ No newline at end of file diff --git a/InstallPackages/task.yaml b/DevBoxConfig1/InstallPackages/task.yaml similarity index 95% rename from InstallPackages/task.yaml rename to DevBoxConfig1/InstallPackages/task.yaml index bde05cf..317f167 100644 --- a/InstallPackages/task.yaml +++ b/DevBoxConfig1/InstallPackages/task.yaml @@ -1,7 +1,7 @@ -name: choco -command: "./choco.ps1 -Package parameters('package')" -inputs: - package: - type: "string" - defaultValue: "" +name: choco +command: "./choco.ps1 -Package parameters('package')" +inputs: + package: + type: "string" + defaultValue: "" required: true \ No newline at end of file diff --git a/DevBoxConfig1/Powershell/Powershell.ps1 b/DevBoxConfig1/Powershell/Powershell.ps1 new file mode 100644 index 0000000..e94a7e4 --- /dev/null +++ b/DevBoxConfig1/Powershell/Powershell.ps1 @@ -0,0 +1,6 @@ +param( + [Parameter()] + [string]$powershell + ) + + $powershell diff --git a/DevBoxConfig1/Powershell/task.yaml b/DevBoxConfig1/Powershell/task.yaml new file mode 100644 index 0000000..908acd3 --- /dev/null +++ b/DevBoxConfig1/Powershell/task.yaml @@ -0,0 +1,7 @@ +name: powershell +command: "powershell {{script}}" +inputs: + script: + type: string + defaultValue: "" + required: true diff --git a/TestWriteToFile/task.yaml b/DevBoxConfig1/TestWriteToFile/task.yaml similarity index 100% rename from TestWriteToFile/task.yaml rename to DevBoxConfig1/TestWriteToFile/task.yaml diff --git a/TestWriteToFile/write-to-file.ps1 b/DevBoxConfig1/TestWriteToFile/write-to-file.ps1 similarity index 100% rename from TestWriteToFile/write-to-file.ps1 rename to DevBoxConfig1/TestWriteToFile/write-to-file.ps1 diff --git a/DevBoxTestConfig/DevBox/devbox.yaml b/DevBoxTestConfig/DevBox/devbox.yaml new file mode 100644 index 0000000..d032d1c --- /dev/null +++ b/DevBoxTestConfig/DevBox/devbox.yaml @@ -0,0 +1,13 @@ +name: devbox-customization +image: microsoftvisualstudio_visualstudioplustools_vs-2022-ent-general-win11-m365-gen2@1.0.0 +hostInformation: general_a_8c32gb256ssd_v1 +supportsHibernation: false +setupTasks: + - task: choco + inputs: + packages: git.install, nodejs + - task: write-text + inputs: + boolParam: false + stringParam: hello devbox + arrayParam: 1, 2, 3 diff --git a/DevBoxTestConfig/InstallChocolatey/install-chocolatey.ps1 b/DevBoxTestConfig/InstallChocolatey/install-chocolatey.ps1 new file mode 100644 index 0000000..ab74106 --- /dev/null +++ b/DevBoxTestConfig/InstallChocolatey/install-chocolatey.ps1 @@ -0,0 +1 @@ +Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) diff --git a/DevBoxTestConfig/InstallChocolatey/task.yaml b/DevBoxTestConfig/InstallChocolatey/task.yaml new file mode 100644 index 0000000..2dc80d3 --- /dev/null +++ b/DevBoxTestConfig/InstallChocolatey/task.yaml @@ -0,0 +1,2 @@ +name: install-chocolatey +command: "./install-chocolatey.ps1" \ No newline at end of file diff --git a/DevBoxTestConfig/WriteText/Write-Text.ps1 b/DevBoxTestConfig/WriteText/Write-Text.ps1 new file mode 100644 index 0000000..31749d8 --- /dev/null +++ b/DevBoxTestConfig/WriteText/Write-Text.ps1 @@ -0,0 +1,18 @@ +param( + [Parameter()] + [double]$DoubleParam, + + [Parameter()] + [string]$StringParam, + + [Parameter()] + [bool]$BoolParam, + + [Parameter()] + [array]$ArrayParam +) + +Write-Output "DoubleParam value is $DoubleParam" +Write-Output "StringParam value is $StringParam" +Write-Output "BoolParam value is $BoolParam" +Write-Output "ArrayParam value is $ArrayParam" \ No newline at end of file diff --git a/DevBoxTestConfig/WriteText/task.yaml b/DevBoxTestConfig/WriteText/task.yaml new file mode 100644 index 0000000..b16619b --- /dev/null +++ b/DevBoxTestConfig/WriteText/task.yaml @@ -0,0 +1,23 @@ +name: write-text +command: .\Write-Text.ps1 -DoubleParam parameters('doubleParam') -BoolParam parameters('boolParam') -StringParam parameters('stringParam') -ArrayParam parameters('arrayParam') > C:\\result.txt +inputs: + stringParam: + type: string + defaultValue: some value + required: false + boolParam: + type: bool + defaultValue: $True + required: false + intParam: + type: int + defaultValue: 33 + required: false + doubleParam: + type: double + defaultValue: 33.12 + required: false + arrayParam: + type: array + defaultValue: 2, 3, 4 + required: false \ No newline at end of file diff --git a/DevBoxTestConfig/choco/choco.ps1 b/DevBoxTestConfig/choco/choco.ps1 new file mode 100644 index 0000000..b69217d --- /dev/null +++ b/DevBoxTestConfig/choco/choco.ps1 @@ -0,0 +1,6 @@ +param( + [Parameter()] + [string]$Package + ) + +choco install $Package -y \ No newline at end of file diff --git a/DevBoxTestConfig/choco/task.yaml b/DevBoxTestConfig/choco/task.yaml new file mode 100644 index 0000000..70d84d3 --- /dev/null +++ b/DevBoxTestConfig/choco/task.yaml @@ -0,0 +1,7 @@ +name: choco +command: "./choco.ps1 -Package parameters('package')" +inputs: + package: + defaultValue: "" + type: "string" + required: true \ No newline at end of file diff --git a/Powershell/task.yaml b/Powershell/task.yaml deleted file mode 100644 index 51d48b3..0000000 --- a/Powershell/task.yaml +++ /dev/null @@ -1,7 +0,0 @@ -name: powershell -command: "parameters('powershellInput')" -inputs: - powershellInput: - type: string - defaultValue: "" - required: true \ No newline at end of file diff --git a/TestWriteToFile/testfolder/task.yaml b/TestWriteToFile/testfolder/task.yaml deleted file mode 100644 index f65e566..0000000 --- a/TestWriteToFile/testfolder/task.yaml +++ /dev/null @@ -1,2 +0,0 @@ -name: test-folder-inside -command: "./test.ps1" \ No newline at end of file diff --git a/TestWriteToFile/testfolder/test.ps1 b/TestWriteToFile/testfolder/test.ps1 deleted file mode 100644 index da12eec..0000000 --- a/TestWriteToFile/testfolder/test.ps1 +++ /dev/null @@ -1 +0,0 @@ -echo "sometest" >> C:\\test.txt