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' New-Container -ContainerName $ContainerName -LicenseFile (Get-EnvironmentKeyValue -KeyName 'LocalLicenseFile') -alwaysPull -SetupTestUsers:$SetupTestUsers -SkipTestTool:$SkipTestTool -Country $locale 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 Remove-Item (Join-Path $SourcePath "tempDependency") -Recurse -Force Write-Host -ForegroundColor Green "Successfully created container $ContainerName" } Export-ModuleMember New-ContainerFromVSCode |