-
Notifications
You must be signed in to change notification settings - Fork 11
/
GenerateHelp.ps1
26 lines (23 loc) · 1.43 KB
/
GenerateHelp.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
param(
[string] $TargetDir = $(throw "TargetDir is required!"),
[string] $ConfigurationName = $(throw "ConfigurationName is required!")
)
$path = Split-Path -parent $MyInvocation.MyCommand.Definition
$helpAsm = "$($TargetDir)\..\..\ReferenceAssemblies\Lapointe.PowerShell.MamlGenerator.dll"
$cmdletAsm = "$($TargetDir)\Lapointe.SharePointOnline.PowerShell.dll"
Write-Host "Help generation work path: $path"
Write-Host "Help generation maml assembly path: $helpAsm"
Write-Host "Help generation cmdlet assembly path: $cmdletAsm"
#Start-Process "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\gacutil.exe" -ArgumentList "/uf","Lapointe.PowerShell.MamlGenerator"
#Start-Process "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\gacutil.exe" -ArgumentList "/uf","Lapointe.SharePointOnline.PowerShell"
Write-Host "Loading help assembly..."
[System.Reflection.Assembly]::LoadFrom($helpAsm)
Write-Host "Loading cmdlet assembly..."
$asm = [System.Reflection.Assembly]::LoadFrom($cmdletAsm)
$asm
Write-Host "Generating help..."
[Lapointe.PowerShell.MamlGenerator.CmdletHelpGenerator]::GenerateHelp($asm, "$path", $true)
if ($ConfigurationName -eq "Release") {
& "C:\Program Files (x86)\WiX Toolset v3.8\bin\candle.exe" -v -out "$TargetDir\install.wixobj" "$TargetDir\install.wxs"
& "C:\Program Files (x86)\WiX Toolset v3.8\bin\light.exe" -ext WixUIExtension -out "$TargetDir\Lapointe.SharePointOnline.PowerShell.msi" "$TargetDir\install.wixobj"
}