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.

17 line
409 B

  1. param(
  2. [switch]$NoHeader,
  3. [Parameter(Position = 0, ValueFromRemainingArguments = $true)]
  4. #[ValidateSet([Functions])]
  5. [string[]]$FunctionName
  6. )
  7. $local:src = ""
  8. foreach( $local:func in $FunctionName ) {
  9. if( -not $NoHeader ) { $src += "`nfunction $func {" }
  10. $src += "`n $((Get-Command -Type Function $func).Definition)"
  11. if( -not $NoHeader ) { $src += "`n}" }
  12. $src += "`n"
  13. }
  14. return $src.Trim()