I pulled this from another question, but I caot seem to make this work.
I'm needing to run this .bat file as a local admin account. I want users to be able to run and install this without having local admin rights.
I'm not sure what's wrong though. Thanks in advance for help.
$useame = 'localadmin'
$password = 'passwordforlocaladmin'
$securePassword = ConvertTo-SecureString $password -AsPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential $useame, $securePassword
Start-Process -filepath "p:kaceInstallerkaceinstall3.bat" -Credential $credential
The error I'm getting back is:
Start-Process : This command caot be executed due to the error: The directory name is invalid. At P:kaceInstallermisckaceSetup.ps1:7 char:14 + Start-Process <<<< cmd -Credential $credential + CategoryInfo : InvalidOperation: (:) [Start-Process], InvalidOp erationException + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.C ommands.StartProcessCommand
