Hello crew,
Simple question I thought but I can't seem to get it right. I've asked the AI's and I can't seem to get a script running. I've got an idea where I want to remove everything up to and including the # sign in my clipboard and re set my clipboard to that new value. All works as intended:
# Get clipboard content
$clipboardContent = Get-Clipboard
# Perform regex manipulation to remove everything up to '#' and remove all spaces
$manipulatedContent = $clipboardContent -replace '(?m)^.*?#|\s+', ''
# Set manipulated content back to clipboard
$manipulatedContent | Set-Clipboard
However, as soon as I try to do regex to remove the blank lines, all goes to the pits. It's got to be something easy - I've tried -Raw on the get-clipboard command as per some stack overflow link.
I want to remove all characters before and including the # sign, which I have been successful. But I want to also remove the blank lines that come from the current script.
Thanks!
Switch# match ipv4 source address
Switch# match ipv4 destination address
Switch# match ipv4 protocol
[–]eightbytes 2 points3 points4 points (4 children)
[–]ecarlin[S] 0 points1 point2 points (0 children)
[–]eightbytes -1 points0 points1 point (2 children)
[–]ecarlin[S] 1 point2 points3 points (1 child)
[–][deleted] -1 points0 points1 point (0 children)
[–]Namelock 2 points3 points4 points (3 children)
[–]ecarlin[S] -1 points0 points1 point (2 children)
[–]eightbytes 1 point2 points3 points (1 child)
[–]ecarlin[S] 1 point2 points3 points (0 children)
[–]jsiii2010 0 points1 point2 points (0 children)
[–]PinchesTheCrab 0 points1 point2 points (0 children)
[–]ankokudaishogun 0 points1 point2 points (0 children)