Skip to content

Convertfrom-cipolicy cmdlet error isn't being displayed on the console in PowerShell 7.3.3 #19223

@HotCakeX

Description

@HotCakeX

Prerequisites

Steps to reproduce

SupplementalPolicy.zip

Download the SupplementalPolicy.zip file I uploaded, it has a WDAC supplemental policy (.XML file) that has a wrong rule in it. If I run the command below in PowerShell 7.3.3, I don't see any errors and the cmdlet just silently doesn't create the .cip file.

ConvertFrom-CIPolicy .\SupplementalPolicy.xml '{C791D8CB-14C4-4D01-B858-C671C3995287}.cip'

But If I run the same command in Windows PowerShell 5.1, it successfully shows me the error message and tells me what's wrong with the XML file.

I upload the XML file myself because explaining how to create it needs a whole blog post.

Expected behavior

This error should be shown on the console:


ConvertFrom-CIPolicy : Only base policies can have SupplementalSigners.
At line:1 char:1
+ ConvertFrom-CIPolicy .\SupplementalPolicy.xml '{C791D8CB-14C4-4D01-B8 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ParserError: (Microsoft.Secur...CIPolicyCommand:ConvertFromCIPolicyCommand) [ConvertFrom
   -CIPolicy], CIPolicyException
    + FullyQualifiedErrorId : InvalidPolicyFile,Microsoft.SecureBoot.UserConfig.ConvertFromCIPolicyCommand

Actual behavior

No error is shown on the console

Error details

No response

Environment data

Name                           Value
----                           -----
PSVersion                      7.3.3
PSEdition                      Core
GitCommitId                    7.3.3
OS                             Microsoft Windows 10.0.25300
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions