例如,启动时
Get-PackageProvider -Name Chocolatey
你必须回答是。
如何从批处理文件启动而不需要回答Y?
答案 0 :(得分:3)
根据Get-PackageProvider
cmdlet文档,您可以使用-ForceBootstrap
开关跳过提示:
PS C:\> Get-Help -Name Get-PackageProvider -Parameter ForceBootstrap
-ForceBootstrap [<SwitchParameter>]
Indicates that this cmdlet forces Package Management to automatically install
the package provider.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false