1
-
1
+ Param (
2
+ [Parameter (Mandatory = $false )]
3
+ [ValidateSet (" Debug" , " Release" )]
4
+ [string ]$BuildConfiguration = " Release"
5
+ )
2
6
$moduleDir = Join-Path - path $PSScriptRoot - ChildPath " Intersight.PowerShell"
3
7
$solutionPath = Join-Path - Path $PSScriptRoot - ChildPath " src\Intersight.PowerShell.sln"
4
- dotnet build $solutionPath - o $moduleDir - c Release
5
-
8
+ Write-host " Build the Intersight.PowerShell module."
9
+ try
10
+ {
11
+ dotnet build $solutionPath - o $moduleDir - c $BuildConfiguration
12
+ }
13
+ catch {
14
+ throw $_.Exception
15
+ Exit 1
16
+ }
6
17
# Check for whether build success or failure
7
18
8
19
if ($LASTEXITCODE -ne 0 ){
9
20
Write-Host " Build failed, PLease fix the code and re-run."
10
21
Exit $LASTEXITCODE
11
22
}
12
23
13
- # Generate the Moudle manifest file
24
+
25
+ # Import the dll and get the list of cmdlet available in the module
26
+ Import-Module - Name $moduleDir \Intersight.PowerShell.dll
27
+ $commandList = Get-Command - Module Intersight.PowerShell
28
+ Remove-module - Name Intersight.PowerShell
29
+
30
+ Write-Host " Generate the Moudle manifest file."
14
31
15
32
$manifestParam = @ {
16
33
Path = Join-Path - Path $moduleDir - ChildPath " Intersight.PowerShell.psd1"
17
34
RootModule = " Intersight.PowerShell.dll"
18
35
Guid = " 41ce1a70-9c4b-489f-a153-12fe49b7fe62"
19
36
Author = " Cisco Systems"
20
37
CompanyName = " Cisco Systems"
21
- ModuleVersion = " 1.0.9.4430 "
38
+ ModuleVersion = " 1.0.9.4437 "
22
39
Copyright = " (c) 2021 Cisco Systems, Inc. All rights reserved."
23
40
LicenseUri = " https://www.apache.org/licenses/LICENSE-2.0.txt"
24
41
ProjectUri = " https://github.com/CiscoDevNet/intersight-powershell"
25
42
CompatiblePSEditions = " Core"
26
43
Tag = @ (' PSEdition_Core' , ' Windows' , ' Linux' , ' MacOSX' , ' Intersight' , ' IntersightCmdlets' )
27
- RequireLicenseAcceptance = $true
28
44
PowerShellVersion = " 7.1"
45
+ CmdletsToExport = $commandList
29
46
Description = " Intersight Powershell module provides the cmdlets to manage, analyze, and automate the IT infrastructure in Intersight."
30
- ReleaseNotes = " Intersight.PowerShell - Version 1.0.9.4430
47
+ ReleaseNotes = " Intersight.PowerShell - Version 1.0.9.4437
31
48
32
49
GettingStarted:-
33
50
https://github.com/CiscoDevNet/intersight-powershell/blob/master/GettingStarted.md
@@ -42,18 +59,18 @@ https://www.intersight.com/help
42
59
}
43
60
44
61
$manifestResult = New-ModuleManifest @manifestParam
62
+ Write-Host " Module manifest created successfully." - ForegroundColor green
45
63
46
- if ($manifestResult ){
47
- Write-Host " Module manifest created successfully." - ForegroundColor green
48
- }
49
-
64
+ Write-Host " Copy module help file to $moduleDir "
50
65
if (Test-Path - Path $moduleDir - PathType Container){
51
66
$externalHelpFilePath = Join-Path - Path $PSScriptRoot - ChildPath " externalHelp\Intersight.PowerShell.dll-help.xml"
52
67
if (Test-Path - Path $externalHelpFilePath ){
53
68
Copy-Item - Path $externalHelpFilePath - Destination $moduleDir
69
+ Write-Host " Successfully copied the help file to $moduleDir ."
54
70
}
55
71
56
72
}
57
73
else {
58
74
Write-Host " Module directory $moduleDir does not exist, cannot copy external help file."
59
75
}
76
+ Write-Host " Intersight.PowerShell module build completed."
0 commit comments