1 / 8

Jeffrey Snover | Distinguished Engineer & Lead Architect

08 | Tools that make changes. Jeffrey Snover | Distinguished Engineer & Lead Architect Jason Helmick | Senior Technologist, Concentrated Technology. Module Overview. Tools that need –confirm and – whatif Impact Level Using ShouldProcess A better example. -Confirm and - Whatif.

lisle
Download Presentation

Jeffrey Snover | Distinguished Engineer & Lead Architect

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 08 | Tools that make changes Jeffrey Snover | Distinguished Engineer & Lead Architect Jason Helmick | Senior Technologist, Concentrated Technology

  2. Module Overview • Tools that need –confirm and –whatif • Impact Level • Using ShouldProcess • A better example

  3. -Confirm and -Whatif • These parameters should be supported for any commands that changes the system state in any way. • If you’re writing an advanced function, there’s no need to hand code these parameters. • [CmdletBinding(SupportShouldProcess=$True,ConfirmImpact=“High”)] • Ctrl-J for the template

  4. Impact Level • Values for Impact Level are Low, Medium and High • $WhatIfPreference is set to $False by default. If you change is to $True, then all commands that support –Whatif will run as if whatif has been specified. • $ConfirmPreference is set to High by default. If the command impact level is equal to or higher than the preference, then –Confirm is automatically added

  5. Using ShouldProcess

  6. A better example

  7. Questions or comments?

More Related