-
-
Save mak/63a953cbc7b1cd5e1f47d3c6e195b583 to your computer and use it in GitHub Desktop.
one-liner to extract powershell command in recent nymaim's documnets
This file contains hidden or 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