SHARE
TWEET

Untitled

a guest Oct 23rd, 2019 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $myMatches = (Get-Content -Path .\Commands.ps1 -Raw) | Select-String "(?m)^function (\w*-\w*) \{[^}]+\}" -AllMatches
  2. foreach ($match in $myMatches.Matches) {
  3.     $filename = "$($match.Groups[1].Value).ps1"
  4.     $match.Groups[0].Value | Out-File -FilePath $filename
  5. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top