-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-configuration.dsc.yaml
109 lines (101 loc) · 4.23 KB
/
azure-configuration.dsc.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2
##########################################################################################################
# This configuration will install the tools necessary to get started developing in azure #
# NOTE: Run: winget configure .\azure-configuration.dsc.yaml --accept-configuration-agreements #
##########################################################################################################
properties:
configurationVersion: 0.2.0
resources:
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: AzureCLI
directives:
description: Install Azure CLI
allowPrerelease: true
settings:
id: Microsoft.AzureCLI
source: winget
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: AzureCosmosDbEmulator
directives:
description: Install Azure Cosmos DB Emulator
allowPrerelease: true
settings:
id: Microsoft.Azure.CosmosEmulator
source: winget
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: AzureDeveloperCLI
directives:
description: Install Azure Developer CLI
allowPrerelease: true
settings:
id: microsoft.azd
source: winget
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: AzureFunctionsCoreTools
directives:
description: Install Azure Functions CoreTools
allowPrerelease: true
settings:
id: Microsoft.Azure.FunctionsCoreTools
source: winget
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: AzureStorageExplorer
directives:
description: Install Azure Storage Explorer
allowPrerelease: true
settings:
id: Microsoft.Azure.StorageExplorer
source: winget
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: BicepCLI
directives:
description: Install Bicep CLI
allowPrerelease: true
settings:
id: Microsoft.Bicep
source: winget
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: VisualStudioCode
directives:
description: Install Visual Studio Code
allowPrerelease: true
settings:
id: Microsoft.VisualStudioCode
source: winget
- resource: PSDscResources/Script
id: VisualStudioCode Extensions
directives:
description: Script to install Visual Studio Code extensions
allowPrerelease: true
settings:
GetScript: |
# Not using this at the moment.
TestScript: |
# Ignore deprecation warnings & reload path
$env:NODE_OPTIONS="--no-deprecation"
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
# Load required extensions from JSON file
$jsonContent = Get-Content '${WinGetConfigRoot}\azure-configuration-vscode-extensions.json' -Raw
$extensions = (ConvertFrom-Json $jsonContent).extensions
# Get the list of currently installed extensions
$installedExtensions = code --list-extensions
# Check if all required extensions are installed
$allInstalled = $extensions.name | ForEach-Object { $_ -in $installedExtensions }
return $allInstalled -contains $false -eq $false
SetScript: |
# Ignore deprecation warnings & reload path
$env:NODE_OPTIONS="--no-deprecation"
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
# Load required extensions from JSON file
$jsonContent = Get-Content '${WinGetConfigRoot}\azure-configuration-vscode-extensions.json' -Raw
$extensions = (ConvertFrom-Json $jsonContent).extensions
# Get the list of currently installed extensions
$installedExtensions = code --list-extensions
# Install each extension if not already installed
foreach ($extension in $extensions) {
if ($installedExtensions -notcontains $extension.name) {
code --install-extension $extension.name
}
}
dependsOn:
- VisualStudioCode