windows-powershell-docs
windows-powershell-docs copied to clipboard
Export-StartLayout exports as JSON, not XML as suggested
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.
- ID: 3b2acb98-04c8-242f-8ee8-3c5150160eb5
- Version Independent ID: c1208227-6428-bee1-e2f3-0cda1f35dc1c
- Content: Export-StartLayout (StartLayout)
- Content Source: docset/winserver2022-ps/startlayout/Export-StartLayout.md
- Product: w10
- Technology: windows
- GitHub Login: @JasonGerend
- Microsoft Alias: jgerend