Public/New-DevConfig.ps1
|
function New-DevConfig { [CmdletBinding()] param( [Parameter()] [string]$Path = (Get-Location).Path ) $ConfigPath = Join-Path $Path ".devconfig.json" if (Test-Path $ConfigPath) { Write-Verbose ".devconfig.json already exists; skipping" return } $Config = @{ projectName = Split-Path $Path -Leaf created = (Get-Date).ToString("o") version = "1.0" tools = @{ prettier = $true markdownlint = $true analyzer = $true } } $content = $Config | ConvertTo-Json -Depth 5 Set-DtFileContent -Path $ConfigPath -Content $content | Out-Null Write-Host "Created .devconfig.json" -ForegroundColor Green } |