【发布时间】:2021-08-10 09:08:54
【问题描述】:
我是 PowerShell 新手,我正在尝试创建一个脚本,该脚本将使用特定于此 .exe 文件的参数卸载 Dell Data Protection。
这是我所拥有的减去我将使用的实际信用:
Start-Process -Filepath C:\Programfiles (x86)\Dell\Dell Data Protection\DataSecurityUninstaller.exe" -argumentlist "CMG_DECRYPT=1 FORENSIC_ADMIN="ExampleUser" FORENSIC_PWD="Passw0rd" NOREBOOT /silent"
我明白了:
A positional parameter cannot be found that accepts argument "ExampleUser" FORENSIC_PWD="Passw0rd" NOREBOOT
当我将它放入 CMD 时,它可以工作。我想我不知道如何正确处理运行参数。
【问题讨论】:
-
看cmdlet的例子7,每个参数用逗号隔开,意思是argumentlist应该是一个数组。 docs.microsoft.com/en-us/powershell/module/…
标签: powershell scripting