Modifica

Condividi tramite


Set-HVCIOptions

Modifies hypervisor Code Integrity options for a policy.

Syntax

Options

Set-HVCIOptions
    [-FilePath] <String>
    [-Enabled]
    [-Strict]
    [-DebugMode]
    [-DisableAllowed]
    [<CommonParameters>]

None

Set-HVCIOptions
    [-FilePath] <String>
    [-None]
    [<CommonParameters>]

Description

The Set-HVCIOptions cmdlet modifies hypervisor Code Integrity options for a policy. The policy stores these options in the HvciOptions property of the policy. You can specify any combination of the following values:

  • Enabled
  • DebugMode
  • Strict

Examples

Example 1: Assign the Strict option

PS C:\> Set-HVCIOptions -Strict -FilePath '.\Policy.xml'
PS C:\> Get-Content -Path '.Policy.xml'
    <CiSigner SignerId="ID_SIGNER_S_21" />
  </CiSigners>
  <HvciOptions>2</HvciOptions>
</SiPolicy>

The first command assigns the Strict option in Policy.xml.

The second command displays the contents of the policy. This example shows the last few lines of the policy, which include the HvciOptions property. It now has a value of 2.

Parameters

-DebugMode

Indicates that this cmdlet turns on DebugMode in the policy.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

Options
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DisableAllowed

Indicates that this cmdlet allows for HVCI to be disabled by the user outside of the Code Integrity policy enablement method.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

Options
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Enabled

Indicates that this cmdlet turns on Enabled in the policy.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

Options
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-FilePath

Specifies the path of the policy .xml file that this cmdlet modifies.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:f

Parameter sets

(All)
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-None

Indicates that this cmdlet removes all hypervisor Code Integrity options from the policy. In the policy itself, HvciOptions takes a value of zero (0).

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

None
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Strict

Indicates that this cmdlet turns on Strict in the policy.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

Options
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.