Skip to content
ConsoleMonster
Cmdlet

Show-ConsoleChanges

Module ConsoleMonster
Inputs
None
Outputs
System.Boolean

Shows the changes an action would make and asks before making them: the what-if pattern.

Syntax

Show-ConsoleChanges [-After] <Object[]> [-Before] <Object[]> [-Force] [-Ignore <String[]>] [-Property <String[]>] [-Question <String>] [-Title <Object>] [-TypedConfirmation <String>] [-View <Full|Summary|Table|SideBySide|Unified>] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Description

Shows the changes an action would make and asks before making them: the what-if pattern.

Compares -Before with -After (as Compare-ConsoleObject does), shows the preview, then asks for confirmation and returns $true or $false; act only on $true. Changes that remove objects need the number of removals typed (or the -TypedConfirmation text). It honours the caller's -WhatIf: the preview is shown and $false returned without asking. -Force (or -Confirm:$false) skips the question and returns $true when there are changes. Use it inside your own functions: if (Show-ConsoleChanges -Before $current -After $planned -Property Name) { apply }.

Examples

Authored help example

EXAMPLE 1

Show-ConsoleChanges -Before @('Value') -After @('Value')

Parameters

-After Object[] requiredposition: 1
The objects after the change.
-Before Object[] requiredposition: 0
The current objects.
-Force SwitchParameter optional
Skips the question and returns $true when there are changes.
-Ignore String[] optional
Properties or paths left out of the comparison.
-Property String[] optional
The properties that identify an object (matching key).
-Question String optional
The question (default "Apply these changes?").
-Title Object optional
A title (markup).
-TypedConfirmation String optional
Text that must be typed to confirm (for example the name of what is changed).
-View ChangeViewMode optional
The view of the preview: Full (default), Summary, Table, SideBySide or Unified.
Possible values: Full, Summary, Table, SideBySide, Unified

Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see about_CommonParameters.