PSD icon indicating copy to clipboard operation
PSD copied to clipboard

Issue with xcopy command

Open daooze opened this issue 11 months ago • 3 comments

Hi there.

I have used MDT for plenty of years but I´m new to PSD. Currently testing Windows 11 deployment with PSD version 0.2.3.0. As I wanted to have a similar deployment environment as with MDT, I have set up a fileserver to deploy over SMB. HTTP(S) I will be testing later on.

During my first steps with PSD I stumbled upon an issue when it comes to copying the OS WIM from my fileshare to the local cache folder. This is done using xcopy, defined in PSDUtility.psm1 on line 528. The parameters for the source and destination paths need to be enclosed into double quotes, as at least the source path has a whitespace in it.

The original line reads $null = Start-Process xcopy -ArgumentList "$s $d /s /e /v /d /y /i" -NoNewWindow -Wait -Passthru -RedirectStandardOutput xcopy

The modified line should read $null = Start-Process xcopy -ArgumentList """$s"" ""$d"" /s /e /v /d /y /i" -NoNewWindow -Wait -Passthru -RedirectStandardOutput xcopy

Maybe you can fix that in the repo.

Regards.

daooze avatar Jan 13 '25 15:01 daooze

Hello @daooze,

Unfortunately the SMB method is not supported or endorsed for the PSD solution. You will find this in the documentation section. Although some fellows have been able to change the code and switch to SMB instead of HTTPS, that's not what the solution is designed and intended to be used for. If you search in the issues, you will see similar reports, but the answer is the same as in your case.

GeoSimos avatar Jan 13 '25 18:01 GeoSimos

Hi @GeoSimos ,

thanks for the clarification. I did read the documentaion but did not find anything that says "SMB is not supported"; or maybe I did'nt get it. The scripts include UNC path stuff so I thought it is still an option to use it like with MDT.

I'll go for HTTP then...

daooze avatar Jan 14 '25 08:01 daooze

In my opinion, the term "unsupported" should be replaced with "deprecated" or "no longer actively developed." While this is a community-driven project rather than a commercial product, it's worth clarifying that we’ve shifted focus to more effective solutions. For SMB, while code still exists within the modules, active development has ceased. We’ve prioritized HTTP(S) as it offers a more modern and robust solution, better aligning with the project's evolution.

With that, no matter what you plan on using, I do see a potential "bug" with the xcopy code. If there are spaces in the paths, it should be incapsulated in quotes as you mentioned. This may be something we need to change.

PowerShellCrack avatar Jan 19 '25 14:01 PowerShellCrack