Created
November 2, 2018 07:46
-
-
Save PlagueHO/cc85b08d751b414f37e5ade7e73af09d to your computer and use it in GitHub Desktop.
Split a PowerShell Script containing multiple functions into a single function files
This file contains 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
. .\utils.ps1 | |
Get-Command *-CosmosDb* | | |
ForEach-Object { | |
$filename = Join-Path -Path (Get-Location) -ChildPath "$($_.name).ps1" | |
"function $($_.Name)`r`n{`r`n$($_.Definition)}" | Set-Content -Path $filename -Force | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment