Created
August 14, 2019 22:31
-
-
Save fluxdigital/c47e6be6b98f7cf19e4be275b2bd450d to your computer and use it in GitHub Desktop.
Create component datasource based on component base path and template path and names
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Create-Component-Datasource([string]$componentBasePath, [string]$templateBasePath, [string]$componentFolderName, [string]$componentName, [string]$componentFolderTemplateName, [string]$componentTemplateName){ | |
###create component folder item### | |
Write-Host "Creating component folder: $($componentBasePath)/$($componentFolderName) with template: $($templateBasePath)/$($componentFolderTemplateName)" | |
$componentFolderItem = New-Item -Path $componentBasePath -Name $componentFolderName -ItemType "$($templateBasePath)/$($componentFolderTemplateName)" | |
###create component item### | |
Write-Host "Creating component: $($componentBasePath)/$($componentFolderItem.Name)/$($componentName) with template: $($templateBasePath)/$($componentTemplateName)" | |
$componentItem = New-Item -Path "$($componentBasePath)/$($componentFolderItem.Name)" -Name $componentName -ItemType "$($templateBasePath)/$($componentTemplateName)" | |
Write-Host "Component Datasource Created: " $componentTemplateName | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment