0

我想为我的用户制作一个脚本。它可以让我们在没有管理员的情况下安装应用程序。

pw= get-content \\xxx\xxxx\xxx\xxx\pass.txt | convertto-securestring
$pp= new-object -typename System.Management.Automation.PSCredential -argumentlist "xx\admin",$pw

该文件已创建并已加密。

$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

这是我的错误:

Start -Process:无法验证参数“FilePath”上的参数。参数为 null 或空。指定一个不为 null 或空的参数,然后重试。

4

0 回答 0