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

Error importing the PSDocs.Azure module #25

Closed
vicperdana opened this issue Jan 12, 2021 · 5 comments
Closed

Error importing the PSDocs.Azure module #25

vicperdana opened this issue Jan 12, 2021 · 5 comments

Comments

@vicperdana
Copy link
Contributor

vicperdana commented Jan 12, 2021

Description of the issue

Received this error after installing.

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

To Reproduce

Steps to reproduce the issue:

Install-Module -Name 'PSDocs.Azure' -Repository PSGallery;
Import-Module PSDocs.Azure

Expected behaviour

Imported successfully without any error.

Error output

Capture any error messages and or verbose messages with -Verbose.

VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\PSDocs.Azure\0.1.0\PSDocs.Azure.psd1'.
VERBOSE: Cannot verify the Microsoft .NET Framework version 4.7.2 because it is not included in the list of permitted
versions.
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 -Verbose
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Import-Module], RuntimeException
    + FullyQualifiedErrorId : FormatXmlUpdateException,Microsoft.PowerShell.Commands.ImportModuleCommand

Module in use and version:

  • Module: PSDocs.Azure
  • Version: 0.7.0

Captured output from $PSVersionTable:

Name                           Value
----                           -----
PSVersion                      5.1.19041.610
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.610
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Additional context

Add any other context about the problem here.

@BernieWhite
Copy link
Contributor

BernieWhite commented Jan 12, 2021

@vicperdana That's a little weird. Have you tried PS 7.x?

Also do you get the same issue with just Import-Module PSDocs?

What's the output of Get-Culture?

@BernieWhite BernieWhite added the bug Something isn't working label Jan 12, 2021
@vicperdana
Copy link
Contributor Author

@BernieWhite It imported fine in PS 7.

Get-Culture & PSVersionTable outputs

LCID             Name             DisplayName
----             ----             -----------
3081             en-AU            English (Australia)

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

@BernieWhite
Copy link
Contributor

BernieWhite commented Jan 12, 2021

@vicperdana Thanks. I can't reproduce it. Can you check if the .dll is blocked for some reason. C:\Program Files\WindowsPowerShell\Modules\PSDocs\0.7.0\PSDocs.dll. The verbose output points to it not being loaded for some reason.

i.e.

Unblock-File 'C:\Program Files\WindowsPowerShell\Modules\PSDocs\0.7.0\PSDocs.dll';

Should look like:

Import-Module PSDocs -Verbose
VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\PSDocs\0.7.0\PSDocs.psd1'.
VERBOSE: Cannot verify the Microsoft .NET Framework version 4.7.2 because it is not included in the list of permitted
versions.
VERBOSE: Loading 'Assembly' from path 'C:\Program Files\WindowsPowerShell\Modules\PSDocs\0.7.0\PSDocs.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Program Files\WindowsPowerShell\Modules\PSDocs\0.7.0\PSDocs.dll'.
VERBOSE: Loading 'FormatsToProcess' from path 'C:\Program
Files\WindowsPowerShell\Modules\PSDocs\0.7.0\PSDocs.Format.ps1xml'.
VERBOSE: Populating RepositorySourceLocation property for module PSDocs.
VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\PSDocs\0.7.0\PSDocs.psm1'.
VERBOSE: Importing function 'Document'.
VERBOSE: Importing function 'Get-PSDocument'.
VERBOSE: Importing function 'Get-PSDocumentHeader'.
VERBOSE: Importing function 'Invoke-PSDocument'.
VERBOSE: Importing function 'New-PSDocumentOption'.
Import-Module PSDocs.Azure -Verbose
VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\PSDocs.Azure\0.1.0\PSDocs.Azure.psd1'.
VERBOSE: Cannot verify the Microsoft .NET Framework version 4.7.2 because it is not included in the list of permitted
versions.
VERBOSE: Loading 'Assembly' from path 'C:\Program Files\WindowsPowerShell\Modules\PSDocs.Azure\0.1.0\PSDocs.Azure.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Program Files\WindowsPowerShell\Modules\PSDocs.Azure\0.1.0\PSDocs.Azure.dll'.
VERBOSE: Populating RepositorySourceLocation property for module PSDocs.Azure.
VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\PSDocs.Azure\0.1.0\PSDocs.Azure.psm1'.
VERBOSE: Importing function 'Get-AzDocTemplateFile'.

@vicperdana
Copy link
Contributor Author

Yup, that worked fine. Tested in 5.1 - thanks @BernieWhite

Import-Module PSDocs.Azure -Verbose
VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\PSDocs.Azure\0.1.0\PSDocs.Azure.psd1'.
VERBOSE: Cannot verify the Microsoft .NET Framework version 4.7.2 because it is not included in the list of permitted
versions.
VERBOSE: Loading 'Assembly' from path 'C:\Program Files\WindowsPowerShell\Modules\PSDocs.Azure\0.1.0\PSDocs.Azure.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Program Files\WindowsPowerShell\Modules\PSDocs.Azure\0.1.0\PSDocs.Azure.dll'.
VERBOSE: Populating RepositorySourceLocation property for module PSDocs.Azure.
VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\PSDocs.Azure\0.1.0\PSDocs.Azure.psm1'.
VERBOSE: Importing function 'Get-AzDocTemplateFile'.

@vicperdana
Copy link
Contributor Author

Just to note that after running the following command - the issue was resolved. Tested on both PS 5.1 and 7.0.3

Unblock-File 'C:\Program Files\WindowsPowerShell\Modules\PSDocs\0.7.0\PSDocs.dll';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants