Misc/Add-StandardTestApp.ps1
<# .Synopsis Create List of Standard Test Apps .Description Create List of Standard Test Apps .Parameter TestApps non default Test Apps .Parameter Version version of BC .Example Add-StandardTestApp -TestApps $apps -Version '19.0.0.0' #> function Add-StandardTestApp { Param( #Path to determine the environment or app .json file location [Parameter(Mandatory = $false)] $TestApps = $null, [Parameter(Mandatory = $true)] [string]$Version ) $TestappsJsonContent = @() if ($null -ne $TestApps) { $TestApps | ForEach-Object { $appid = $null try { $appid = $_.Id } catch { $appid = $null } if ($null -eq $appid) { $appid = $_.appId } $TestappsJsonContent = $TestappsJsonContent + [PSCustomObject]@{ appId = $appid name = $_.name publisher = $_.publisher version = $_.version } } } $appid = 'dd0be2ea-f733-4d65-bb34-a28f4624fb14' if ($null -eq ($TestappsJsonContent | Where-Object { $_.appId -eq $appid})) { $TestappsJsonContent = $TestappsJsonContent + [PSCustomObject]@{ appId = $appid name = 'Library Assert' publisher = 'Microsoft' version = $Version } } $appid = 'e7320ebb-08b3-4406-b1ec-b4927d3e280b' if ($null -eq ($TestappsJsonContent | Where-Object { $_.appId -eq $appid})) { $TestappsJsonContent = $TestappsJsonContent + [PSCustomObject]@{ appId = $appid name = 'Any' publisher = 'Microsoft' version = $Version } } $appid = '9856ae4f-d1a7-46ef-89bb-6ef056398228' if ($null -eq ($TestappsJsonContent | Where-Object { $_.appId -eq $appid})) { $TestappsJsonContent = $TestappsJsonContent + [PSCustomObject]@{ appId = $appid name = 'System Application Test Library' publisher = 'Microsoft' version = $Version } } $appid = '5d86850b-0d76-4eca-bd7b-951ad998e997' if ($null -eq ($TestappsJsonContent | Where-Object { $_.appId -eq $appid})) { $TestappsJsonContent = $TestappsJsonContent + [PSCustomObject]@{ appId = $appid name = 'Tests-TestLibraries' publisher = 'Microsoft' version = $Version } } $appid = '23de40a6-dfe8-4f80-80db-d70f83ce8caf' if ($null -eq ($TestappsJsonContent | Where-Object { $_.appId -eq $appid})) { $TestappsJsonContent = $TestappsJsonContent + [PSCustomObject]@{ appId = $appid name = 'Test Runner' publisher = 'Microsoft' version = $Version } } $TestappsJsonContent } |