OSDBuilder
OSDBuilder copied to clipboard
Copy StartLayout fails - Wrong path
Hi there,
when using OSDBuilder I encountered an error. When applying the start layout the copy process fails because of a wrong path. The issue is in OSD-OSBuild.ps1 at line 186.
This line currently is:
Copy-Item -Path "$OSDBuilderContent\$StartLayoutXML" -Destination "$MountDirectory\Users\Default\AppData\Local\Microsoft\Windows\Shell\LayoutModification.xml" -Recurse -Force | Out-Null
The error is here that $StartLayoutXML already contains $OSDBuilderContent so this can be left and the new line would be:
Copy-Item -Path "$StartLayoutXML" -Destination "$MountDirectory\Users\Default\AppData\Local\Microsoft\Windows\Shell\LayoutModification.xml" -Recurse -Force | Out-Null
I have the same issue when copying the unattend.xml file. The problem here is also in OSD-OSBuild.ps1 on line 206 and 207, but as far as I can see this also affects the process of adding packages.
If you have any further questions, please feel free to contact me.
Sorry just saw this. Can you run Get-OSDBuilder and look at the Home path. Do you have a trailing backslash? This could be causing the issue
Sorry just saw this. Can you run Get-OSDBuilder and look at the Home path. Do you have a trailing backslash? This could be causing the issue
I would recommend using Join-Path in your scripts. Doing so will avoid issues when combining variables and strings for a full path. Such as in the case of the trailing backslash you're asking about.
Such as: $JoinedPath = Join-Path -Path $MountDirectory -ChildPath "Users\Default\AppData\Local\Microsoft\Windows\Shell\LayoutModification.xml"
this is still not resolved apparently. as i get the same results today. startlayout.xml fails this happened today 2023-02-16-164723 OS: Use Content StartLayout f:\OSDBuilder\Content\F:\OSDBuilder\Content\StartLayout\StartLayout.xml Copy-Item : Cannot find path 'F:\OSDBuilder\Content\F:\OSDBuilder\Content\StartLayout\StartLayout.xml' because it does not exist. At C:\Program Files\WindowsPowerShell\Modules\OSDBuilder\22.11.1.1\Private\AllFunctions.ps1:426 char:9
-
Copy-Item -Path "$SetOSDBuilderPathContent\$StartLayoutXML" - ...
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : ObjectNotFound: (F:\OSDBuilder\C...StartLayout.xml:String) [Copy-Item], ItemNotFoundException
- FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.CopyItemCommand