-
Notifications
You must be signed in to change notification settings - Fork 42
Add Sample
Adding code elements (function, enum, class, DSC Resource, tests...) to a module's source.
Add-Sample [[-Sample] <String>] [[-DestinationPath] <String>]
[<CommonParameters>]
Add-Sample is an helper function to invoke a plaster template built-in the Sampler module. With this function you can bootstrap your module project by adding classes, functions and associated tests, examples and configuration elements.
Add-Sample -Sample PublicFunction -PublicFunctionName Get-MyStuff
Destination of your module source root folder, defaults to the current directory ".". We assume that your current location is the module folder, and within this folder we will find the source folder, the tests folder and other supporting files.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: .
Accept pipeline input: False
Accept wildcard characters: False
Specifies a sample component based on the Plaster templates embedded with this module. The available types of module elements are: - Classes: A sample of 4 classes with inheritence and how to manage the orders to avoid parsing errors. - ClassResource: A Class-Based DSC Resources showing some best practices including tests, Reasons, localized strings. - Composite: A DSC Composite Resource (a configuration block) packaged the right way to make sure it's visible by Get-DscResource. - Enum: An example of a simple Enum. - MofResource: A sample of a MOF-Based DSC Resource following the DSC Community practices. - PrivateFunction: A sample of a Private function (not exported from the module) and its test. - PublicCallPrivateFunctions: A sample of 2 functions where the exported one (public) calls the private one, with the tests. - PublicFunction: A sample public function and its test.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
This module requires and uses Plaster.
- Add-Sample
- Convert-SamplerHashtableToString
- Get-BuildVersion
- Get-BuiltModuleVersion
- Get-ClassBasedResourceName
- Get-CodeCoverageThreshold
- Get-MofSchemaName
- Get-OperatingSystemShortName
- Get-PesterOutputFileFileName
- Get-Psm1SchemaName
- Get-SamplerAbsolutePath
- Get-SamplerBuiltModuleBase
- Get-SamplerBuiltModuleManifest
- Get-SamplerCodeCoverageOutputFile
- Get-SamplerCodeCoverageOutputFileEncoding
- Get-SamplerModuleInfo
- Get-SamplerModuleRootPath
- Get-SamplerProjectName
- Get-SamplerSourcePath
- Invoke-SamplerGit
- Merge-JaCoCoReport
- New-SampleModule
- New-SamplerJaCoCoDocument
- New-SamplerPipeline
- Out-SamplerXml
- Set-SamplerPSModulePath
- Split-ModuleVersion
- Update-JaCoCoStatistic