Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $myMatches = (Get-Content -Path .\Commands.ps1 -Raw) | Select-String "(?m)^function (\w*-\w*) \{[^}]+\}" -AllMatches
- foreach ($match in $myMatches.Matches) {
- $filename = "$($match.Groups[1].Value).ps1"
- $match.Groups[0].Value | Out-File -FilePath $filename
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement