external help file | Module Name | online version | schema |
---|---|---|---|
PSFunctionTools-help.xml |
PSFunctionTools |
2.0.0 |
Creat a new module based on a layout.
New-ModuleFromLayout [-NewModuleName] <String> [-ParentPath] <String> -Description <String> -Layout <String> [-FunctionPath <String>] [-WhatIf] [-Confirm] [-InitializeGit] [<CommonParameters>]
This command is very similar to New-ModuleFromFiles. That function builds a module structure from existing files. This function creates a new module but without defining any commands. New-ModuleFromLayout will still create a module structure based on a layout and it will still create module files. Specifically,the module manifest and root module files.
If git.exe is detected, you can use the InitializeGit dynamic parameter to initialize the module as a git repository.
PS C:\> New-ModuleFromLayout -NewModuleName PSDataResource -ParentPath c:\scripts -Description "A class-based DSC resource to do something." -Layout .c:\scripts\DSCModuleLayout.json
Create a new and empty module under C:\Scripts\PSDataResource using the layout file c:\scripts\dscmodulelayout.json.
Prompts you for confirmation before running the cmdlet.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Enter a module description.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specify the relative path where your functions will be created.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: functions
Accept pipeline input: False
Accept wildcard characters: False
Initialize the new module as a git repository. This is a dynamic parameter that only exists if git.exe is detected.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specify the module layout json file created with Export-ModuleLayout.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
What is the name of the new module?
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
What is the parent path for the new module? It must already exist.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: none
Accept pipeline input: False
Accept wildcard characters: False
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
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.
Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell-resources/