Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to import format data file #119

Open
BernieWhite opened this issue Jan 13, 2021 · 0 comments
Open

Failed to import format data file #119

BernieWhite opened this issue Jan 13, 2021 · 0 comments
Labels
documentation An issue or feature that affects documentation instead of code

Comments

@BernieWhite
Copy link
Member

BernieWhite commented Jan 13, 2021

When importing PSDocs module, importing PSDocs.Format.ps1xml may fail if PSDocs.dll is blocked by Windows because it was downloaded from the PowerShell Gallery.

Import-Module : Errors occurred while loading the format data file:
C:\Program Files\WindowsPowerShell\Modules\PSDocs\0.7.0\PSDocs.Format.ps1xml, Error at XPath
/Configuration/ViewDefinitions/View[1] in file C:\Program
Files\WindowsPowerShell\Modules\PSDocs\0.7.0\PSDocs.Format.ps1xml: A node is missing from TableControl, ListControl,
WideControl, CustomControl.
C:\Program Files\WindowsPowerShell\Modules\PSDocs\0.7.0\PSDocs.Format.ps1xml, Error at XPath
/Configuration/ViewDefinitions/View[1]/TableControl/TableHeaders in file C:\Program
Files\WindowsPowerShell\Modules\PSDocs\0.7.0\PSDocs.Format.ps1xml: The column header definition is not valid; all
headers are discarded.

C:\Program Files\WindowsPowerShell\Modules\PSDocs\0.7.0\PSDocs.Format.ps1xml, Error at XPath
/Configuration/ViewDefinitions/View[1]/TableControl/TableHeaders/TableColumnHeader[1]/Label in file C:\Program
Files\WindowsPowerShell\Modules\PSDocs\0.7.0\PSDocs.Format.ps1xml: The resource PSDocs.Resources.ViewStrings in
assembly C:\PSDocs is not found.
At line:1 char:1
+ Import-Module PSDocs.Azure
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Import-Module], RuntimeException
    + FullyQualifiedErrorId : FormatXmlUpdateException,Microsoft.PowerShell.Commands.ImportModuleCommand

We should add a note for troubleshooting this issue.

It can be fixed by using Unblock-File.

For example:

Get-ChildItem -Path 'C:\Program Files\WindowsPowerShell\Modules\PSDocs\' | Unblock-File;

See issue Azure/PSDocs.Azure#25.

@BernieWhite BernieWhite added the documentation An issue or feature that affects documentation instead of code label Jan 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation An issue or feature that affects documentation instead of code
Projects
None yet
Development

No branches or pull requests

1 participant