Skip to content

Commit 27b807f

Browse files
authored
Merge pull request MicrosoftDocs#3356 from Spoonsk/3328-hgsclient-module
Quality: PowerShell Summit MicrosoftDocsGH-3328
2 parents cd27464 + 15ed2ad commit 27b807f

12 files changed

+230
-155
lines changed

docset/winserver2022-ps/hgsclient/ConvertTo-HgsKeyProtector.md

+57-39
Original file line numberDiff line numberDiff line change
@@ -11,54 +11,61 @@ title: ConvertTo-HgsKeyProtector
1111
# ConvertTo-HgsKeyProtector
1212

1313
## SYNOPSIS
14+
1415
Converts a key protector into a Host Guardian Service key protector.
1516

1617
## SYNTAX
1718

1819
```
19-
ConvertTo-HgsKeyProtector [-Bytes] <Byte[]> [-CimSession <CimSession[]>] [-ThrottleLimit <Int32>] [-AsJob]
20-
[<CommonParameters>]
20+
ConvertTo-HgsKeyProtector [-Bytes] <Byte[]> [-CimSession <CimSession[]>] [-ThrottleLimit <Int32>]
21+
[-AsJob] [<CommonParameters>]
2122
```
2223

2324
## DESCRIPTION
24-
The **ConvertTo-HgsKeyProtector** cmdlet converts an existing key protector into a Host Guardian Service key protector object.
25-
Specify the existing key protector as a byte array.
26-
You might use this cmdlet to import a key protector from a virtual machine configuration file.
25+
26+
The `ConvertTo-HgsKeyProtector` cmdlet converts an existing key protector into a Host Guardian
27+
Service key protector object. Specify the existing key protector as a byte array. You might use
28+
this cmdlet to import a key protector from a virtual machine configuration file.
2729

2830
## EXAMPLES
2931

3032
### Example 1: Convert a key protector
31-
```
32-
PS C:\> $VirtualTPM = Get-VMTPM -Name "Shielded Virtual Machine 17"
33-
PS C:\> $VirtualMachineKeyProtector = $VirtualTPM.KeyProtector
34-
PS C:\> $KeyProtector = ConvertTo-HgsKeyProtector -Bytes $VirtualMachineKeyProtector
33+
34+
```powershell
35+
$VirtualTPM = Get-VMTPM -Name "Shielded Virtual Machine 17"
36+
$VirtualMachineKeyProtector = $VirtualTPM.KeyProtector
37+
$KeyProtector = ConvertTo-HgsKeyProtector -Bytes $VirtualMachineKeyProtector
3538
```
3639

37-
The first command gets the Trusted Platform Module (TPM) object for the virtual machine named Shielded Virtual Machine 17.
38-
The command stores the object in the **$VirtualTPM** variable.
40+
The first command gets the Trusted Platform Module (TPM) object for the virtual machine named
41+
Shielded Virtual Machine 17. The command stores the object in the `$VirtualTPM` variable.
3942

40-
The second command stores the **KeyProtector** property of the object stored in **$VirtualTPM** in the **$VirtualMachineKeyProtector** variable.
43+
The second command stores the **KeyProtector** property of the object stored in `$VirtualTPM` in
44+
the `$VirtualMachineKeyProtector` variable.
4145

42-
The final command creates a Host Guardian Service key protector object from the byte array representation stored in **$VirtualMachineKeyProtector**.
43-
The command stores the new key protector in the **$KeyProtector** variable.
46+
The final command creates a Host Guardian Service key protector object from the byte array
47+
representation stored in `$VirtualMachineKeyProtector`. The command stores the new key protector
48+
in the `$KeyProtector` variable.
4449

4550
## PARAMETERS
4651

4752
### -AsJob
48-
Runs the cmdlet as a background job. Use this parameter to run commands that take a long time to complete.
4953

50-
The cmdlet immediately returns an object that represents the job and then displays the command prompt.
51-
You can continue to work in the session while the job completes.
52-
To manage the job, use the `*-Job` cmdlets.
53-
To get the job results, use the [Receive-Job](https://go.microsoft.com/fwlink/?LinkID=113372) cmdlet.
54+
Runs the cmdlet as a background job. Use this parameter to run commands that take a long time to
55+
complete.
5456

55-
For more information about Windows PowerShell background jobs, see [about_Jobs](https://go.microsoft.com/fwlink/?LinkID=113251).
57+
The cmdlet immediately returns an object that represents the job and then displays the command
58+
prompt. You can continue to work in the session while the job completes. To manage the job, use the
59+
`*-Job` cmdlets. To get the job results, use the
60+
[Receive-Job](https://go.microsoft.com/fwlink/?LinkID=113372) cmdlet.
5661

62+
For more information about Windows PowerShell background jobs, see
63+
[about_Jobs](https://go.microsoft.com/fwlink/?LinkID=113251).
5764

5865
```yaml
59-
Type: SwitchParameter
66+
Type: System.Management.Automation.SwitchParameter
6067
Parameter Sets: (All)
61-
Aliases:
68+
Aliases:
6269

6370
Required: False
6471
Position: Named
@@ -68,13 +75,14 @@ Accept wildcard characters: False
6875
```
6976
7077
### -Bytes
71-
Specifies the existing key protector as a byte array.
72-
This cmdlet generates a key protector object from the existing key protector that this parameter specifies.
78+
79+
Specifies the existing key protector as a byte array. This cmdlet generates a key protector object
80+
from the existing key protector that this parameter specifies.
7381
7482
```yaml
75-
Type: Byte[]
83+
Type: System.Byte[]
7684
Parameter Sets: (All)
77-
Aliases:
85+
Aliases:
7886

7987
Required: True
8088
Position: 1
@@ -84,12 +92,14 @@ Accept wildcard characters: False
8492
```
8593
8694
### -CimSession
87-
Runs the cmdlet in a remote session or on a remote computer.
88-
Enter a computer name or a session object, such as the output of a [New-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227967) or [Get-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227966) cmdlet.
89-
The default is the current session on the local computer.
95+
96+
Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session
97+
object, such as the output of a [New-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227967)
98+
or [Get-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227966) cmdlet. The default is the
99+
current session on the local computer.
90100
91101
```yaml
92-
Type: CimSession[]
102+
Type: Microsoft.Management.Infrastructure.CimSession[]
93103
Parameter Sets: (All)
94104
Aliases: Session
95105

@@ -101,14 +111,17 @@ Accept wildcard characters: False
101111
```
102112
103113
### -ThrottleLimit
104-
Specifies the maximum number of concurrent operations that can be established to run the cmdlet.
105-
If this parameter is omitted or a value of `0` is entered, then Windows PowerShell® calculates an optimum throttle limit for the cmdlet based on the number of CIM cmdlets that are running on the computer.
106-
The throttle limit applies only to the current cmdlet, not to the session or to the computer.
114+
115+
Specifies the maximum number of concurrent operations that can be established to run the cmdlet. If
116+
this parameter is omitted or a value of `0` is entered, then Windows PowerShell calculates an
117+
optimum throttle limit for the cmdlet based on the number of CIM cmdlets that are running on the
118+
computer. The throttle limit applies only to the current cmdlet, not to the session or to the
119+
computer.
107120

108121
```yaml
109-
Type: Int32
122+
Type: System.Int32
110123
Parameter Sets: (All)
111-
Aliases:
124+
Aliases:
112125
113126
Required: False
114127
Position: Named
@@ -118,21 +131,26 @@ Accept wildcard characters: False
118131
```
119132

120133
### CommonParameters
121-
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
134+
135+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
136+
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
137+
-WarningAction, and -WarningVariable. For more information, see
138+
[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
122139

123140
## INPUTS
124141

125142
## OUTPUTS
126143

127144
### Microsoft.Management.Infrastructure.CimInstance#MSFT_HgsKeyProtector
145+
128146
This cmdlet returns a key protector.
129147

130-
The `Microsoft.Management.Infrastructure.CimInstance` object is a wrapper class that displays Windows Management Instrumentation (WMI) objects.
131-
The path after the pound sign (`#`) provides the namespace and class name for the underlying WMI object.
148+
The **Microsoft.Management.Infrastructure.CimInstance** object is a wrapper class that displays
149+
Windows Management Instrumentation (WMI) objects. The path after the pound sign (`#`) provides the
150+
namespace and class name for the underlying WMI object.
132151

133152
## NOTES
134153

135154
## RELATED LINKS
136155

137156
[New-HgsKeyProtector](./New-HgsKeyProtector.md)
138-

docset/winserver2022-ps/hgsclient/Export-HgsGuardian.md

+19-10
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,32 @@ Export-HgsGuardian [-InputObject] <CimInstance> [-Path] <String> [<CommonParamet
2020
```
2121

2222
## DESCRIPTION
23-
The **Export-HgsGuardian** cmdlet exports a guardian that contains public keys to an .xml file.
23+
24+
The `Export-HgsGuardian` cmdlet exports a guardian that contains public keys to an `.xml` file.
2425

2526
## EXAMPLES
2627

2728
### Example 1: Export a guardian
28-
```
29-
PS C:\> Get-HgsGuardian -Name "Guardian11" | Export-HGsGuardian -Path "C:\LocalHGSFiles\Guardian11.xml"
29+
30+
```powershell
31+
Get-HgsGuardian -Name 'Guardian11' |
32+
Export-HGsGuardian -Path 'C:\LocalHGSFiles\Guardian11.xml'
3033
```
3134

32-
This command uses the **Get-HgsGuardian** cmdlet to get the guardian named Guardian11, and then passes the object to the current cmdlet by using the pipeline operator.
33-
That cmdlet exports the guardian to the specified file.
35+
This command uses the `Get-HgsGuardian` cmdlet to get the guardian named `Guardian11`, and then
36+
passes the object to the current cmdlet by using the pipeline operator. That cmdlet exports the
37+
guardian to the specified file.
3438

3539
## PARAMETERS
3640

3741
### -InputObject
38-
Specifies the input to this cmdlet.
42+
43+
Specifies the input to this cmdlet.
44+
3945
You can use this parameter, or you can pipe the input to this cmdlet.
4046

4147
```yaml
42-
Type: CimInstance
48+
Type: Microsoft.Management.Infrastructure.CimInstance
4349
Parameter Sets: (All)
4450
Aliases: Guardian
4551

@@ -51,10 +57,11 @@ Accept wildcard characters: False
5157
```
5258
5359
### -Path
60+
5461
Specifies the path to the file to write an XML representation of the guardian.
5562
5663
```yaml
57-
Type: String
64+
Type: System.String
5865
Parameter Sets: (All)
5966
Aliases: FilePath
6067

@@ -66,7 +73,10 @@ Accept wildcard characters: False
6673
```
6774
6875
### CommonParameters
69-
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
76+
77+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
78+
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
79+
-WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
7080
7181
## INPUTS
7282
@@ -83,4 +93,3 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
8393
[New-HgsGuardian](./New-HgsGuardian.md)
8494
8595
[Remove-HgsGuardian](./Remove-HgsGuardian.md)
86-

docset/winserver2022-ps/hgsclient/Get-HgsAttestationBaselinePolicy.md

+25-15
Original file line numberDiff line numberDiff line change
@@ -26,31 +26,35 @@ Get-HgsAttestationBaselinePolicy [-Console] [-SkipValidation] [<CommonParameters
2626
```
2727

2828
## DESCRIPTION
29-
The **Get-HgsAttestationBaselinePolicy** cmdlet generates an attestation baseline policy.
30-
You can use the policy to configure the attestation service.
3129

32-
This cmdlet gets a byte array that represents the attestation baseline policy from the raw data of the last full boot from the Trusted Computing Group log of the Trusted Platform Module (TPM).
30+
The `Get-HgsAttestationBaselinePolicy` cmdlet generates an attestation baseline policy. You can use
31+
the policy to configure the attestation service.
32+
33+
This cmdlet gets a byte array that represents the attestation baseline policy from the raw data of
34+
the last full boot from the Trusted Computing Group log of the Trusted Platform Module (TPM).
3335

3436
Be sure to run this cmdlet on a host that is known to have good configuration.
3537

3638
## EXAMPLES
3739

3840
### Example 1: Generate a baseline policy
39-
```
40-
PS C:\> Get-HgsAttestationBaselinePolicy -Path "C:\Logs\AttestationBaselinePolicy001" -Force
41+
42+
```powershell
43+
Get-HgsAttestationBaselinePolicy -Path 'C:\Logs\AttestationBaselinePolicy001' -Force
4144
```
4245

43-
This command generates a byte array that represents the baseline policy in the file C:\Logs\AttestationBaselinePolicy001.
46+
This command generates a byte array that represents the baseline policy in the file `C:\Logs\AttestationBaselinePolicy001`.
4447

4548
## PARAMETERS
4649

4750
### -Console
51+
4852
Indicates that this cmdlet operates in console mode.
4953

5054
```yaml
51-
Type: SwitchParameter
55+
Type: System.Management.Automation.SwitchParameter
5256
Parameter Sets: Console
53-
Aliases:
57+
Aliases:
5458

5559
Required: True
5660
Position: Named
@@ -60,12 +64,13 @@ Accept wildcard characters: False
6064
```
6165
6266
### -Force
67+
6368
Indicates that this cmdlet overwrites an existing file that the **Output** object specifies.
6469
6570
```yaml
66-
Type: SwitchParameter
71+
Type: System.Management.Automation.SwitchParameter
6772
Parameter Sets: File
68-
Aliases:
73+
Aliases:
6974

7075
Required: False
7176
Position: Named
@@ -75,11 +80,12 @@ Accept wildcard characters: False
7580
```
7681
7782
### -Path
83+
7884
Specifies a file path.
7985
This cmdlet writes the policy to the file that this parameter specifies.
8086
8187
```yaml
82-
Type: String
88+
Type: System.String
8389
Parameter Sets: File
8490
Aliases: FilePath
8591

@@ -91,12 +97,13 @@ Accept wildcard characters: False
9197
```
9298
9399
### -SkipValidation
100+
94101
Indicates that this cmdlet skips validation.
95102
96103
```yaml
97-
Type: SwitchParameter
104+
Type: System.Diagnostics.Switch
98105
Parameter Sets: (All)
99-
Aliases:
106+
Aliases:
100107

101108
Required: False
102109
Position: Named
@@ -106,7 +113,11 @@ Accept wildcard characters: False
106113
```
107114
108115
### CommonParameters
109-
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
116+
117+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
118+
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
119+
-WarningAction, and -WarningVariable. For more information, see
120+
[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
110121
111122
## INPUTS
112123
@@ -117,4 +128,3 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
117128
## NOTES
118129
119130
## RELATED LINKS
120-

0 commit comments

Comments
 (0)