I’m honestly not sure - I haven’t tried making a powershell connection out to a windows share. I rather suspect it won’t work since linux doesn’t natively support UNC paths. A quick google seems to confirm this suspicion.
Another problem with this approach is exposing credentials directly in the powershell script (or having a world writable share someplace) - probably not the best approach when there are other options that could do it in a secure manner.