windows-powershell-docs icon indicating copy to clipboard operation
windows-powershell-docs copied to clipboard

Export-StartLayout exports as JSON, not XML as suggested

Open dantheman213 opened this issue 2 years ago • 0 comments

Export-StartLayout says that it exports as XML but the output is actually in JSON. Subsequently, trying to import using Import-StartLayout command fails because it is not expected format.

Affected pages:

https://learn.microsoft.com/en-us/powershell/module/startlayout/export-startlayout?view=windowsserver2022-ps

https://learn.microsoft.com/en-us/powershell/module/startlayout/import-startlayout?view=windowsserver2022-ps

OS: Windows 11 Pro

Version: 21H2

OS Build: 22000.1042

Experience: Windows Feature Experience Pack 1000.22000.1042.0

CLI output:

PS C:\Users\myuser\Desktop> Export-StartLayout -Path "file.xml"
PS C:\Users\myuser\Desktop> Import-StartLayout -LayoutPath ".\file.xml" -MountPath "C:\"
Import-StartLayout : The file C:\Users\myuser\Desktop\file.xml is not a valid layout file
At line:1 char:1
+ Import-StartLayout -LayoutPath ".\file.xml" -MountPath "C:\"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Import-StartLayout], InvalidDataException
    + FullyQualifiedErrorId : System.IO.InvalidDataException,Microsoft.Windows.StartLayout.Commands.ImportStartLayoutComma
   nd

PS C:\Users\myuser\Desktop> cat .\file.xml
{"pinnedList":[{"packagedAppId":"Microsoft.WindowsStore_8wekyb3d8bbwe!App"}, ......

Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

dantheman213 avatar Sep 29 '22 00:09 dantheman213