MattsHelloWorld.psm1
Write-Verbose 'Importing from [C:\MyProjects\MattsHelloWorld\MattsHelloWorld\private]' Write-Verbose 'Importing from [C:\MyProjects\MattsHelloWorld\MattsHelloWorld\public]' # .\MattsHelloWorld\public\Get-MattsHelloWorld.ps1 function Get-MattsHelloWorld { <# .SYNOPSIS Short description .DESCRIPTION Adding a different description .EXAMPLE Example of how to use this cmdlet .EXAMPLE Another example of how to use this cmdlet .INPUTS Inputs to this cmdlet (if any) .OUTPUTS Output from this cmdlet (if any) .NOTES General notes .COMPONENT The component this cmdlet belongs to .ROLE The role this cmdlet belongs to .FUNCTIONALITY The functionality that best describes this cmdlet #> [CmdletBinding(DefaultParameterSetName = 'Parameter Set 1', SupportsShouldProcess = $true, PositionalBinding = $false, ConfirmImpact = 'Medium')] [Alias()] [OutputType([String])] Param ( # Param1 help description [Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, ValueFromRemainingArguments = $false, ParameterSetName = 'Parameter Set 1')] [ValidateNotNull()] [ValidateNotNullOrEmpty()] [ValidateCount(0, 5)] [ValidateSet("sun", "moon", "earth")] [Alias("p1")] $Param1, # Param2 help description [Parameter(ParameterSetName = 'Parameter Set 1')] [AllowNull()] [AllowEmptyCollection()] [AllowEmptyString()] [ValidateScript( { $true })] [ValidateRange(0, 5)] [int] $Param2, # Param3 help description [Parameter(ParameterSetName = 'Another Parameter Set')] [ValidatePattern("[a-z]*")] [ValidateLength(0, 15)] [String] $Param3 ) begin { } process { if ($pscmdlet.ShouldProcess("Target", "Operation")) { "Hello, Matt's world!" } } end { } } # .\MattsHelloWorld\public\Get-MattsHelloWorld2.ps1 function Get-MattsHelloWorld2 { <# .SYNOPSIS Short description .DESCRIPTION Adding a different description .EXAMPLE Example of how to use this cmdlet .EXAMPLE Another example of how to use this cmdlet .INPUTS Inputs to this cmdlet (if any) .OUTPUTS Output from this cmdlet (if any) .NOTES General notes .COMPONENT The component this cmdlet belongs to .ROLE The role this cmdlet belongs to .FUNCTIONALITY The functionality that best describes this cmdlet #> [CmdletBinding(DefaultParameterSetName = 'Parameter Set 1', SupportsShouldProcess = $true, PositionalBinding = $false, ConfirmImpact = 'Medium')] [Alias()] [OutputType([String])] Param ( # Param1 help description [Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, ValueFromRemainingArguments = $false, ParameterSetName = 'Parameter Set 1')] [ValidateNotNull()] [ValidateNotNullOrEmpty()] [ValidateCount(0, 5)] [ValidateSet("sun", "moon", "earth")] [Alias("p1")] $Param1, # Param2 help description [Parameter(ParameterSetName = 'Parameter Set 1')] [AllowNull()] [AllowEmptyCollection()] [AllowEmptyString()] [ValidateScript( { $true })] [ValidateRange(0, 5)] [int] $Param2, # Param3 help description [Parameter(ParameterSetName = 'Another Parameter Set')] [ValidatePattern("[a-z]*")] [ValidateLength(0, 15)] [String] $Param3 ) begin { } process { if ($pscmdlet.ShouldProcess("Target", "Operation")) { "Hello, Matt's world 2!" } } end { } } Write-Verbose 'Importing from [C:\MyProjects\MattsHelloWorld\MattsHelloWorld\classes]' |