external help file | Module Name | online version | schema |
---|---|---|---|
PSFunctionTools-help.xml |
PSFunctionTools |
2.0.0 |
Create a module structure from a layout file.
Import-ModuleLayout [-Name] <String> [-ParentPath <String>] -Layout <String> [-WhatIf] [-Confirm] [<CommonParameters>]
Use Import-ModuleLayout to recreate a module structure from a json file created with Export-ModuleLayout. Importing the json file will recreate the folders and files.
PS C:\> Import-ModuleLayout -Name PSDemo -ParentPath D:\scripts -Layout C:\work\layout.json
Directory: C:\scripts\PSDemo
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 12/16/2021 9:45 AM types
d---- 12/16/2021 9:45 AM .github
d---- 12/16/2021 9:45 AM .vscode
d---- 12/16/2021 9:45 AM docs
...
Directory: D:\scripts\PSDemo\functions
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 12/16/2021 9:45 AM public
d---- 12/16/2021 9:45 AM private
Directory: D:\scripts\PSDemo\functions\public
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 12/16/2021 9:49 AM 276 readme.txt
...
Create the directory structure from C:\work\layout.json under a new path of D:\scripts\PSDemo. The parent path, D:\scripts, must already exist.
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
Specify the path to the module layout json file.
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 your 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? The default is the current location
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: .
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/