Skip to content

Commit e0c7a20

Browse files
committed
Updated New-CIPolicy to include the multiplepolicyformat switch. Modified the first example to be multi-format
1 parent 1c5c820 commit e0c7a20

File tree

1 file changed

+25
-7
lines changed

1 file changed

+25
-7
lines changed

docset/winserver2022-ps/configci/New-CIPolicy.md

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ Creates a Code Integrity policy as an .xml file.
1919
```
2020
New-CIPolicy [-FilePath] <String> [-DriverFiles <DriverFile[]>] -Level <RuleLevel> [-Fallback <RuleLevel[]>]
2121
[-Audit] [-ScanPath <String>] [-ScriptFileNames] [-UserPEs] [-NoScript] [-Deny] [-NoShadowCopy]
22-
[-OmitPaths <String[]>] [-PathToCatroot <String>] [<CommonParameters>]
22+
[-OmitPaths <String[]>] [-PathToCatroot <String>] [-MultiplePolicyFormat] [<CommonParameters>]
2323
```
2424

2525
### Rules
2626
```
2727
New-CIPolicy [-FilePath] <String> -Rules <Rule[]> [-Audit] [-ScanPath <String>] [-ScriptFileNames] [-UserPEs]
28-
[-NoScript] [-Deny] [-NoShadowCopy] [-OmitPaths <String[]>] [-PathToCatroot <String>] [<CommonParameters>]
28+
[-NoScript] [-Deny] [-NoShadowCopy] [-OmitPaths <String[]>] [-PathToCatroot <String>] [-MultiplePolicyFormat] [<CommonParameters>]
2929
```
3030

3131
## DESCRIPTION
@@ -43,18 +43,18 @@ If you specify the **Audit** parameter, this cmdlet scans the Code Integrity Aud
4343

4444
## EXAMPLES
4545

46-
### Example 1: Create a policy
46+
### Example 1: Create a policy in multiple policy format
4747
```
48-
The first command scans for user-mode executables (applications) along with kernel-mode binaries such as drivers and creates rules at the Publisher level. The command creates a policy and stores it in the file that is named Policy.xml. This command specifies the **OmitPaths** parameter to exclude files in the temp\ConfigCITestBinaries folder. The command specifies the **NoScript** parameter so that it gets information for only PE files.
49-
PS C:\> New-CIPolicy -ScanPath '.\temp\' -UserPEs -OmitPaths '.\temp\ConfigCITestBinaries' -NoScript -FilePath '.\Policy.xml' -Level Publisher
48+
PS C:\> New-CIPolicy -ScanPath '.\temp\' -UserPEs -OmitPaths '.\temp\ConfigCITestBinaries' -NoScript -FilePath '.\Policy.xml' -Level Publisher -MultiplePolicyFormat
5049
Scan completed successfully
5150
5251
The second command displays the contents of the policy.
5352
PS C:\> Get-Content -Path '.\policy.xml'
5453
<?xml version="1.0" encoding="utf-8"?>
55-
<SiPolicy xmlns="urn:schemas-microsoft-com:sipolicy">
54+
<SiPolicy xmlns="urn:schemas-microsoft-com:sipolicy" PolicyType="Base Policy">
5655
<VersionEx>10.0.0.0</VersionEx>
57-
<PolicyTypeID>{A244370E-44C9-4C06-B551-F6016E563076}</PolicyTypeID>
56+
<BasePolicyID>{BB9EC112-DD85-41AD-9778-22680D3D8A22}</BasePolicyID>
57+
<PolicyID>{BB9EC112-DD85-41AD-9778-22680D3D8A22}</PolicyID>
5858
<PlatformID>{2E07F7E4-194C-4D20-B7C9-6F44A6C5A234}</PlatformID>
5959
<Rules>
6060
<Rule>
@@ -210,6 +210,8 @@ Hash="DA737C142A51A73D82E6AD677474C8031486FDEF018A6FE9D178564F83AB284B" />
210210
</SiPolicy>
211211
```
212212

213+
The first command scans for user-mode executables (applications) along with kernel-mode binaries such as drivers and creates rules at the Publisher level. The command creates a policy in multiple policy format and stores it in the file that is named Policy.xml. This command specifies the **OmitPaths** parameter to exclude files in the temp\ConfigCITestBinaries folder. The command specifies the **NoScript** parameter so that it gets information for only PE files.
214+
213215
### Example 2: Scan unsigned files
214216
```
215217
PS C:\> New-CIPolicy -ScanPath '.\temp\' -UserPEs -FilePath ".\policy.xml" -Level Publisher -Fallback Hash
@@ -539,6 +541,22 @@ Accept pipeline input: False
539541
Accept wildcard characters: False
540542
```
541543
544+
### -MultiplePolicyFormat
545+
Indicates that this cmdlet should create a policy in multiple policy format as opposed to a single policy format.
546+
Refer to [Create WDAC policies in Multiple Policy Format](https://docs.microsoft.com/en-us/windows/security/threat-protection/windows-defender-application-control/deploy-multiple-windows-defender-application-control-policies#creating-wdac-policies-in-multiple-policy-format) for the difference between the policy formats.
547+
548+
```yaml
549+
Type: SwitchParameter
550+
Parameter Sets: (All)
551+
Aliases: None
552+
553+
Required: False
554+
Position: Named
555+
Default value: None
556+
Accept pipeline input: False
557+
Accept wildcard characters: False
558+
```
559+
542560
### CommonParameters
543561
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
544562

0 commit comments

Comments
 (0)