Format-Volume -Force parameter does not work
Votes from Connect: 3
Original Date Submitted: 3/10/2015 12:58:42 AM
Handle: Joel 'Jaykul' Bennett
Site Name: PowerShell
Feedback ID: 1170762
Frequency: Always Happens
Regression: Yes, this happens in all previous versions
Format-Volume E -Force
I am still prompted to confirm.
I had to set $ConfirmPreference = "None" before calling Format-Volume in order to disable the confirmation.
Instead, the -Confirm parameter is apparently defaulted to true, and must be set to $False to do what -Force should do. This is confusing and goes against every accepted practice.
Product Studio item created by Connect Synchronizer due to creation of feedback ID 1170762 (http://connect.microsoft.com/PowerShell/feedback/ViewFeedback.aspx?FeedbackID=1170762).
In PowerShell 5
$ConfirmPreference = "High"
Format-Valume E # prompts
Format-Valume E -Force # still prompts (bug)
Format-Valume E -Confirm:$false # does not prompt (bug)
$ConfirmPreference = "None"
Format-Valume E # does not prompt (bug)
Format-Valume E -Confirm # does prompt
The -Force parameter should override the ConfirmPreference, but does not appear to have any effect whatsoever.
The -Confirm switch shouldn't do anything when it is set to it's default ($false) value.
Internal BugId: 14300
John Alexander Zabroski commented
Thanks. Came here from https://stackoverflow.com/a/42621174/1040437 - been wondering about this for months!!