Powershell is a command line. Your question makes just as much sense as if you asked us how to write C++ with the DOS prompt. And the answer is the same: use it to open a text editor, write your code in the text editor, use it to run your compiler, and use it to run the program.
root = tkinter.Tk()
buttons=[i for i in range(10)]
#If specific button is pressed, output "YES"
for num in buttons: