I write lots of scripts for automation. Administrators here run as a low privilege account and elevate what they need to an administrative account.
I want to be able to use Get-Credential in my scripts to get that elevating account from the user to do actions, but I have a problem. Get-Credential works fine with username/password logins. It does not work at all with a Smart Card and PIN.
How can I use Smart Card and PIN credentials in a PowerShell script to elevate actions using those alternate credentials?