Containers/New-ContainerFromVSCode.ps1
function New-ContainerFromVSCode { Param( [Parameter(Mandatory=$false)] $ContainerName = "", [Parameter(Mandatory=$false)] $SourcePath = (Get-Location), [switch] $SetupTestUsers, [switch] $SkipTestTool ) Write-Host -ForegroundColor Green "Creating new container for current project" if ($ContainerName -eq "") { $ContainerName = Get-ContainerFromLaunchJson } $locale = Get-EnvironmentKeyValue -KeyName 'locale' [version]$platform = Get-AppKeyValue -SourcePath $SourcePath -KeyName 'platform' if ($platform.Major -lt 13) { New-Container -ContainerName $ContainerName -LicenseFile (Get-EnvironmentKeyValue -KeyName 'LocalLicenseFile') -alwaysPull -SetupTestUsers:$SetupTestUsers -SkipTestTool:$SkipTestTool -Country $locale -useHyperVIsolation -includeCSide -includeClickOnce } else { New-Container -ContainerName $ContainerName -LicenseFile (Get-EnvironmentKeyValue -KeyName 'LocalLicenseFile') -alwaysPull -SetupTestUsers:$SetupTestUsers -SkipTestTool:$SkipTestTool -Country $locale -useHyperVIsolation } if (!(Test-Path (Join-Path $SourcePath "tempDependency") -PathType Container)) { New-Item (Join-Path $SourcePath "tempDependency") -ItemType Directory -Force } Copy-Item (Join-Path $SourcePath "app.json") (Join-Path $SourcePath "tempDependency") Copy-Item (Join-Path $SourcePath "settings.json") (Join-Path $SourcePath "tempDependency") Get-ALDependencies -ContainerName $ContainerName -SourcePath (Join-Path $SourcePath "tempDependency") -Install if (Test-Path (Join-Path $SourcePath "BaseObjects" -PathType Container)) { Import-ObjectsFromFolder -ContainerName $ContainerName -SourcePath (Join-Path $SourcePath "BaseObjects") } Remove-Item (Join-Path $SourcePath "tempDependency") -Recurse -Force Write-Host -ForegroundColor Green "Successfully created container $ContainerName" } Export-ModuleMember New-ContainerFromVSCode |