Skip to content

Commit b20be37

Browse files
committed
Correct function metadata
1 parent b0e44f3 commit b20be37

File tree

1 file changed

+36
-38
lines changed

1 file changed

+36
-38
lines changed

VBScript/02_Upfront_Encapsulated_Code_With_No_Dependencies/GetTPMInstances.vbs

Lines changed: 36 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,60 @@
11
Function GetTPMInstances(ByRef arrTPMInstances)
2-
'region FunctionMetadata ####################################################
3-
' Assuming that objWMINamespace represents a successful connection to the a TPM WMI
4-
' namespace, this function retrieves the available TPM instances as objects of the class
2+
'region FunctionMetadata #######################################################
3+
' This function retrieves the available TPM instances as objects of the class
54
' Win32_Tpm. Typically, there is only one TPM available on a computer.
65
'
7-
' The function takes two positional arguments:
8-
' - The first argument (arrTPMInstances) is populated upon success with a collection of
9-
' TPM instances of the type Win32_Tpm
10-
' - The second argument (objWMINamespace) is a WMI Namespace connection argument that must
11-
' already be connected to the WMI namespace root\cimv2\Security\MicrosoftTpm
6+
' The function takes one positional argument (arrTPMInstances), which is populated
7+
' upon success with a collection of TPM instances of the type Win32_Tpm
128
'
13-
' The function returns the number of TPM instances retrieved. A successful function call
14-
' returns a positive integer. The function will return 0 if no error occurred, but no TPMs
15-
' were present. Finally, the function returns a negative integer if an error occurs.
9+
' The function returns the number of TPM instances retrieved. A successful function
10+
' call returns a positive integer. The function will return 0 if no error occurred,
11+
' but no TPMs were present. Finally, the function returns a negative integer if an
12+
' error occurs.
1613
'
1714
' Example:
1815
' intReturnCode = GetTPMInstances(arrTPMInstances)
1916
' If intReturnCode > 0 Then
2017
' ' At least one TPM was retrieved successfully
2118
' End If
2219
'
23-
' Version: 1.0.20210615.0
24-
'endregion FunctionMetadata ####################################################
20+
' Version: 1.0.20210615.1
21+
'endregion FunctionMetadata #######################################################
2522

26-
'region License ####################################################
23+
'region License ################################################################
2724
' Copyright 2021 Frank Lesniak
2825
'
29-
' Permission is hereby granted, free of charge, to any person obtaining a copy of this
30-
' software and associated documentation files (the "Software"), to deal in the Software
31-
' without restriction, including without limitation the rights to use, copy, modify, merge,
32-
' publish, distribute, sublicense, and/or sell copies of the Software, and to permit
33-
' persons to whom the Software is furnished to do so, subject to the following conditions:
26+
' Permission is hereby granted, free of charge, to any person obtaining a copy of
27+
' this software and associated documentation files (the "Software"), to deal in the
28+
' Software without restriction, including without limitation the rights to use,
29+
' copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
30+
' Software, and to permit persons to whom the Software is furnished to do so,
31+
' subject to the following conditions:
3432
'
35-
' The above copyright notice and this permission notice shall be included in all copies or
36-
' substantial portions of the Software.
33+
' The above copyright notice and this permission notice shall be included in all
34+
' copies or substantial portions of the Software.
3735
'
38-
' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
39-
' INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
40-
' PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
41-
' FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
42-
' OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
43-
' DEALINGS IN THE SOFTWARE.
44-
'endregion License ####################################################
36+
' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
37+
' IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
38+
' FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
39+
' COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
40+
' AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
41+
' WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
42+
'endregion License ################################################################
4543

46-
'region DownloadLocationNotice ####################################################
47-
' The most up-to-date version of this script can be found on the author's GitHub repository
48-
' at https://github.com/franklesniak/sysadmin-accelerator
49-
'endregion DownloadLocationNotice ####################################################
44+
'region DownloadLocationNotice #################################################
45+
' The most up-to-date version of this script can be found on the author's GitHub
46+
' repository at https://github.com/franklesniak/sysadmin-accelerator
47+
'endregion DownloadLocationNotice #################################################
5048

51-
'region Acknowledgements ####################################################
52-
' Microsoft and Sven Aelterman, for providing ZTICheckForTPM/ZTICheckForTPM_v2, which
53-
' inspired this approach.
54-
'endregion Acknowledgements ####################################################
49+
'region Acknowledgements #######################################################
50+
' Microsoft and Sven Aelterman, for providing ZTICheckForTPM/ZTICheckForTPM_v2,
51+
' which inspired this approach.
52+
'endregion Acknowledgements #######################################################
5553

56-
'region DependsOn ####################################################
54+
'region DependsOn ##############################################################
5755
' ConnectLocalTPMWMINamespace()
5856
' GetTPMInstancesUsingWMINamespace()
59-
'endregion DependsOn ####################################################
57+
'endregion DependsOn ##############################################################
6058

6159
Dim intFunctionReturn
6260
Dim intReturnMultiplier

0 commit comments

Comments
 (0)