Last active
August 21, 2016 19:54
-
-
Save WimObiwan/3336a44f3d0220eeca746dd91f00613c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[CmdletBinding(SupportsShouldProcess)] | |
Param ( | |
... | |
) | |
... | |
$current_item = 'X' | |
if ($PSCmdlet.ShouldProcess($name, "My very dangerous operation on $current_item")) { | |
... | |
} | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Verb-Command | |
{ | |
<# | |
.SYNOPSIS | |
Synopsis | |
.DESCRIPTION | |
Description | |
.PARAMETER Parameter1 | |
Parameter1 | |
.PARAMETER Parameter2 | |
Parameter2 | |
.EXAMPLE | |
Verb-Command -Parameter1 | |
Description | |
----------- | |
This is an example. | |
.EXAMPLE | |
Verb-Command -Parameter2 | |
Description | |
----------- | |
This is another example. | |
.EXAMPLE | |
Verb-Command -Parameter1 -Parameter2 | |
Description | |
----------- | |
This is another example. | |
.INPUTS | |
System.Diagnostics.Process | |
You can pipe a process object to Verb-Command. | |
.OUTPUTS | |
System.IO.FileInfo | |
.LINK | |
http://www.foxinnovations.be/ | |
#> | |
[CmdletBinding()] | |
Param ( | |
[Parameter(Position = 0, Mandatory = $True, ValueFromPipeline = $True)] | |
[System.Diagnostics.Process] | |
$Process, | |
[Parameter(Position = 1)] | |
[ValidateScript({ Test-Path $_ })] | |
[String] | |
$DumpFilePath = $PWD | |
) | |
BEGIN | |
{ | |
} | |
PROCESS | |
{ | |
} | |
END | |
{ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment