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
|
|
|
|
)
|
|
|
|
[MyScript]::_GetValidValues($wordToComplete,$false)
|
|
|
|
})]
|
|
|
|
[string[]]$AlsoEditTheseScripts
|
2020-09-18 19:41:58 +00:00
|
|
|
)
|
|
|
|
|
2020-09-25 05:04:05 +00:00
|
|
|
$local:FilePaths = @() + $( Get-Profiles | Where-Object { $_.Exists -or $Force } | Select-Object -ExpandProperty Path )
|
|
|
|
foreach( $local:p in $AlsoEditTheseScripts ) {
|
|
|
|
$local:sp = Join-Path $MyPSScriptRoot "$p`.ps1"
|
|
|
|
$FilePaths += $sp
|
|
|
|
}
|
|
|
|
|
|
|
|
Edit-TextFile -sudo:$sudo $FilePaths
|