我正尝试举这个例子:
snapdrive7.0.exe /s /v"/qn SILENT_MODE=1 /Li SDInstall.log LPSM_SERIALNUMBER=serialnumber INSTALLDIR=\"c:\Program Files\NetApp\SnapDrive\" SVCUSERNAME=domain\username SVCUSERPASSWORD=password SVCCONFIRMUSERPASSWORD=password" SDW_WEBSRV_TCP_PORT=808 SDW_WEBSRV_HTTP_PORT=4098 TRANSPORT_PRT_SELECTION=2 TRANSPORT_PRT_PORT=80 TRANSPORT_PROTOCOL_LOGON_USERNAME=username TRANSPORT_PROTOCOL_LOGON_PASSWORD=password" ADD_WINDOWS_FIREWALL=1
https://library.netapp.com/ecmdocs/ECMP1201909/html/GUID-845E8F73-4904-4467-BCEB-A57DDCEDC356.html
尽管通过多个参数进行了一些挣扎,但用户名和密码是变量,并通过Start-Process转换为PS
$Account = "domain\user"
$AccountP= Read-Host -Assecurestring "Please enter the password for service account $Account"
$AccountPWD = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto([System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($AccountP))
$ArgumentList = "/s /v/qn LPSM_SERIALNUMBER="" INSTALLDIR=\c:\Program Files\NetApp\SnapDrive\ SVCUSERNAME=$Account SVCUSERPASSWORD=$AccountPWD SVCCONFIRMUSERPASSWORD=$AccountPWD SDW_WEBSRV_TCP_PORT=808 SDW_WEBSRV_HTTP_PORT=4098 TRANSPORT_PRT_SELECTION=2 TRANSPORT_PRT_PORT=80 TRANSPORT_PROTOCOL_LOGON_USERNAME=$NetappSnapdriveSVC TRANSPORT_PROTOCOL_LOGON_PASSWORD=$AccountPWD ADD_WINDOWS_FIREWALL=1"
$NetappSnapDInstall = Start-Process .\SnapDrive7.1.5_x64.exe $ArgumentList -PassThru -Wait
任何指针将不胜感激