Private/Test-OSDCloudTemplate.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
function Test-OSDCloudTemplate {
    <#
    .SYNOPSIS
    Tests if the OSDCloud Template is valid.
 
    .DESCRIPTION
    Tests if the OSDCloud Template is valid.
     
    .LINK
    https://github.com/OSDeploy/OSD/tree/master/Docs
    #>


    [CmdletBinding()]
    param ()

    $TemplatePath = Get-OSDCloudTemplate

    if ($null -eq $TemplatePath) {
        $false
    }
    elseif (-NOT (Test-Path "$TemplatePath")) {
        $false
    }
    elseif (-NOT (Test-Path "$TemplatePath\Media")) {
        $false
    }
    elseif (-NOT (Test-Path "$TemplatePath\Media\sources\boot.wim")) {
        $false
    }
    else {
        $true
    }
}