1
+ <#
2
+ Copyright 2016 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 Clear-NSAAASession {
18
+ <#
19
+ . SYNOPSIS
20
+ Clear NetScaler AAA sessions.
21
+
22
+ . DESCRIPTION
23
+ Clear NetScaler AAA sessions.
24
+
25
+ . EXAMPLE
26
+ Clear-NSAAASessions
27
+
28
+ Clears all AAA sessions.
29
+
30
+ . PARAMETER Session
31
+ The NetScaler session object.
32
+
33
+ . PARAMETER Force
34
+ Suppress confirmation when clearing the sessions.
35
+
36
+ . Notes
37
+ Nitro implementation status: partial
38
+ #>
39
+ [cmdletbinding (SupportsShouldProcess = $true , ConfirmImpact = ' High' )]
40
+ param (
41
+ $Session = $Script :Session ,
42
+
43
+ [switch ]$Force
44
+ )
45
+
46
+ begin {
47
+ _AssertSessionActive
48
+ }
49
+ process {
50
+ $ip = $ ($Session.EndPoint )
51
+ if ($Force -or $PSCmdlet.ShouldProcess ($ip , " Clear AAA sessions" )) {
52
+ _InvokeNSRestApi - Session $Session - Method POST - Type aaasession - Action kill - Payload @ { " all" = $True }
53
+ }
54
+ }
55
+ }
0 commit comments