Listing 1: Telnet-Client installieren $schema: https://raw.githubusercontent.com/ PowerShell/DSC/main/schemas/2024/04/ config/document.json resources: - name: Use Windows PowerShell resources type: Microsoft.Windows/WindowsPowerShell properties: resources: - name: Telnet Client install type: PSDesiredStateConfiguration/ WindowsOptionalFeature properties: Name: TelnetClient Ensure: Enable Listing 2: Taskleiste ausrichten $path = 'HKCU:\Software\Microsoft\Windows\ CurrentVersion\Explorer\Advanced' $propertyName = 'TaskbarAl' $alignLeft = 1 $alignCenter = 0 $propertyType = 'DWORD' Get-ItemProperty -Path $path -Name $propertyName New-ItemProperty -Path $path -Name $propertyName -Value $alignLeft -PropertyType $propertyType Set-ItemProperty -Path $path -Name $propertyName -Value $alignCenter Remove-ItemProperty -Path $path -Name $propertyName Listing 3: SetTaskbarAlignment im Local Configuration Manager ## Eine DSC v1 kompatible Konfiguration Configuration SetTaskbarAlignment { # Import the standard DSC module for built-in resources Import-DscResource -ModuleName PSDesiredStateConfiguration Node 'sea-cl1' { # Resource Block: Ensures the Registry Value is present and correct Registry TaskbarAlignment { Ensure = "Present" Key = 'HKEY_Users\S-1-5-21-1276007578-2914169427-449847108-1108\Software\ Microsoft\Windows\CurrentVersion\Explorer\Advanced' ValueName = "TaskbarAL" ValueData = 0 # The desired DWORD value (0 for Left) ValueType = "DWORD" # Explicitly defines the data type } } } ## Ruft die Konfiguration auf und kompiliert eine MOF-Datei SetTaskbarAlignment -OutputPath TaskbarAlignment ## Startet die eigentliche Anpassung Start-DscConfiguration -Path TaskbarAlignment -Wait #-Verbose Listing 4: Ausschnitt aus einer MOF-Datei instance of MSFT_RegistryResource as $MSFT_RegistryResource1ref { ResourceID = "[Registry]TaskbarAlignment"; ValueName = "TaskbarAL"; Key = "HKEY_Users\\S-1-5-21-1276007578- 2914169427-449847108-1108\\Software\ \Microsoft\\Windows\\CurrentVersion\\ Explorer\\Advanced"; Ensure = "Present"; SourceInfo = "::9::9::Registry"; ValueType = "Dword"; ModuleName = "PSDesiredStateConfiguration"; ValueData = { "0" } Listing 5: TaskbarAlignment.yaml $schema: https://aka.ms/dsc/schemas/v3/ bundled/config/document.json resources: - name: Set taskbar alignment to left type: Microsoft.Windows/Registry ## Die DSC-Resource properties: keyPath: HKCU\Software\Microsoft\Windows\ CurrentVersion\Explorer\Advanced valueName: TaskbarAL valueData: DWord: 0 _exist: true Listing 6: myconfig.winget # Created using winget configure export 1.12.350 # yaml-language-server: $schema=https://aka.ms/configuration-dscschema/0.3 $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/ document.json metadata: winget: processor: identifier: "dscv3" resources: # WinGet settings - name: WingetSettings type: Microsoft.WinGet/UserSettingsFile properties: settings: experimentalFeatures: experimentalCmd: true experimentalArg: false visual: progressBar: "rainbow" enableSixels: true telemetry: disable: true $schema: "https://aka.ms/ winget-settings.schema.json" # Winfile installation - name: winget_Microsoft.winfile type: Microsoft.WinGet/Package metadata: description: "Install Microsoft.winfile" properties: id: "Microsoft.winfile" source: "winget" # Brave installation - name: winget_Brave.Brave type: Microsoft.WinGet/Package metadata: description: "Install Brave.Brave" properties: id: "Brave.Brave" source: "winget" # Not implemented yet: # scope: "machine"