Through the Command Prompt, I am looking to open Powershell as Admin and pass a command for it to execute. The command is simple: remove all .txt files in a directory. I am having a difficult time passing this command into the Admin Powershell. Here's what I'm trying:
powershell -Command "Start-Process powershell -Verb runAs | Remove-Item -Path C:\MyFolder\*.txt"
So far, the Powershell window opens but nothing is executed.