Last active
September 8, 2017 12:08
-
-
Save turboBasic/439b82e8ddf05a4dee5e1bfc3c7e7371 to your computer and use it in GitHub Desktop.
[Disable some functions in Lee Holmes' Powershell Cookbook] so that not overwrite your existing functions. Run this, then open PowershellCookBook.psd1 and paste in `FunctionsToExport = ` line, then comment/delete functions you are not going to export. #powershell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
New-Item -type Directory .\Module_PowershellCookBook | |
Save-Module -name PowerShellCookbook -path .\Module_PowershellCookBook | |
& { | |
$fileName = Get-ChildItem -path .\Module_PowershellCookBook\*\PowerShellCookbook.psm1 -recurse | |
$functions = Get-Content -path $fileName.fullName | | |
%{ Select-String '(?ix) ^(?<= \s*) function \s* ([-\w]+) \s* $' -input $_ -allMatches } | | |
%{ $_.Matches.Groups[1].Value } | |
($functions | %{ "'$_'" }) -join ",`n" | Out-Clipboard | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment