-
Notifications
You must be signed in to change notification settings - Fork 103
Expand file tree
/
Copy pathmakeapp.ps1
More file actions
36 lines (31 loc) · 1.34 KB
/
makeapp.ps1
File metadata and controls
36 lines (31 loc) · 1.34 KB
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
34
35
36
[CmdletBinding()]
param(
[Parameter(Mandatory = $True)] [string] $SourceFolder,
[Parameter(Mandatory = $True)] [string] $SetupFile,
[Parameter(Mandatory = $False)] [string] $OutputFolder = ""
)
# Check NuGet version
$MinimumVersion = [version]'2.8.5.201'
$provider = Get-PackageProvider -Name NuGet -ListAvailable -ErrorAction SilentlyContinue |
Sort-Object Version -Descending |
Select-Object -First 1
if (-not $provider) {
Write-Verbose 'NuGet Provider Package not detected, installing...'
Install-PackageProvider -Name NuGet -Force | Out-Null
} elseif ($provider.Version -lt $MinimumVersion) {
Write-Verbose "NuGet provider v$($provider.Version) is less than required v$MinimumVersion; updating."
Install-PackageProvider -Name NuGet -Force | Out-Null
} else {
Write-Verbose "NuGet provider meets min requirements (v:$($provider.Version))."
}
# Install and import the module to create the .intunewin file
Install-Module SvRooij.ContentPrep.Cmdlet -MinimumVersion 0.4.0
Import-Module SvRooij.ContentPrep.Cmdlet
# Create the .intunewin file
if ($OutputFolder -eq "") {
$OutputFolder = $PSScriptRoot
}
if (Test-Path "$OutputFolder\AutopilotBranding.intunewin") {
Remove-Item "$OutputFolder\AutopilotBranding.intunewin"
}
New-IntuneWinPackage -SourcePath $SourceFolder -SetupFile $SetupFile -DestinationPath $OutputFolder