Ok! Heard me out. While I was playing around with PowerShell Studio to create a form to display results coming from $PSversionTable in PSCore6 psobjects exported to clixml to then import to a psobject in Windows PowerShell.
I found out the Import-CliXml will error out in Windows PowerShell with the following message:
Import-Clixml : SemanticVersion XML tag is not recognized. Line 81, position 8.
At line:1 char:10
+ $psobj = Import-Clixml -Path c:\Temp\pwshobject602.xml;
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Import-Clixml], XmlException
+ FullyQualifiedErrorId : System.Xml.XmlException,Microsoft.PowerShell.Commands.ImportClixmlCommand
Of course, this is not a Windows PowerShell issue as the workaround below works.
WorkAround
Via code I had to fix the xml tag;
:
$line.Replace('SemanticVersion', 'Version');
:

After fixing the xml tag then my application works. This only happens with the $PSVersionTable.

Steps to reproduce
## - Execute in PSCore 6.0.2:
(Get-Variable PSVersionTable).value.GetEnumerator()| Export-Clixml -Path c:\Temp\pwshobject602.xml;
## - Execute in Windows PowerShell:
$psobj = Import-Clixml -Path c:\Temp\pwshobject602.xml;
Import-Clixml : SemanticVersion XML tag is not recognized. Line 81, position 8.
At line:1 char:10
+ $psobj = Import-Clixml -Path c:\Temp\pwshobject602.xml;
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Import-Clixml], XmlException
+ FullyQualifiedErrorId : System.Xml.XmlException,Microsoft.PowerShell.Commands.ImportClixmlCommand
Expected behavior
To import the CliXml to a PSobject without any error.
Actual behavior
Error: "Import-Clixml : SemanticVersion XML tag is not recognized. Line 81, position 8."
Environment data
## - PSCore6:
PS [156] > $PSVersionTable
Name Value
---- -----
PSVersion 6.0.2
PSEdition Core
GitCommitId v6.0.2
OS Microsoft Windows 10.0.17127
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Ok! Heard me out. While I was playing around with PowerShell Studio to create a form to display results coming from $PSversionTable in PSCore6 psobjects exported to clixml to then import to a psobject in Windows PowerShell.
I found out the Import-CliXml will error out in Windows PowerShell with the following message:
Of course, this is not a Windows PowerShell issue as the workaround below works.
WorkAround
Via code I had to fix the xml tag;
After fixing the xml tag then my application works. This only happens with the $PSVersionTable.
Steps to reproduce
Expected behavior
To import the CliXml to a PSobject without any error.
Actual behavior
Error: "Import-Clixml : SemanticVersion XML tag is not recognized. Line 81, position 8."
Environment data