I want to make a script for my users. It will let us install applications while there are not admins.
pw= get-content \\xxx\xxxx\xxx\xxx\pass.txt | convertto-securestring
$pp= new-object -typename System.Management.Automation.PSCredential -argumentlist "xx\admin",$pw
The file is created and is crypted.
$script = "\\xxxx\xxx\xxx\xxx\Install_chrome.ps1"
Start-Process powershell -Credential $pp -ArgumentList '-noprofile -command &{Start-Process $script -verb runas}' -RedirectStandardOutput c:\stdout.txt -RedirectStandardError c:\stderr.txt
Here's my error:
Start -Process : Unable to validate the argument on parameter "FilePath". The argument is null or empty. Specify an argument that is not null or empty and try again.