-
-
Save reanimat0r/802fd1b4359309e98aa7884c1a51f30c to your computer and use it in GitHub Desktop.
one-liner to extract powershell command in recent nymaim's documnets
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
( olevba $document | grep ' = ' | \ | |
sed -e's/&/+/g' -e's/NaN/None/g' -e's/ = [^A].*(\(A.*)\))/= \1/' -e 's/Array//' \ | |
-e's/(/[/g' -e's/)/]/g' -e "s#\"\([^\"]*\)\"\([^\"]*\)\"#\"\1'\2#" | \ | |
grep '\[\|\+'; \ | |
echo 'print globals()[sorted(globals(),key=lambda x: type(globals()[x]) == str and len(globals()[x]))[-1]]' | |
) \ | |
| python2 - | tr -d '^' | tr '[:upper:]' '[:lower:]' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment