@@ -11,7 +11,7 @@ title: New-CIPolicyRule
1111# New-CIPolicyRule
1212
1313## SYNOPSIS
14- Generates Code Integrity policy rules for drivers.
14+ Generates Code Integrity policy rules for user mode code and drivers.
1515
1616## SYNTAX
1717
@@ -33,6 +33,11 @@ New-CIPolicyRule -FilePathRule <String> [-Deny]
3333 [-ScriptFileNames] [<CommonParameters>]
3434```
3535
36+ ### PackagedAppRule
37+ ```
38+ New-CIPolicyRule -Package <String> [-Deny] [<CommonParameters>]
39+ ```
40+
3641## DESCRIPTION
3742The ** New-CIPolicyRule** cmdlet generates Code Integrity policy rules for drivers.
3843Specify a rule level and an array of ** DriverFile** objects or the path of a driver.
@@ -192,6 +197,48 @@ attributes : {[AppIDs, ], [MinimumFileVersion, 0.0.0.0], [FilePath, .\temp\C
192197
193198This command generates a filepath rule for the specific path verbatim string. This will allow anything in the parent folder.
194199
200+ ### Example 5: Create a policy rule for a packaged application and its dependencies
201+ ```
202+ PS C:\> $package = Get-AppxPackage -Name *Microsoft.Whiteboard*
203+ PS C:\> $package_dependencies = $package.Dependencies
204+
205+ PS C:\> $package_rule = New-CIPolicyRule -Package $package
206+ PS C:\> $package_rule += New-CIPolicyRule -Package $dependency[0] # repeat for all dependencies in array
207+
208+ PS C:\> $package_rule
209+
210+
211+ Name : Microsoft.Whiteboard_8wekyb3d8bbwe FileRule
212+ Id : ID_ALLOW_A_D
213+ TypeId : Allow
214+ Root :
215+ FileVersionRef :
216+ AppIDRef :
217+ Wellknown : False
218+ Ekus :
219+ Exceptions :
220+ FileAttributes :
221+ FileException : False
222+ UserMode : True
223+ attributes : {[AppIDs, ], [MinimumFileVersion, 0.0.0.0], [PackageFamilyName, Microsoft.Whiteboard_8wekyb3d8bbwe], [PackageVersion, 21.10503.5662.0]}
224+
225+ Name : Microsoft.NET.Native.Runtime.2.2_8wekyb3d8bbwe FileRule
226+ Id : ID_ALLOW_A_E
227+ TypeId : Allow
228+ Root :
229+ FileVersionRef :
230+ AppIDRef :
231+ Wellknown : False
232+ Ekus :
233+ Exceptions :
234+ FileAttributes :
235+ FileException : False
236+ UserMode : True
237+ attributes : {[AppIDs, ], [MinimumFileVersion, 0.0.0.0], [PackageFamilyName, Microsoft.NET.Native.Runtime.2.2_8wekyb3d8bbwe], [PackageVersion, 2.2.28604.0]}
238+ ```
239+
240+ This set of commands finds a packaged application matching the specified name and generates an allow rule for the packaged application and its dependencies.
241+
195242
196243## PARAMETERS
197244
@@ -293,6 +340,21 @@ Accept pipeline input: False
293340Accept wildcard characters : False
294341` ` `
295342
343+ ### -Package
344+ Specifies the packaged app (MSIX/Appx) to base the rule.
345+
346+ ` ` ` yaml
347+ Type : AppxPackage
348+ Parameter Sets : (All)
349+ Aliases : None
350+
351+ Required : False
352+ Position : Named
353+ Default value : None
354+ Accept pipeline input : False
355+ Accept wildcard characters : False
356+ ` ` `
357+
296358### -ScriptFileNames
297359
298360` ` ` yaml
0 commit comments