How To: Validate an XML web.config Schema with PowerShell

Follow
    Applies to:
  • SecureAuth Identity Platform
Deployment model:
  • Cloud
  • Hybrid
  • On Premises
  • Version Affected: All

     

    Overview

    This article explains how to quickly check whether an XML file, such as a SecureAuth Identity Platform web.config, is well-formed, using a single PowerShell command.


    1. Open PowerShell.
    2. Run the following, replacing the path with the file to check:
    [xml](Get-Content -Path "D:\Secureauth\SecureAuth0\web.config" -Raw)

    PowerShell window running the command against a valid web.config, showing the parsed xml and configuration properties returned with no error.

    If the file is well-formed, PowerShell parses it and returns its top-level XML properties, as shown above. If the file is not well-formed, PowerShell instead throws an XML parsing error describing where the problem is.




    SecureAuth Knowledge Base Articles provide information based on specific use cases and may not apply to all appliances or configurations. Be advised that these instructions could cause harm to the environment if not followed correctly or if they do not apply to the current use case.

    Customers are responsible for their own due diligence prior to utilizing this information and agree that SecureAuth is not liable for any issues caused by misconfiguration directly or indirectly related to SecureAuth products.

    0 out of 0 found this helpful

    Comments

    0 comments

    Please sign in to leave a comment.