Skip to content

Commit 38904ec

Browse files
committed
Added Get-NSHardware to retrieve host IDs
1 parent 1560056 commit 38904ec

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

NetScaler/NetScaler.psd1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ FunctionsToExport = @(
111111
'Get-NSDnsNameServer',
112112
'Get-NSDnsSuffix',
113113
'Get-NSFeature',
114+
'Get-NSHardware',
114115
'Get-NSHostname',
115116
'Get-NSIPResource',
116117
'Get-NSIP6Resource',
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<#
2+
Copyright 2017 Dominique Broeglin
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
#>
16+
17+
function Get-NSHardware {
18+
<#
19+
.SYNOPSIS
20+
Gets the hardware information for the NetScaler appliance.
21+
22+
.DESCRIPTION
23+
Gets the hardware information for the NetScaler appliance.
24+
25+
.EXAMPLE
26+
Get-NSHardware
27+
28+
Get the NetScaler hardware information.
29+
30+
.EXAMPLE
31+
Get-NSHardware | Select-Object -ExpandProperty host
32+
33+
Get the NetScaler host ID (used for licenses). For some reason the 'hostid' property contains
34+
another, numeric, value.
35+
36+
.PARAMETER Session
37+
The NetScaler session object.
38+
39+
#>
40+
[cmdletbinding()]
41+
param(
42+
$Session = $script:session
43+
)
44+
45+
begin {
46+
_AssertSessionActive
47+
}
48+
49+
process {
50+
_InvokeNSRestApiGet -Session $Session -Type nshardware
51+
}
52+
}

0 commit comments

Comments
 (0)