Script directory for a PowerShell profile. https://blog.lksz.me/keeping-track-of-everything/#-mypsscriptroot
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
696 B

  1. [CmdletBinding(SupportsShouldProcess)]param(
  2. [Parameter(Position = 0, ValueFromRemainingArguments)]
  3. [ArgumentCompleter({ param (
  4. $commandName,
  5. $parameterName,
  6. $wordToComplete,
  7. $commandAst,
  8. $fakeBoundParameters
  9. )
  10. [MyConfig]::_GetValidValues($wordToComplete,$true) | Sort-Object
  11. })]
  12. [string[]]$ConfigName,
  13. [switch]$Force,
  14. [switch]$sudo
  15. )
  16. if( -not $ConfigName ) {
  17. ([MyConfig]::_GetValidValues('',$true)) | Sort-Object
  18. return
  19. }
  20. $local:ScriptPaths = [MyConfig]::GetConfigPaths($ConfigName,$Force)
  21. Edit-TextFile -sudo:$sudo $ScriptPaths
  22. $null = [MyConfig]::_GetValidValues('', $true)