user310291
user310291

Reputation: 38228

Powershell cmdlet in "silent mode" possible?

For example when launching

Get-PackageProvider -Name Chocolatey

You'll have to answer Yes.

How to launch from Batch file without requiring to answer Y ?

Upvotes: 0

Views: 487

Answers (1)

Maximilian Burszley
Maximilian Burszley

Reputation: 19684

According to the Get-PackageProvider cmdlet documentation, you can skip the prompt by using the -ForceBootstrap switch:

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

Upvotes: 4

Related Questions