Public/New-OftenOnCompositeResource.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
function New-OftenOnCompositeResource {
    [CmdletBinding()]
    param (
        [Parameter(Mandatory)]
        [ValidateNotNullOrEmpty()]
        $ResourceName
    )

    New-Item -ItemType Directory "$PSScriptRoot\..\DSCResources\$ResourceName"
    New-ModuleManifest "$PSScriptRoot\..\DSCResources\$ResourceName\$($ResourceName).psd1" -RootModule ".\$($ResourceName).schema.psm1" -Author "Cody Konior" -CompanyName ""
    $content = "Configuration $ResourceName {
 
}
"

    [System.IO.File]::WriteAllLines("$PSScriptRoot\..\DSCResources\$ResourceName\$($ResourceName).schema.psm1", $content)
    code "$PSScriptRoot\..\DSCResources\$ResourceName\$($ResourceName).schema.psm1"
}