#Press Windows key
[System.Windows.Forms.SendKeys]::SendWait("^{ESC}")
#Input "run"
[System.Windows.Forms.SendKeys]::SendWait("run")
Start-Sleep -s 1
#Press Enter key
[System.Windows.Forms.SendKeys]::SendWait("{ENTER}")
Start-Sleep -s 1
#Input "notepad"
[System.Windows.Forms.SendKeys]::SendWait("notepad")
[System.Windows.Forms.SendKeys]::SendWait("{ENTER}")
Start-Sleep -s 1
#Input "This is a test script"
[System.Windows.Forms.SendKeys]::SendWait("This is a test script.")
#Press Control+S key
[System.Windows.Forms.SendKeys]::SendWait("^s")
Start-Sleep -s 1
[System.Windows.Forms.SendKeys]::SendWait("newtext.txt")
[System.Windows.Forms.SendKeys]::SendWait("{ENTER}")
Start-Sleep -s 1
#Press Alt+F4 key
[System.Windows.Forms.SendKeys]::SendWait("%{F4}")