PowerShell_Scripts/Edit-MyConfig.ps1
lksz 524bce25de MyConfig modifications
Moved configuration into src/config.files.json, it will also load
src/config.files.local.json (which will not be included in the git repo)

Added Git-Path to resolve paths simply, even when Path does not exist.
2020-11-04 23:31:34 -05:00

24 lines
696 B
PowerShell

[CmdletBinding(SupportsShouldProcess)]param(
[Parameter(Position = 0, ValueFromRemainingArguments)]
[ArgumentCompleter({ param (
$commandName,
$parameterName,
$wordToComplete,
$commandAst,
$fakeBoundParameters
)
[MyConfig]::_GetValidValues($wordToComplete,$true) | Sort-Object
})]
[string[]]$ConfigName,
[switch]$Force,
[switch]$sudo
)
if( -not $ConfigName ) {
([MyConfig]::_GetValidValues('',$true)) | Sort-Object
return
}
$local:ScriptPaths = [MyConfig]::GetConfigPaths($ConfigName,$Force)
Edit-TextFile -sudo:$sudo $ScriptPaths
$null = [MyConfig]::_GetValidValues('', $true)