Skip to content

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

Closed

Description

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

Activity

  1. added
    Needs-Triage
    on Feb 25, 2023
  2. changed the title [-]onvertfrom-cipolicy cmdlet errors aren't being displayed on the console in PowerShell 7.3.3[/-] [+]Convertfrom-cipolicy cmdlet errors aren't being displayed on the console in PowerShell 7.3.3[/+] on Feb 25, 2023
  3. changed the title [-]Convertfrom-cipolicy cmdlet errors aren't being displayed on the console in PowerShell 7.3.3[/-] [+]Convertfrom-cipolicy cmdlet error isn't being displayed on the console in PowerShell 7.3.3[/+] on Feb 25, 2023
  4. SteveL-MSFT commented on Feb 27, 2023

    @SteveL-MSFT
    Member

    Looks like the problem is that this module isn't compatible with PS7, so it's loaded via WinPS and the error isn't getting propagated back properly.

    Looking a bit deeper, the problem is that non-terminating errors aren't being propagated back. For now you can work around the issue with:

    convertfrom-cipolicy ... -erroraction stop

    Will need to understand why this seemingly big hole in ps remoting exists.

  5. ghost added
    In-PR
    on Feb 27, 2023
  6. ghost removed
    In-PR
    on Mar 1, 2023
  7. ghost added
    Resolution-Fixed
    on Mar 1, 2023
  8. ghost removed
    Needs-Triage
    on Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution-Fixed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions