MicrosoftDocs / windows-powershell-docs

This repo is used to contribute to Windows 10, Windows Server 2016, and MDOP PowerShell module documentation.
Creative Commons Attribution 4.0 International
444 stars 591 forks source link

Default value of confirm switch is true for Enable-ClusterStorageSpacesDirect #2223

Closed asengutt closed 3 years ago

asengutt commented 3 years ago

This is just minor typo or probably changed somewhere down the timeline. Confirmation is requested by default on this command. Hence Confirm switch default should be noted as true in documentation.

PS C:> Enable-ClusterStorageSpacesDirect –CimSession Quest

Confirm Are you sure you want to perform this action? Quest: Performing operation 'Enable Cluster Storage Spaces Direct' on Target 'Quest'. [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

velkovb commented 3 years ago

Hi @asengutt ,

Thank you for trying to make MicrosoftDocs a better place.

By default switch parameters are always false. unless explicitly specified - Switch Parameters. Here you are not prompted because of the -Confirm parameter but because the impact of the cmdlet is High. You could read more about cmdlet confirm impact and preference - $ConfirmPreference, ConfirmImpact

Furthermore, you could check the following article to understand confirmation requests - https://docs.microsoft.com/powershell/developer/cmdlet/users-requesting-confirmation

Let me know if you have any questions.