Public/New-DevEnvironment.ps1
|
function New-DevEnvironment { <# .SYNOPSIS Scaffolds a development environment at the given path. .DESCRIPTION Ensures the target directory exists, then scaffolds a default Python environment inside it via Invoke-MkVenv. Composes existing, tested primitives (New-DtDirectory, Invoke-MkVenv) rather than duplicating their logic. .PARAMETER Path Directory to scaffold the environment into. Created if it does not already exist. .EXAMPLE New-DevEnvironment -Path C:\projects\my-app #> [CmdletBinding(SupportsShouldProcess = $true)] param( [Parameter(Mandatory = $true)] [string]$Path ) if (-not $PSCmdlet.ShouldProcess($Path, 'Scaffold development environment')) { return } New-DtDirectory -Path $Path -Confirm:$false | Out-Null Push-Location $Path try { Invoke-MkVenv -Type Python -Confirm:$false | Out-Null } finally { Pop-Location } Write-Verbose "Development environment scaffolded at: $Path" } |