Runas local Administrator, while authenticating as domain user

Solution 1:

I bet any malware wants to just open up a console ant type privileged commands. That's why this is not (directly) possible.

You can, however, just ask for credentials through Get-Credential and use the object later in the script to authenticate things.

For example, like this:

Get-Credential -Message "Credential for access to <whatever>" -User .\administrator

It will look like this:

PowerShell Credential Request
Credential for access to <whatever>
Password for user .\administrator:

Then you can use the object to do stuff:

Get-WmiObject -Class Win32_BIOS -Computer LOCALHOST -Credential $cred