我正在运行一个脚本,它要求我输入多个输入,比如"R“"Y”"IP地址“。如何使这个自动化的.How,我可以传递R,然后再R,然后IP地址?我在网上试过很少的例子,但它不起作用.
1) PS C:\orchestrator\scripts> ./Install-Orchestrator.ps1 echo "Y`r" | pw
2)./Install-Orchestrator.ps1 |echo R
3).powershell.exe -noexit -file 'Install-Orchestrator.ps1' "R"下面是脚本和选项
PS C:\orchestrator\scripts> ./Install-Orchestrator.ps1
Security warning
Run only scripts that you trust. While scripts from the internet can be useful, this script can potentially harm your
computer. If you trust this script, use the Unblock-File cmdlet to allow the script to run without this warning
message. Do you want to run C:\orchestrator\scripts\Install-Orchestrator.ps1?
[D] Do not run [R] Run once [S] Suspend [?] Help (default is "D"): R
---------------------------------
UiPath Orchestrator v2 Installer
---------------------------------
Security warning
Run only scripts that you trust. While scripts from the internet can be useful, this script can potentially harm your
computer. If you trust this script, use the Unblock-File cmdlet to allow the script to run without this warning
message. Do you want to run C:\orchestrator\scripts\Test-FrameworkVersion.ps1?
[D] Do not run [R] Run once [S] Suspend [?] Help (default is "D"): R
Checking current version of .NET
Current .NET version installed 4.7
You have correct version of .NET: (4.7)
Security warning
Run only scripts that you trust. While scripts from the internet can be useful, this script can potentially harm your
computer. If you trust this script, use the Unblock-File cmdlet to allow the script to run without this warning
message. Do you want to run C:\orchestrator\scripts\Test-WebDeployVersion.ps1?
[D] Do not run [R] Run once [S] Suspend [?] Help (default is "D"): R
Checking current version of Web Deploy
You have correct version of Web Deploy 3.1237.1764
Do you want to test port to database?
[Y] Yes [N] No [?] Help (default is "N"): Y
Testing open port to database
Security warning
Run only scripts that you trust. While scripts from the internet can be useful, this script can potentially harm your
computer. If you trust this script, use the Unblock-File cmdlet to allow the script to run without this warning
message. Do you want to run C:\orchestrator\scripts\Test-PortOpen.ps1?
[D] Do not run [R] Run once [S] Suspend [?] Help (default is "D"): R
Enter the host/ip address: 10.10.10.100
Enter the port number to access: 1433发布于 2022-05-25 19:39:42
尝尝这个
使用下面的输入创建一个文本文件
some_text_file.txt
R
是
10.0.0.123
然后在Powershell中运行以下命令
Start-Process -FilePath "./Install-Orchestrator.ps1" -ArgumentList "if there are any" -Wait -RedirectStandardInput "./some_text_file.txt"https://stackoverflow.com/questions/46366430
复制相似问题