Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagepowershell
Invoke-RunAsLoggedOnUser -command 'mkdir' -arguments 'C:\Temp'
Code Block
languagepowershell
Invoke-RunAsLoggedOnUser -command 'mkdir' -arguments 'C:\Users\test\Documents' -username 'domain\username'
Code Block
languagepowershell
$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