-
Notifications
You must be signed in to change notification settings - Fork 1
/
Huawei-iBMC-Cmdlets.psm1
74 lines (59 loc) · 2.17 KB
/
Huawei-iBMC-Cmdlets.psm1
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Implement your module commands in this script.
# . $PSScriptRoot/common/Common.ps1
# . $PSScriptRoot/common/Redfish.ps1
# Import all functional scripts
$CommonFunctions = @(Get-ChildItem -Path $PSScriptRoot\common\ -Recurse -Filter *.ps1)
$CommonFunctions | ForEach-Object {
$File = $_.FullName
try {
. $File
} catch {
Write-Error -Message "Failed to import file: $File"
}
}
# Import all User scripts
$UserFunctions = @(Get-ChildItem -Path $PSScriptRoot\scripts\ -Recurse -Filter *.ps1)
$UserFunctions | ForEach-Object {
$File = $_.FullName
try {
. $File
} catch {
Write-Error -Message "Failed to import file: $File"
}
}
function Get-iBMCModuleVersion {
<#
.SYNOPSIS
Gets the module details for the Huawei-iBMC-Cmdlets module.
.DESCRIPTION
Gets the module details for the Huawei-iBMC-Cmdlets module.
.INPUTS
.OUTPUTS
PSObject
Returns module details include Name, Version, Path, Description
.EXAMPLE
Get-iBMCModuleVersion
Name : Huawei-iBMC-Cmdlets
Version : 1.0.1
Path : C:\Program Files\WindowsPowerShell\Modules\Huawei-iBMC-Cmdlets\Huawei-iBMC-Cmdlets.psm1
Description : Huawei iBMC cmdlets provide cmdlets to quick access iBMC Redfish devices.
These cmdlets contains operation used most such as: bois setting, syslog, snmp, network, power and etc.
This example shows the cmdlets module details.
.LINK
https://github.com/Huawei/Huawei-iBMC-Cmdlets
#>
[CmdletBinding(PositionalBinding=$false)]
$module = Get-module | Where-Object {$_.Name -eq 'Huawei-iBMC-Cmdlets'}
$versionObject = New-Object PSObject
# $versionObject | Add-member 'GUID' $module.GUID
$versionObject | Add-member 'Name' $module.Name
$versionObject | Add-member 'Version' $module.Version
$versionObject | Add-member 'Path' $module.Path
$versionObject | Add-member 'Description' $module.Description
return $versionObject
}
# Export only the functions using PowerShell standard verb-noun naming.
# Be sure to list each exported functions in the FunctionsToExport field of the module manifest file.
# This improves performance of command discovery in PowerShell.
# Export-ModuleMember -Function *-*
Export-ModuleMember -Function *-iBMC*