2020-09-18 19:41:58 +00:00
|
|
|
[CmdletBinding(SupportsShouldProcess)]param(
|
|
|
|
[switch]$sudo,
|
2020-09-25 05:04:05 +00:00
|
|
|
[switch]$Force,
|
|
|
|
[Parameter(ValueFromRemainingArguments = $true)]
|
|
|
|
[ArgumentCompleter({ param (
|
|
|
|
$commandName,
|
|
|
|
$parameterName,
|
|
|
|
$wordToComplete,
|
|
|
|
$commandAst,
|
|
|
|
$fakeBoundParameters
|
|
|
|
)
|
2020-09-30 21:43:36 +00:00
|
|
|
[MyScript]::_GetValidValues($wordToComplete,$true)
|
2020-09-25 05:04:05 +00:00
|
|
|
})]
|
|
|
|
[string[]]$AlsoEditTheseScripts
|
2020-09-18 19:41:58 +00:00
|
|
|
)
|
|
|
|
|
2021-04-07 20:04:46 +00:00
|
|
|
[string[]]$local:FilePaths = @() + $( Get-Profiles | Where-Object { $_.Exists -or $Force } | Select-Object -ExpandProperty Path )
|
2020-09-25 05:04:05 +00:00
|
|
|
foreach( $local:p in $AlsoEditTheseScripts ) {
|
|
|
|
$local:sp = Join-Path $MyPSScriptRoot "$p`.ps1"
|
|
|
|
$FilePaths += $sp
|
|
|
|
}
|
|
|
|
|
2021-04-07 20:04:46 +00:00
|
|
|
Edit-TextFile -sudo:$sudo -Path $FilePaths
|