Skip to content

Commit f4cad10

Browse files
Uwe Jankeclaude
andcommitted
Show-sqmToolGui: do not pre-check WhatIf (Run executed simulation unexpectedly) (1.7.2.0)
For ShouldProcess-capable commands the "WhatIf (simulation)" checkbox was pre-checked (Checked = $supportsWhatIf), so clicking Run silently simulated those commands instead of executing. The checkbox is now OFF by default (opt-in): Run actually executes; simulation is a deliberate click. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 62923eb commit f4cad10

3 files changed

Lines changed: 18 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# sqmSQLTool — Changelog
22

3+
## [1.7.2.0] — 2026-06-22
4+
5+
### 🔧 Fixes
6+
7+
- **Show-sqmToolGui**: Bei ShouldProcess-fähigen Befehlen war die „WhatIf (simulation)"-Checkbox
8+
**vorab angehakt** (`Checked = $true`/`$supportsWhatIf`). Dadurch lief „Run" bei genau diesen
9+
Befehlen ungewollt als reine Simulation statt echt auszuführen. Die Checkbox ist jetzt
10+
**standardmäßig deaktiviert** (opt-in): „Run" führt real aus, Simulation wird bewusst angehakt.
11+
312
## [1.7.1.0] — 2026-06-22
413

514
### ✨ Neu

Public/Show-sqmToolGui.ps1

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
1212
The grouping comes from Public\category-map.ps1. Functions without an entry land under
1313
"Other". Read-only functions (Get-/Test-) are safe to run; state-changing functions that
14-
support -WhatIf automatically get a "WhatIf (simulation)" option that is enabled by default.
14+
support -WhatIf get a "WhatIf (simulation)" option. It is OFF by default, so "Run" actually
15+
executes - enable the checkbox deliberately to only simulate.
1516
1617
The interface uses a Visual Studio "Dark" colour scheme.
1718
.PARAMETER Filter
@@ -259,7 +260,7 @@
259260
$chkWhatIf.Text = 'WhatIf (simulation - shows what would happen, changes nothing)'
260261
$chkWhatIf.Dock = 'Fill'
261262
$chkWhatIf.TextAlign = 'MiddleLeft'
262-
$chkWhatIf.Checked = $true
263+
$chkWhatIf.Checked = $false
263264
$chkWhatIf.Visible = $false
264265
$chkWhatIf.ForeColor = $cText
265266
$optPanel.Controls.Add($chkWhatIf)
@@ -360,10 +361,12 @@
360361
}
361362
$lblSyn.Text = $script:synCache[$fnName]
362363

363-
# Show WhatIf only when the function supports ShouldProcess
364+
# Show WhatIf only when the function supports ShouldProcess.
365+
# WICHTIG: NICHT vorab anhaken - sonst laeuft "Run" bei ShouldProcess-Befehlen ungewollt
366+
# als Simulation. Die Simulation ist opt-in (Anwender hakt bewusst an).
364367
$supportsWhatIf = $cmd.Parameters.ContainsKey('WhatIf')
365368
$chkWhatIf.Visible = $supportsWhatIf
366-
$chkWhatIf.Checked = $supportsWhatIf
369+
$chkWhatIf.Checked = $false
367370

368371
$paramPanel.SuspendLayout()
369372
$paramPanel.Controls.Clear()

sqmSQLTool.psd1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
RootModule = 'sqmSQLTool.psm1'
1818

1919
# Version number of this module.
20-
ModuleVersion = '1.7.1.0'
20+
ModuleVersion = '1.7.2.0'
2121

2222
# ID used to uniquely identify this module
2323
GUID = 'c4b10ba2-aee2-4d8d-ad86-a6e97c346ba6'
@@ -243,7 +243,7 @@
243243
# IconUri = ''
244244

245245
# ReleaseNotes of this module
246-
ReleaseNotes = 'See CHANGELOG.md and GitHub: https://github.com/JankeUwe/sqmSQLTool/releases/tag/v1.7.1.0'
246+
ReleaseNotes = 'See CHANGELOG.md and GitHub: https://github.com/JankeUwe/sqmSQLTool/releases/tag/v1.7.2.0'
247247

248248
# External module dependencies
249249
ExternalModuleDependencies = @('dbatools')

0 commit comments

Comments
 (0)