# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 ############################################################################### # Create Windows Sandbox instance with WinGet installed. # # Run as Administrator # # Mount C:\Sandbox on the local filesystem into the Sandbox filesystem. # # The Logon command performs the following steps in Windows PowerShell: # # 1. Set the execution policy to RemoteSigned # # 2. Download and install Microsoft.WinGet.Client PowerShell Module # # 3. Use Repair-WinGetPackageManager cmdlet to bootstrap WinGet # ############################################################################### properties: resources: - resource: Microsoft.WindowsSandbox.DSC/WindowsSandbox directives: description: Create Windows Sandbox with Winget installed allowPrerelease: true settings: Ensure: Present #WsbFile: LogonCommand: > cmd /c start powershell -NoExit -Command "$progressPreference = 'silentlyContinue'; Write-Host 'Setting execution policy to remote signed...' `n; Set-ExecutionPolicy RemoteSigned -Force; Write-Host "Installing WinGet PowerShell module from PSGallery..."; Install-PackageProvider -Name NuGet -Force | Out-Null; Install-Module -Name Microsoft.WinGet.Client -Force -Repository PSGallery | Out-Null; Write-Host "Using Repair-WinGetPackageManager cmdlet to bootstrap WinGet..."; Repair-WinGetPackageManager; Write-Host "Done."; #HostFolder: #SandboxFolder: #ReadOnly: false #MemoryInMB: 2048 #vGPU: true #AudioInput: true #ClipboardRedirection: true #Networking: true #PrinterRedirection: false #ProtectedClient: false #VideoInput: true configurationVersion: 0.2.0