function [<scope:>]<name> [([type]$parameter1[,[type]$parameter2])] { param([type]$parameter1 [,[type]$parameter2]) dynamicparam {<statement list>} begin {<statement list>} process {<statement list>} end {<statement list>} }
[string] $Name ) Process { Write-Host ("Hi $Name !") write-host$Name"today is $(Get-Date)" } }
show-message
结果:
1 2 3 4 5
cmdlet show-Message at command pipeline position 1 Supply values for the following parameters: Name: Dhrub Hi Dhrub ! Dhrub today is 09/01/2021 13:41:12