...
Code Block | ||
---|---|---|
| ||
Invoke-RunAsLoggedOnUser -command 'mkdir' -arguments 'C:\Temp' |
Code Block | ||
---|---|---|
| ||
Invoke-RunAsLoggedOnUser -command 'mkdir' -arguments 'C:\Users\test\Documents' -username 'domain\username' |
Code Block | ||
---|---|---|
| ||
$Command = “C:\Program Files\PowerShell\7\pwsh.exe”
$Arguments = "-Command `"Import-PfxCertificate -Password `$('$PlainTextPassword' | ConvertTo-SecureString -AsPlainText -Force) 'C:\Cert.p12' -CertStoreLocation Cert:\currentUser\My`""
Invoke-RunAsLoggedOnUser -command $Command -arguments $Arguments |