Prepare-ConfigurationOOPTests.ps1 (1823B)
1 # Copyright (c) Microsoft Corporation. 2 # Licensed under the MIT License. 3 [CmdletBinding()] 4 param( 5 [string]$BuildOutputPath, 6 7 [string]$PackageLayoutPath 8 ) 9 10 # Copy the winmd into the unit test directory since it will be needed for marshalling 11 $Local:winmdSourcePath = Join-Path $BuildOutputPath "Microsoft.Management.Configuration\Microsoft.Management.Configuration.winmd" 12 $Local:winmdTargetPath = Join-Path $BuildOutputPath "Microsoft.Management.Configuration.UnitTests\net8.0-windows10.0.26100.0\Microsoft.Management.Configuration.winmd" 13 14 Copy-Item $Local:winmdSourcePath $Local:winmdTargetPath -Force 15 16 # Copy the OOP helper dll into the unit test directory to make activation look the same as in-proc 17 $Local:dllSourcePath = Join-Path $BuildOutputPath "Microsoft.Management.Configuration.OutOfProc\Microsoft.Management.Configuration.OutOfProc.dll" 18 $Local:dllTargetPath = Join-Path $BuildOutputPath "Microsoft.Management.Configuration.UnitTests\net8.0-windows10.0.26100.0\Microsoft.Management.Configuration.dll" 19 20 Copy-Item $Local:dllSourcePath $Local:dllTargetPath -Force 21 22 # Register the package 23 if (-not [System.String]::IsNullOrEmpty($PackageLayoutPath)) 24 { 25 $Local:packageManifestPath = Join-Path $PackageLayoutPath "AppxManifest.xml" 26 27 Add-AppxPackage -ForceApplicationShutdown -Register $Local:packageManifestPath 28 29 # Configure crash dump and log file settings 30 $Local:settingsExport = ConvertFrom-Json (wingetdev.exe settings export) 31 $Local:settingsFilePath = $Local:settingsExport.userSettingsFile 32 $Local:settingsFileContent = ConvertTo-Json @{ debugging= @{ enableSelfInitiatedMinidump=$true ; keepAllLogFiles=$true } ; experimentalFeatures= @{ configuration03=$true } } 33 34 Set-Content -Path $Local:settingsFilePath -Value $Local:settingsFileContent 35 }