SupportsShouldProcess support on Powershell module commands (WhatIf, Confirm)

Backlog

SupportsShouldProcess support on Powershell module commands (WhatIf, Confirm)

0 vote

avatar

Would be great for testing purposes if the PowerShell cmdlets provided by the RDM PowerShell module used SupportShouldProcess where applicable.
That way one could easily write a script with RDM cmdlet calls and simply run their script with -WhatIf to see what changes would have been made without making them.

All Comments (4)

avatar

Hi,

Do you have a list cmdlets you think SupportShouldProcess and some scripts so we could see exemples of how you would use it with some RDM PowerShell cmdlets?

Most cmdlets in the RDM PowerShell module are New, Set and Get and changes are made by calling the objects attributes without using cmdlets and as long that you don't use a Set cmdlet to save them in the data source, the changes on the objects are only in memory.

Best regards,

Olivier Désalliers

avatar

If the Set commands supported it than that would be a great start.

avatar

The main ones I used were Set-RDMUser and Set-RDMSession.

Right now I end up needing to wrap them in an if ($PSCmdlet.ShouldProcess())

avatar

Hi,

Thank you for your feedback. We will add it to the feature request ticket.

Best regards,

Olivier Désalliers