File tree Expand file tree Collapse file tree 4 files changed +52
-0
lines changed
Expand file tree Collapse file tree 4 files changed +52
-0
lines changed Original file line number Diff line number Diff line change 1+ # Desired State Configuration 3.0
2+
3+ - [ ExtensionManifestV2Availability.dsc] ( https://developer.chrome.com/docs/extensions/develop/migrate/mv2-deprecation-timeline ) - enable support for chrome extensions V2
Original file line number Diff line number Diff line change 1+ $validation = dsc config test -f .\validate.dsc.yml - o json | ConvertFrom-Json
2+ foreach ($r in $validation.results ) {
3+ if ($r.result.inDesiredState -eq $false ) {
4+ throw " [FAIL] $ ( $r.name ) [$ ( $r.type ) ]"
5+ }
6+ }
7+
8+ Get-ChildItem .\steps - Filter ' *.dsc.yml' - Recurse | ForEach-Object {
9+ $step = $_.FullName
10+ Write-Host " [INFO] Running step: $step " - ForegroundColor DarkGray
11+ $test = dsc config test -f $step - o json | ConvertFrom-Json
12+ $test.results | % {
13+ if ($_.result.inDesiredState -eq $true ) {
14+ Write-Host " [OK] $ ( $_.name ) [$ ( $_.type ) ]" - ForegroundColor Green
15+ }
16+ else {
17+ Write-Host " [APPLY] $ ( $_.name ) [$ ( $_.type ) ]" - ForegroundColor Yellow
18+ }
19+ }
20+
21+ [bool []]$states = $test.results.result.inDesiredState
22+ if ( $states.Contains ($false )) {
23+ $setResult = dsc config set -f $step - o json | ConvertFrom-Json
24+ if ($LASTEXITCODE -ne 0 ) {
25+ throw " [FATAL] Couldn't set the desired state for $step "
26+ }
27+ }
28+ }
29+
30+ if ($LASTEXITCODE -eq 0 ) {
31+ Write-Host " [PASS] All resources are in desired state" - ForegroundColor Green
32+ }
Original file line number Diff line number Diff line change 1+ $schema : https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
2+ resources :
3+ - name : Manifest V2 Availability
4+ type : Microsoft.Windows/Registry
5+ properties :
6+ keyPath : HKLM\SOFTWARE\Policies\Google\Chrome\
7+ valueName : ExtensionManifestV2Availability
8+ valueData :
9+ DWord : 2
Original file line number Diff line number Diff line change 1+ $schema : https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
2+
3+ resources :
4+ - name : Validate the OS is Windows
5+ type : Microsoft/OSInfo
6+ properties :
7+ family : Windows
8+
You can’t perform that action at this time.
0 commit comments